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

Topic summary

A Shopify app developer wants to identify which store a webhook originates from and is matching the GraphQL shop.myshopifyDomain (e.g., qa-testingd.myshopify.com) to the webhook header X-Shopify-Shop-Domain. They ask if these will always be equal, including when a merchant uses a custom storefront domain.

Context:

  • Shop data from GraphQL includes name, email, id, myshopifyDomain, and url.
  • Webhook headers include X-Shopify-Topic (orders/create), X-Shopify-Hmac-Sha256, X-Shopify-Shop-Domain, and X-Shopify-API-Version.

Key questions:

  • Is X-Shopify-Shop-Domain always the myshopify.com domain and thus equal to shop.myshopifyDomain, regardless of custom domains?
  • Should API calls use shop name (which failed) or the myshopifyDomain (which worked)?

Clarifications sought:

  • Understanding that myshopifyDomain is the canonical Shopify subdomain and whether webhooks consistently reference it.

Status: No answers or resolutions provided yet; the thread remains open with unanswered questions about domain consistency and best practice for API calls.

Summarized with AI on December 29. AI used: gpt-5.

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": "Qa_Testingd",
      "email": "xyz@gmail.com",
      "id": "gid://shopify/Shop/1",
      "myshopifyDomain": "qa-testingd.myshopify.com",
      "url": "https://qa-testingd.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 so but when 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?