New Shopify Certification now available: Liquid Storefronts for Theme Developers

Webhook content

ifyapps
Shopify Partner
3 0 1

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?

 

Replies 3 (3)
Visely-Team
Shopify Partner
1843 210 487

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

Sergiu Svinarciuc | CTO @ visely.io
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
- To learn more about the awesome stuff we do head over to visely.io or our blog
ifyapps
Shopify Partner
3 0 1

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?

 

 

 

 

Visely-Team
Shopify Partner
1843 210 487

No, that is not expected to work so. Would you paste an example of payload you are using to create the webhook?

Sergiu Svinarciuc | CTO @ visely.io
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
- To learn more about the awesome stuff we do head over to visely.io or our blog