Product Category is not received from the Shopify product/update webhook

Product Category is not received from the Shopify product/update webhook

Crest-Swapnil
Shopify Partner
1 0 0

I'm not receiving the product_category in the webhook request from Shopify.

For example, I am receiving the following request for products/update webhook.

{
  "id": 8337952899303,
  "title": "Actxa Spur",
  "body_html": "<h3><b><img src=\"//cdn.shopify.com/s/files/1/3097/2940/files/1_6d267f04-45c4-43b5-b10d-28ba369ff731.png?v=1542960277\" alt=\"\"></b></h3>\n<h3><b><img src=\"//cdn.shopify.com/s/files/1/3097/2940/files/2_16291f02-2366-49a9-88d9-081aab0eddb9.png?v=1542960439\" alt=\"\"></b></h3>\n<h3><b><img src=\"//cdn.shopify.com/s/files/1/3097/2940/files/3_2d399d0e-cae4-44ee-b7b1-a27f20b8f196.png?v=1542960472\" alt=\"\"></b></h3>\n<h3><b><img src=\"//cdn.shopify.com/s/files/1/3097/2940/files/4_adfb57cd-d033-4309-a8c1-1a1b4cb86e0c.png?v=1542960498\" alt=\"\"></b></h3>\n<h3><b><img src=\"//cdn.shopify.com/s/files/1/3097/2940/files/5_731c41af-d5ea-4348-8e4b-94831fdc5819.png?v=1542960517\" alt=\"\"></b></h3>\n<h3><b><img src=\"//cdn.shopify.com/s/files/1/3097/2940/files/6_cf422f58-7317-4924-9dcb-e15bb5044356.png?v=1542960542\" alt=\"\"></b></h3>\n<h3><b><img src=\"//cdn.shopify.com/s/files/1/3097/2940/files/screencapture-actxa-sg-spur-2018-11-23-15_58_27.png?v=1542960566\" alt=\"\"></b></h3>\n<h3><b>Actxa Spur Heart Rate + Activity Tracker</b></h3>\n<p>The Actxa Spur is an all-day activity tracker with continuous heart rate monitoring and heart rate zone indicators. Worn on the wrist instead of on the chest like the traditional chest strap, users may customise the list of desired key features to appear on their Actxa Spur daily, via the mobile app.</p>\n<p><img alt=\"\" src=\"https://cdn.shopify.com/s/files/1/3097/2940/t/6/assets/description_image_spur_app.jpg?8347247196518117724\" height=\"100%\" width=\"100%\"></p>\n<h3><b>Key Features:</b></h3>\n<h3><b>Heart Rate (HR) Monitoring</b></h3>\n<p>Supports heart rate monitoring for targeted training needs through six heart rate zones: Relax, Warm up, Fat burn, Cardio, Intense and Max.</p>\n<h3><b>Maximum Heart Rate (Max HR)</b></h3>\n<p>The Actxa Spur automatically calculates your maximum heart rate based on your age. Maximum heart rate can also be manually entered.</p>\n<h3><b>Resting Heart Rate (RHR)</b></h3>\n<p>Use the pre-set timer to determine the day(s) and time to automatically measure your RHR or manually trigger the RHR measurement at any time.</p>\n<h3><b>All Day Activity Tracker</b></h3>\n<p>Tracks daily activities like steps count, amount of calories burnt, active time and distance travelled. Set personal fitness goals and track progress anytime throughout the day.</p>\n<h3><b>Track Your Reports</b></h3>\n<p>Each HR measurement and activity session (see points above) is recorded and synced to the app, where all workout routines are tabulated into easy to read graphs.</p>\n<h3><b>Sleep Monitoring</b></h3>\n<p>Monitors the quality of sleep, by examining movement levels during the night. With better understanding of sleep quality, sleep habits can be changed to improve quality of rest. Activate Auto-sleep mode to automatically record your sleep quality, or do so manually via the app.</p>\n<h3><b>Silent Alarms</b></h3>\n<p>Receive vibrating notifications (one time or recurring) for reminders, meetings, appointments or work schedules, which can be easily configured via the app.</p>\n<h3><b>Smart Screen</b></h3>\n<p>An OLED display with a touch sensor allows you to trigger HR monitoring and toggle between time/date and activities with simple taps.</p>\n<h3><b>Raise-Wrist Display</b></h3>\n<p>Raise wrist to usual viewing position to activate the display.</p>\n<h3><b>Customisable Display</b></h3>\n<p>Choose and customise preferred activities to appear on the display screen via the app.</p>\n<h3><b>Stay Connected</b></h3>\n<p>Using Bluetooth 4.0 technology, the latest Actxa Spur links up with your mobile phone (within 10 metres away), and notifies via light vibrations when a call (with Caller ID displayed on the screen), SMS, message or email is received.</p>\n<h3><b>Sweat/Rain/Splash Resistance</b></h3>\n<p>Able to withstand sweat, light rain and accidental splashing.</p>\n<p> </p>",
  "vendor": "Actxa",
  "product_type": "Smart Watch",
  "created_at": "2023-03-07T12:17:19+05:30",
  "handle": "actxa-spur",
  "updated_at": "2023-07-21T13:45:59+05:30",
  "published_at": null,
  "template_suffix": null,
  "status": "active",
  "published_scope": "web",
  "tags": "Activity Tracker, Actxa, Featured Products",
  "admin_graphql_api_id": "gid://shopify/Product/8337952899303",
  "variants": [
    {
      "id": 46359055958247,
      "product_id": 8337952899303,
      "title": "Grey",
      "price": "59.90",
      "sku": "018227994705",
      "position": 1,
      "inventory_policy": "deny",
      "compare_at_price": "99.00",
      "fulfillment_service": "manual",
      "inventory_management": "shopify",
      "option1": "Grey",
      "option2": null,
      "option3": null,
      "created_at": "2023-03-07T12:17:19+05:30",
      "updated_at": "2023-03-07T12:17:19+05:30",
      "taxable": true,
      "barcode": "018227994705",
      "grams": 500,
      "image_id": 40335172075751,
      "weight": 0.5,
      "weight_unit": "kg",
      "inventory_item_id": 48457650503911,
      "inventory_quantity": 0,
      "old_inventory_quantity": 0,
      "requires_shipping": true,
      "admin_graphql_api_id": "gid://shopify/ProductVariant/46359055958247"
    }
  ],
  "options": [
    {
      "id": 10481134502119,
      "product_id": 8337952899303,
      "name": "Color",
      "position": 1,
      "values": ["Grey", "Red", "Lilac"]
    }
  ],
  "images": [
    {
      "id": 40335172042983,
      "product_id": 8337952899303,
      "position": 1,
      "created_at": "2023-03-07T12:17:19+05:30",
      "updated_at": "2023-03-07T12:17:19+05:30",
      "alt": null,
      "width": 1064,
      "height": 1064,
      "src": "https://cdn.shopify.com/s/files/1/0651/1162/1863/products/651a4ee302545bb3f1fc3ddd6ba2b0b8.jpg?v=1678171639",
      "variant_ids": [46359055991015],
      "admin_graphql_api_id": "gid://shopify/ProductImage/40335172042983"
    }
  ],
  "image": {
    "id": 40335172042983,
    "product_id": 8337952899303,
    "position": 1,
    "created_at": "2023-03-07T12:17:19+05:30",
    "updated_at": "2023-03-07T12:17:19+05:30",
    "alt": null,
    "width": 1064,
    "height": 1064,
    "src": "https://cdn.shopify.com/s/files/1/0651/1162/1863/products/651a4ee302545bb3f1fc3ddd6ba2b0b8.jpg?v=1678171639",
    "variant_ids": [46359055991015],
    "admin_graphql_api_id": "gid://shopify/ProductImage/40335172042983"
  }
}

However, it does not contain product_category field.

I have even tried to provide this field while creating the webhook as follows,

mutation WebhookSubscriptionUpdate {
    webhookSubscriptionUpdate(
        id: "gid://shopify/WebhookSubscription/1202711462119"
        webhookSubscription: {
includeFields: [
"id",
"title", "body_html", "vendor", "product_type",
"product_category", "created_at", "handle", "updated_at", "published_at", "template_suffix", "status", "published_scope", "tags", "admin_graphql_api_id", "variants", "options", "images", "image", "hmac", "requestBody"
]
} ) { userErrors { field message } webhookSubscription { callbackUrl createdAt format id includeFields legacyResourceId metafieldNamespaces privateMetafieldNamespaces topic updatedAt } } }

But still not receiving product_category in the response. Please help.

Reply 1 (1)

SBD_
Shopify Staff
1831 273 419

Hey @Crest-Swapnil 

 

Just ran some tests on this. Category doesn't seem to be part of the payload. It will require an additional call to the GraphQL API to obtain. Here's an example.

Scott | Developer Advocate @ Shopify