API-created webhook for product update missing many fields

Highlighted
Tourist
11 0 0

I am creating a webhook via API.  It can work, if I request the right fields, but the wrong ones cause it to just not fire.  Some fields are spelled weirdly.

product-type MUST be spelled product_type.   

body-html MUST be spelled body_html

tags DOES NOT WORK at all

I cannot retrieve info that is attached to the (default) variant on this product.

Sometimes when I "misspell" a field name, the event just does not fire.

Is there a list of usable fields please?  This guessing thing has me pulling my hairs out ... 

Please advise ... What am I doing wrong?  Thanks jb

-------------------------------------------

Creating a webhook as follows

mutation {
  webhookSubscriptionUpdate (
    id: "gid://shopify/WebhookSubscription/877791117476",
    webhookSubscription: {
    format:XML,
    includeFields: ["id", "title", "key", "value", "product_type", "body_html", "tags"],
    metafieldNamespaces: ["strand designer"]
    }
  )
  {
    webhookSubscription { topic id includeFields metafieldNamespaces }
  
userErrors {
field
message
}
  } }
 
--------------------
Reply:
 
{
"data": {
"webhookSubscriptionUpdate": {
"webhookSubscription": {
"topic": "PRODUCTS_UPDATE",
"id": "gid://shopify/WebhookSubscription/877791117476",
"includeFields": [
"id",
"title",
"key",
"value",
"product_type",
"body_html",
"inventory_quantity"
],
"metafieldNamespaces": [
"strand designer"
]
},
"userErrors": []
}
},
"extensions": {
"cost": {
"requestedQueryCost": 10,
"actualQueryCost": 10,
"throttleStatus": {
"maximumAvailable": 1000,
"currentlyAvailable": 990,
"restoreRate": 50
}
}
}
}
 
-----------------
 
0 Likes
Shopify Staff
Shopify Staff
502 98 90

I would utilize the Rest API documentation along with the sample responses here: https://shopify.dev/docs/admin-api/rest/reference/events/webhook?api[version]=2020-04

Vix | Developer Support @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 


0 Likes