Topics covering webhook creation & management, event handling, Pub/Sub, and Eventbridge, in Shopify apps.
Hey everyone!
What exactly is the intended way to identify a shop? Intuitively I would use the numerical shop ID to identify a shop and store information in our backend with that ID. But it seems that shopify is usually providing only the shop domain. Example: The webhook events provide metadata with the shop domain, but not the shop ID. If I want to use the ID, I have to make another request to get the actual shop ID using the domain for which I need the shop access token again (even though I don't want to use the admin API when handling the webhook event).
Using the domain for identifying a shop on our end seems error prone, as the domain can change.
Am I missing something? What do you use in your backend for shop identification?
Solved! Go to the solution
This is an accepted solution.
A merchant can change the shop name, the one displayed to users, but not the shop domain. We use the xyz.myshopify.com domain as identifier, which must be unique and can not be changed.
As far as I now, shop domain/shop name is unique and you can use this to identify the shop
Thank you @rhaveneers for the reply. Yes, the domain is unique. But it can be changed by the shop owner, right? If I store data for xyz.myshopify.com in my backend and later on the shop owner changes it to shop.xyz.com then my previously stored shop data doesn't match with the new domain.
This is an accepted solution.
A merchant can change the shop name, the one displayed to users, but not the shop domain. We use the xyz.myshopify.com domain as identifier, which must be unique and can not be changed.
hi do you get the shop domain from request headers?