Have your say in Community Polls: What was/is your greatest motivation to start your own business?
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Shop Identification: Shop ID vs Shop Domain

Solved

Shop Identification: Shop ID vs Shop Domain

ottero
Shopify Partner
19 0 9

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?

Accepted Solution (1)
rhaveneers
Shopify Partner
6 2 6

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.

 

rhaveneers_0-1680112015499.png

 

View solution in original post

Replies 4 (4)

rhaveneers
Shopify Partner
6 2 6

As far as I now, shop domain/shop name is unique and you can use this to identify the shop

ottero
Shopify Partner
19 0 9

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.

rhaveneers
Shopify Partner
6 2 6

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.

 

rhaveneers_0-1680112015499.png

 

zksumon
Shopify Partner
9 0 2

hi do you get the shop domain from request headers?