In webhook order/create, how do we identify from which store the order has come from?

Solved
Highlighted
Shopify Partner
24 2 6

I cannot find any field in order/create webhook JSON data which tells which shop created the order.

1 Like
Highlighted
Shopify Partner
24 2 6

This is an accepted solution.

After you configure a webhook subscription, the events that you specified will trigger a webhook notification each time they occur. This notification contains a JSON payload, and HTTP headers that provide context. For example, the orders/create webhook includes the following headers:

 

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

Some HTTP headers are particularly useful for your app. For example, X-Shopify-Hmac-Sha256 is used to verify webhooks, and X-Shopify-Shop-Domain is used to identify the store that's associated with them.

1 Like
Highlighted
Excursionist
15 1 6

The real MVP.

 

Coming back to answer his own question. *thumbs up*

2 Likes