What causes the Product Update webhook to fire?

fallen-domino
Shopify Partner
68 0 13

We have a headless shop selling digital products that do not track inventory, while static builds (it's a Gatsby website) are triggered when a product is updated.  However, every time a product is sold, it triggers an unneeded webhook that eat through the build minutes pretty quickly.

Anyone have some technical insight into what causes a product update webhook to fire?

The other option for us would be to create an app that intercepts the webhook, determines if any info about the product has been updated that requires a rebuild, then trigger Netlify to build & deploy.

Thanks

Replies 3 (3)

james-langille
Shopify Staff (Retired)
70 15 27

Hello @fallen-domino,

products/update webhooks do also trigger on inventory level changes, which has caused similar confusion for other apps in the past. We are thinking about how to provide more granular webhooks (i.e. so that you can only be notified on changes that your app cares about), but there's a lot of design and technical discussion that still needs to happen in order to get there.

In the meantime, creating an app that performs custom de-duplication based on only the fields your app would care about to do your build & deploy sounds like safe route to take to me.

To learn more visit the Shopify Help Center or the Community Blog.

fallen-domino
Shopify Partner
68 0 13

Thanks for the clarification @james-langille.  I'm a little confused then when it comes to digital products.  These products aren't tracking inventory, but webhooks are still firing for every purchase.  Is there a resource I can take a look at which outlines everything that would trigger the webhook?

fallen-domino
Shopify Partner
68 0 13

@james-langille ,

I did a comparison of two product update webhook events for the same product and the only difference was the "updated_at" property.  Do you know if this is intentional?