Conversations about creating, managing, and using metafields to store and retrieve custom data for apps and themes.
There a few posts somewhat related but I'll start a fresh topic because a lot of information seems very outdated.
Why is there no webhook for metafields?
We have noticed that if a product metafield is created/updated, the product webhook fires.
Same for order.
However, it is not the case for other types of entities such as customers, variants, collections, etc...
Is there a solution?
Hey @ClementBR ,
I like that you took the time to make a fresh post actually, I hope that anyone else looking for this finds it and shares their thoughts as well.
This has been a longstanding issue if I recall correctly, and one that we've spoken about before. I know I've logged this as an issue before and I'll find it again and make some more noise to try to get attention on it again. It's not an issue that I know of a solution to though and I would call this a bug.
Metafield webhooks technically exist, they're just resource-specific and require adding metafield_namespaces to the payload sent when setting up a new webhook subscription. I would imagine just having a general webhook create/update webhook topic would result in a ton of noise and webhook traffic, most of which the clients consuming the webhooks wouldn't find any value in - so I'm not sure creating a new topic would be the ideal solution here. I'd prefer we just fixed the bug and mde sure that the behaviour was consistent across every resource.
Josh | Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit the Shopify Help Center or the Shopify Blog
Hi @Josh,
Yes it is indeed a long standing issue.
I do believe a separate topic for metafields would be ideal because as you said many apps won't care about metafields.
For the ones that do, it is is critical though.
As for metafield_namespaces, the problem is that we need to know when ANY metafield was changed.
Unless we could pass '*' as a namespace to indicate we want to listen to all namespaces?
Hey again @ClementBR ,
Interesting thought, could you shed some light on the ideal use-case for listening to every metafield change? Are you reporting on those somehow?
Josh | Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit the Shopify Help Center or the Shopify Blog
Yes, it is indeed for reporting purposes.
We need reports to load reasonably fast and the only way to do that is to keep the metafields in sync locally.
Even with the graph bulk metafield loading capabilities, reports that aggregate a lot of data would still need to make many calls and it would cause reports to load very slowly, if at all.
Hey again Clement,
Fair enough - I just think that the vast majority of webhooks I've seen wouldn't be relevant to third-parties, but I can understand after filtering out the excess noise how this might be useful. I'd somewhat prefer to have the root issue of the update behaviour being inconsistent resolved first, but I'll file a request for a new webhook as well.
Josh | Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit the Shopify Help Center or the Shopify Blog
A separate topic would be mean that only apps interested in metafields would subscribe, which should remove the noise issue which is present today (for orders and products at least).
Thanks for that Josh. I hope the request gets traction!