Webhook not working like expected

I have some variant metafields configured in my store, including price information, stock, and other internal data from a Seller Portal. To keep this data synchronized, I created a product update webhook that receives the changes and, through the Admin API, updates the price and stock of the variants correctly. The flow works fine, but only when the update is done directly through the Shopify admin. When the metafields are updated by the Seller Portal to the Shopify admin, the webhook is not triggered.

I’m pretty sure it’s by design the metafieldsSet mutation doesnt trigger product or variant updates.

Might work if you can make the Seller Portal update metafields through the product/variant resource mutations instead. Or make a no-op call to those endpoints to trigger the webhook after the metafieldsSet solution.

I concur. And it’s quite surprising to find out that product update is called for some metafield updates but not others. I wonder how many bugs this has caused :thinking: But okay that’s fine. You can just query metafield value updates since a certain timeframe —no! You cannot search by updated at on a metafield, can you. What a setup! You really have to search through all products to find a true update‽

@sshaw I don’t search through all products to find the correct one; with the Webhook, I receive exactly the product whose registration was updated, and this works very well. But when the update is only made to the variant metafield of that product, the Webhook is not triggered.

But when the update is only made to the variant metafield of that product, the Webhook is not triggered.

I understand. And my point is, unless you control the metafield, the hook is not a reliable way to determine if a metafield update has occurred. Given the current paradigm the only way to do it is to check all products with the metafield :frowning: