How to get the store URL from "orders/create" webhook data?

Hello everyone, I’m working with a Remix App which is subscribed to the orders/create webhook. I am receiving the order data which I can process further.

The problem that I’m facing is that I don’t have a unique identifier that can identify the shopify store from which I’m receiving the order data. One attribute I found was referring_site but I read somewhere in the docs that it may change based on the website from which the order was initiated and it may not refer exactly to the shopify store url.

Please help me out in finding a unique store identifier (preferably I want the shop URL) and If there’s something I’m missing, do let me know.

You can use the shop attribute from the webhook payload to get the unique Shopify store identifier.

This value is a domain-specific string like yourstore.myshopify.com, which can be used to identify the store. While the referring_site might change depending on the source of the order, the shop attribute is consistent for each store and is always available in the payload.

You can use this to ensure you’re processing the correct store’s order data.

I cannot find any attribute called “shop” in the orders/create webhook payload. I only found shop_money which is not relevant to my need.

I found out the solution which fulfilled my requirement.

According to this you can easily find the shop URL in the X-Shopify-Shop-Domain header which is available in the webhook request.