Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

Payload missing when webhook created using API

Payload missing when webhook created using API

Kirnski
Shopify Partner
1 0 0

 Hi, 
1. I created a webhook using the REST API. (create/order)
2. When the order is created, it is triggered but the payload is empty/data is missing: 
Screenshot 2022-11-24 at 11.41.01.png
 3. When I manually add the webhook (paste the destination url in the section in the notifications ) and send a test notification, the payload is complete. It is also complete, when I then create an order in my store. 

-> It seems like creating the webhook via API creates a problem which I can not grasp....Any help?

Replies 3 (3)

ShopifyDevSup
Shopify Staff
1453 239 535

Hi @Kirnski👋

 

Would you please try the below endpoint to get the list of webhooks with the `order/create` topic? Please be sure to use the original version that was used when creating the webhook subscription. 

 

`/admin/api//webhooks.json?topic=orders/create`

 

Keep in mind that public apps are subject to the protected customer data requirements for versions 2022-10+ which would affect order webhooks as well.

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

ssjoleary
Shopify Partner
2 0 1

Hi @Kirnski ,

 

I came across the same issue as you where the payload only contained an id and note and I couldn't figure out why until I looked at the request I was making to the REST API:

 

POST /admin/api/2023-07/webhooks.json

 

 

{
  "webhook": {
    "topic": "orders/create"
    "address": "https://12345.ngrok.io/",
    "format": "json",
    "fields": ["id", "note"]
  }
}

 

 

I don't know where I copied/pasted this snippet from but when I removed "fields": ["id", "note"] I started to see the full payload.

 

 

{
  "webhook": {
    "topic": "orders/create"
    "address": "https://12345.ngrok.io/",
    "format": "json"
  }
}

 

 

Hopefully that helps!

 

 

FrenzyRider
Shopify Partner
6 0 7

I have the same problem and remove "fields" fixed my problem too!