Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get Shopify Shop ID inside of product/update Webhook?

I'm developing a Shopify app that sets up a "product/create" Webhook through the Shopify API.

While the Webhook is sending a POST to the correct address with no problem, it seems that it is not supplying the ID of the shop that the product has been created for. This is a problem because I need to store metadata for the shop and its products. I need to ensure that the link exists in my database between the shop and its products.

Is there a way to either:

  • Find the shop ID for the product which is being given to me through the Webhook

  • Configure the Webhook with custom data that is handed back when the webhook sends its request, so that I can force it to hand back the shop ID when I create it

Thanks in advance!

like image 644
alexsanford1 Avatar asked Oct 24 '25 05:10

alexsanford1


1 Answers

When Shopify sends request to your webhook url. it will also send some extra details in HTTP header.

You can find X-Shopify-Shop-Domain header which will contain domain name of store. From domain name you can extract name of store.

it also contains X-Shopify-Hmac-SHA256 to verify aunthenticity of request.

like image 151
Arjun Vachhani Avatar answered Oct 26 '25 18:10

Arjun Vachhani