I’m able to configure a webhook for the “products/update” topic that sends my app both product and variant data. Webhooks fire as expected when I update products and variants and their metafields.
The issue is when you configure “metafield_namespaces” on the webhook, they are for the products and not the variants. Is it possible to configure the webhook to return the variant metafields?
In the data Shopify sends, there is a key in each variant called
“metafields”, but it is always empty and there is absolutely nothing in the
docs about that.
Hey guys! For anyone looking at this in the present day, I figured it out for me - if you include the variant metafield namespace in your “metafieldNamespaces” array when making the webhook, those webhooks will turn up in “metafields” in “variants”. I tried subscribing with no metafieldNamespaces - nothing. I tried with the variant metafield namespace - voila.
I still did not receive webhook when the metafield value was updated, but when I update any other variant details like sku value etc then i receive the webhook.