ORDERS_UPDATED Webhook not returning returns field despite being included in includeFields

Hello everyone,

I’m currently working with the ORDERS_UPDATED webhook and am running into an issue where the returns field is not being returned, even though I’ve explicitly included it in the includeFields array. When I add other fields, they appear as expected, but the returns field remains missing.

Here is my current configuration:

includeFields: [
  "id",
  "admin_graphql_api_id",
  "app_id",
  "location_id",
  "line_items",
  "shipping_lines",
  "discount_applications",
  "refunds",
  "returns",
  "fulfillments",
  "updated_at",
  "cancelled_at",
  "processed_at",
  "name",
  "customer",
  "currency",
  "billing_address",
  "shipping_address",
  "payment_gateway_names",
  "tax_lines",
  "tags",
  "note",
  "taxes_included",
  "financial_status",
  "total_price_set",
  "created_at",
  "updated_at",
  "note_attributes",
  "metafields",
]

Has anyone encountered this issue before or can advise on what might be preventing the returns field from appearing in the webhook payload? Any guidance or insights would be greatly appreciated.

Thank you!

Hello,

What webhook version are you using? The returns attribute on the order payload was added as of the 2024-10 version - so if you are using a version previous to that you will not receive any returns in the order’s payload.

@Ben-Shopify Hi!
Thanks for the clarification. I was indeed using webhookSubscriptionUpdate with the 2024-10 version, and my TOML configuration was also set to 2024-10. However, the resulting webhook still appears to be using the 2024-04 version. Could you provide guidance on how to properly update the webhook to 2024-10, or point out what I might be missing in the configuration process? Any help would be greatly appreciated.

Understood. Here’s the mutation I’ve always been using to update the subscription:

mutation ShopifyWebhookSubscriptionUpdate ($id: ID!, $webhookSubscription: WebhookSubscriptionInput!) {
	webhookSubscriptionUpdate(id: $id, webhookSubscription: $webhookSubscription) {
		webhookSubscription {
			... WebhookSubscriptionFragment
		}
		userErrors {
			... UserErrorFragment
		}
	}
}
fragment WebhookSubscriptionFragment on WebhookSubscription {
	id
	topic
	includeFields
	endpoint {
		... on WebhookHttpEndpoint {
			callbackUrl
		}
		... on WebhookPubSubEndpoint {
			pubSubProject
			pubSubTopic
		}
	}
	metafieldNamespaces
	createdAt
	updatedAt
}
fragment UserErrorFragment on DisplayableError {
	field
	message
}

Here is a guide to setting the webhook API version. You can also inspect the X-Shopify-Api-Version header on the webhooks you receive to determine which version of the API the webhook payload was serialized with (details here).