We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

Will myshopifyDomain from shop will always be equal to X-Shopify-Shop-Domain from webhook headers?

Will myshopifyDomain from shop will always be equal to X-Shopify-Shop-Domain from webhook headers?

Faateh
Shopify Partner
17 0 1

I want to do some process based on webhooks. But I don't know from which store it is coming from 
Basically I developed a shopify app where I extracted the shop data using GraphQL API which is given below 

 

"shop": {
      "name": "xyz",
      "email": "xyz@gmail.com",
      "id": "gid://shopify/Shop/1",
      "myshopifyDomain": "xyz.myshopify.com",
      "url": "https://xyz.myshopify.com"
    }
    

I get the following headers from webhook 

 

X-Shopify-Topic: orders/create
X-Shopify-Hmac-Sha256: XWmrwMey6OsLMeiZKwP4FppHH3cmAiiJJAweH5Jo4bM=
X-Shopify-Shop-Domain: johns-apparel.myshopify.com
X-Shopify-API-Version: 2019-04

 

Based on myShopifyDomain, I check from which the webhook is coming from. If they are equal to the X-Shopify-Shop-Domain then I do something afterwards.

Now I am confused that will myshopifyDomain be always equal to the X-Shopify-Shop-Domain even if the store owners deploys it's website on custom domain?
Also I am trying to use shop name to call Shopify API's but it returns nothing and get an error but If I call it using myshopifyDomain, I get success response. Could someone kindly guide if domain will remain same and if i should use myshopifyDomain for Shopify API Calls?

 

Reply 1 (1)

JayAdra
Shopify Partner
195 15 53