Topics covering webhook creation & management, event handling, Pub/Sub, and Eventbridge, in Shopify apps.
What is the content/body of a webhook?
I have a product/update webhook and the body appears to be {}
Is this correct? is the body empty or a empty json object?
I would have assumed it would be the full json for the product that was updated.
Is this documented anywhere?
Hey there,
Unless it's a sneaky bug (though I doubt), the conent Shopify returns can't be just an empty JSON. As to the possible payloads, please check https://help.shopify.com/api/reference/webhook. Responses vary depedning on the object srouce.
I'd also suggest you looking at the JSON decoding logic, ideally would be to have the body received from Shopify dumped into a file or console and see what you have there, before attempting to decode the json and map it to an object.
Hope that helps,
Sergiu
I have narrowed down the issue and want to know if this is a bug or by design?
If I create a product/update webhook through the shop admin as a shop owner. When the webhook fires I receive the full product json, in the response body.
If I create a product/update webhook through the API as a app developer. When the webhook fires I receive only {} in the response body.
Is this correct or a bug?
No, that is not expected to work so. Would you paste an example of payload you are using to create the webhook?