PRODUCT_UPDATE not triggering when product description is updated by store

dylangrant
Shopify Partner
4 0 0

I am working on a public app. I created a http webhook for the topic PRODUCT_UPDATE and have verified that I receive a payload when the product is title and various other fields are updated. However, the most important to my app is description updates and that doesn't seem to be working. This is my create webhook mutation with that topic

 

 

 

mutation {
    webhookSubscriptionCreate(
      topic: PRODUCTS_UPDATE
      webhookSubscription: {
        format: JSON,
        callbackUrl: "https://my_endpoint"
        includeFields: [
          "collections",
          "description",
          "descriptionHtml",
          "id",
          "images",
          "metafields",
          "productCategory",
          "productType",
          "status",
          "tags",
          "title",
          "variants",
          "vendor"
        ]
      }  
    ) {
      userErrors {
        field
        message
      }
      webhookSubscription {
        id
      }
    }
  }

 

 

 


Am I doing something wrong? Is description or descriptionHtml not an option to trigger a webhook? Could it be because I didn't delete older subscriptions to PRODUCT_CREATE (and if so, how do I get a list of my subscriptions so I can delete old ones)?

Replies 4 (4)

SBD_
Shopify Staff
1829 269 407

Hey @dylangrant 

 

A description change should trigger a product update notification.

 

how do I get a list of my subscriptions so I can delete old ones
Try the webhookSubscriptions query: 
https://shopify.dev/docs/api/admin-graphql/2024-01/queries/webhookSubscriptions

 

Let me know if you're still not seeing it 🤔

Scott | Developer Advocate @ Shopify 

dylangrant
Shopify Partner
4 0 0

I added the query to get my subscriptions. This is the subscribed PRODUCTS_UPDATE result.

 

 

{
  id: "gid://shopify/WebhookSubscription/my_sub_id",
  includeFields: [
    "collections",
    "descriptionHtml",
    "id",
    "images",
    "metafields",
    "productCategory",
    "productType",
    "status",
    "tags",
    "title",
    "variants",
    "vendor",
  ],
  topic: "PRODUCTS_UPDATE",
  endpoint: {
    __typename: "WebhookHttpEndpoint",
    callbackUrl: "https://my_endpoint",
  },
}

 

 

So, I know it's subscribed right. Here's what I receive when I update a title on my test store:

ngrok - `POST /webhooks/shopify/product/update 200 OK`

 

 

update request body {
  id: 5555555,
  images: [
    {
      id: 55oo55,
      product_id: 5555555,
      position: 1,
      created_at: '2024-02-27T12:36:23-05:00',
      updated_at: '2024-02-27T12:36:24-05:00',
      alt: null,
      width: 128,
      height: 112,
      src: 'https://cdn.shopify.com',
      variant_ids: [],
      admin_graphql_api_id: 'gid://shopify/ProductImage/45160602206481'
    }
  ],
  metafields: [],
  status: 'draft',
  tags: '',
  title: 'Webhook Title',
  variants: [
    {
      admin_graphql_api_id: 'gid://shopify/ProductVariant/1234235',
      barcode: '',
      compare_at_price: null,
      created_at: '2024-02-21T17:55:18-05:00',
      fulfillment_service: 'manual',
      id: 2235342534,
      inventory_management: 'shopify',
      inventory_policy: 'deny',
      position: 2,
      price: '0.00',
      product_id: 21543532,
      sku: '',
      taxable: true,
      title: 'Default Title',
      updated_at: '2024-02-27T12:35:24-05:00',
      option1: 'Default Title',
      option2: null,
      option3: null,
      grams: 454,
      image_id: null,
      weight: 1,
      weight_unit: 'lb',
      inventory_item_id: 324435,
      inventory_quantity: 0,
      old_inventory_quantity: 0,
      requires_shipping: true
    }
  ],
  vendor: 'my vendor',
  variant_ids: [ { id: 242353543 } ]
}

 

 

 

I don't receive anything when I update the product description on the test store and save - no ngrok request, and obviously because of that, no request that hits the endpoint. Any thoughts?

dylangrant
Shopify Partner
4 0 0

Any ideas why I'm not seeing it?

dylangrant
Shopify Partner
4 0 0

Nevermind, I think I figured it out. Once I deleted the old one, and re-added the subscription it started triggering on description updates. My guess is that I didn't have it descriptionHtml as an included fields. It is odd though that even though it's triggering, it's not including the descriptionHtml in the response object:

update request body {
  id: 5555555,
  images: [
    {
      id: 55oo55,
      product_id: 5555555,
      position: 1,
      created_at: '2024-02-27T12:36:23-05:00',
      updated_at: '2024-02-27T12:36:24-05:00',
      alt: null,
      width: 128,
      height: 112,
      src: 'https://cdn.shopify.com',
      variant_ids: [],
      admin_graphql_api_id: 'gid://shopify/ProductImage/45160602206481'
    }
  ],
  metafields: [],
  status: 'draft',
  tags: '',
  title: 'Webhook Title',
  variants: [
    {
      admin_graphql_api_id: 'gid://shopify/ProductVariant/1234235',
      barcode: '',
      compare_at_price: null,
      created_at: '2024-02-21T17:55:18-05:00',
      fulfillment_service: 'manual',
      id: 2235342534,
      inventory_management: 'shopify',
      inventory_policy: 'deny',
      position: 2,
      price: '0.00',
      product_id: 21543532,
      sku: '',
      taxable: true,
      title: 'Default Title',
      updated_at: '2024-02-27T12:35:24-05:00',
      option1: 'Default Title',
      option2: null,
      option3: null,
      grams: 454,
      image_id: null,
      weight: 1,
      weight_unit: 'lb',
      inventory_item_id: 324435,
      inventory_quantity: 0,
      old_inventory_quantity: 0,
      requires_shipping: true
    }
  ],
  vendor: 'my vendor',
  variant_ids: [ { id: 242353543 } ]
}