It seems that the product update webhook is not triggered when only a variant metafield is updated. Based on expected behavior, I believe the webhook should be triggered even when changes are made solely to variant-level metafields.
Currently, the webhook is triggered for general product or variant updates, but not when only a metafield on a variant is changed.
Please refer to the attached image for reference.
Could you please confirm if this is the expected behaviour, or if it’s a bug?
1 Like
Hi @Viral_Mandaliya
It seems that modifying the product matefield will not trigger the webhook
Hi @Viral_Mandaliya,
You are correct, the products/update
webhook does not trigger when a variant metafield is updated. It does trigger on product fields, product metafields, and regular variant fields but not variant metafields. (But if you update a variant metafield the next products/update
webhook you receive, from another update, will contain those updated metafields as well.)
I don’t see any mention of this in the documentation though and it was kind of a surprise when we noticed it. We asked Shopify support and they confirmed that:
To clarify, it is expected that webhooks are triggered when the main product metafields are updated, but not when the variant metafields are, as you are experiencing.
There’s also an old forum post where they seem to confirm that it’s intentional.
My guess is that, with the move to 2048 variants, this is even less likely to get changed which is unfortunate.
Best,
Daniel
Hey @Viral_Mandaliya,
I was just testing here and subscribed to the PRODUCTS_UPDATE webhook making sure to include the metafield namespace in my mutation. I then updated just the metafield on a variant, and the webhook was triggered.
I subscribed using version 2025-04 in my mutation. Also my webhook settings are set as 2025-04.
This is the mutation:
mutation {
webhookSubscriptionCreate(
topic: PRODUCTS_UPDATE,
webhookSubscription: {
callbackUrl: "YOUR.URL.HERE",
format: JSON,
metafieldNamespaces: ["custom"]
}
) {
webhookSubscription {
id
topic
metafieldNamespaces
endpoint {
__typename
... on WebhookHttpEndpoint {
callbackUrl
}
}
format
}
userErrors {
field
message
}
}
}
Then updating only the variant metafield
The webhook was triggered:
"variants": [
{
"admin_graphql_api_id": "gid://shopify/ProductVariant/52999604633622",
...
"metafields": [
{
"id": 147786870816790,
"namespace": "custom",
"key": "variantmetafield",
"value": "3",
...
}
]
},
Can you test again, making sure you’re using the most recent API versions for your webhooks?
2 Likes
Hello @KyleG-Shopify
Thanks for your reply. We have tried this & its working fine even in 2025-01.
I have one more query here. We have to send namespace when we subscribe webhook. Can we get all metafield data in webhook payload without mentioning namespace while subscribing webhook ?
Thanks
Hey @Viral_Mandaliya, you will need to specify the metafields and metafieldNamespaces you want returned in the input WebhookSubscriptionInput - GraphQL Admin
1 Like