Differentiate 'Product-update' webhook on Creating an order and updating a product

Rahul-wk
New Member
3 0 0

Shopify sends webhook of 'product-update' in both cases- Updating a product AND creating an Order. On creating orders, product quantity is deducted from 1st location which is mentioned as per location fulfillment priority. My problems are-

  1. I want to differentiate 'product-update' webhook such that is it coming due to updating the product OR creating an order.

  2. Is there any way in shopify REST API to get the locations as per fulfillment priorities?

Thanks,

0 Likes
Jayvin
Shopify Partner
221 34 57

Hi,

Just read the X-Shopify-Topic from http headers when you receive the webhook on your app. More info here 

0 Likes
Rahul-wk
New Member
3 0 0

Thanks, But I have checked this. The 'X-Shopify-Topic' gives the value 'products/update' in both cases- on updating product and on product update for order creation. So, same value in both cases. Bad luck.

0 Likes
Jayvin
Shopify Partner
221 34 57

Hi,

Yes, logically the product/update webhook will also fire after the order/created webhook has fired.

By the way, why do you want to differentiate between a 'normal' product/update and when product/update webhook occurs from order/created webhook?

0 Likes
Rahul-wk
New Member
3 0 0

Its my app requirement.

0 Likes