Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
After uninstalling the app the uninstalled webhook is triggered so that I can cleanup the user data in my database.
But Iam cleaning up the DB based on shop's ID not the domain because domain can be changed , so to get the shop's ID I have to query the admin API but thats the issue after uninstalling the access token has been revoked immediately.
Any alternate solution would be helpful.
The domain sent in the "x-shopify-shop-domain" header should be the myshopify shop ID, which cannot be changed, so you should be fine to use that. This is different from the public facing domain the shop can configure and change.
Thanks for the reply but the value of this header x-shopify-shop-domain seems to same as the shop front store domain , suppose if anyone changed the domain so this also be changed or not ?
also I saving the shop ID which looks like this : gid://shopify/Shop/<number>
I got this ID by querying
let response = await admin.graphql(
`query {
shop {
name
email
id
url
}
}`,
);
Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025Discover opportunities to improve SEO with new guidance available from Shopify’s growth...
By Jacqui May 1, 2025