Webhook on Product update - but excluding when Ordered

Webhook on Product update - but excluding when Ordered

james-riley
Shopify Partner
2 0 1

Hello all,

 

Our platform integrates with Shopify, and we're wanting to be informed via Webhook when a Product in the Shopify store is updated - a change to the product title, image, price etc. There is the `products/update` webhook, but this also triggers a webhook when the Product is ordered, which creates a lot more unecessary noise. 

 

We see that there is a `product_listings/update` webhook, but this does not seem to trigger when the Product page in the Shopify backoffice is updated. The documentation also contains errors (mentioning publication), and it's not clear exactly how it works. So my questions:

 

1. What's the most lightweight manner in which we can be informed of a Product update when only the listing it updated?

 

2. If `products/update` webhook is our only option here, is that a way to filter down by, or easily identify whether a webhook was triggered by a simple Product update in the Shopify backoffice, as opposed to being updated as a result of an Order in the store?

 

Thank you

Reply 1 (1)

ShopifyDevSup
Shopify Staff
1453 238 508

Hi @james-riley,

 

Thanks for your post. The products/update webhook is still the best one for getting updates about when products have changed. There isn't currently a specific field that identifies what triggered the webhook or a clear way to see if it was due to a sale or an update so we've submitted some feedback on your behalf about how that would be helpful.

 

A roundabout way could be to check if the inventory count of a variant in the webhook has decreased from a previous webhook as well as the updated_at time on the product and the variant whose inventory changed being the same.

 

Hope you have a great day

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog