New Shopify Certification now available: Liquid Storefronts for Theme Developers

Customer webhook updated_at incorrect

Solved
jason-gadget
Shopify Partner
3 0 8

On `customers/update` webhooks, the `updated_at` field does not update when only the tags on the customer have been updated. To replicate:

 

  1. Subscribe to `customers/create` and `customers/update` webhooks via REST
  2. Create a new customer
  3. Note the `updated_at` timestamp on the webhook payload
  4. Update the customer's tags in the shop admin
  5. Note the `updated_at` timestamp on the webhook payload has not changed from the `customers/create` payload

Subsequently updating other fields on the customer does result in the `updated_at` timestamp being updated on webhook payloads. My app was using `2023-01` event version.

 

Accepted Solution (1)
ShopifyDevSup
Shopify Staff
Shopify Staff
1203 190 420

This is an accepted solution.

Hi @jason-gadget ,

 

Thanks for your reply. The fix for the updated_at timestamps on Customers when tags are added or removed is now in place and we've confirmed it's working on a test store.

 

The new 'X-Shopify-Triggered-At' header field was an improvement intended to address what @pratikvii mentioned about needing to rely on the updated_at timestamp to sort out the order of webhooks and applies to all the webhook topics with increased time precision.

 

Hope you have a great day

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

View solution in original post

Replies 8 (8)
pratikvii
Shopify Partner
1 0 1

Having same issue with the "updated_at", Updating tags are resulting into customers/update webhook but does not change the "updated_at". Shopify does not guaranty the order of webhooks so I have to rely on "update_at" to store latest the tags in my system using webhooks.

Is this bug introduced recently or it was like this since beginning.

ShopifyDevSup
Shopify Staff
Shopify Staff
1203 190 420

Hi @jason-gadget ,

 

Thanks for your post. We've been able to replicate this behaviour in a test store and internal teams are investigating.

 

Hope you have a great day

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

Leo-Chan
Shopify Partner
1 0 0

Hi @ShopifyDevSup, we had the same issue that "the `updated_at` field does not update when only the tags on the customer have been updated".
As you said in 03-15-2023 "internal teams are investigating", is there any update?

Hope to get some feedback, thank you so much.

Hope you have a great day.

 

stitch_dev
Shopify Partner
1 0 0

We are also seeing this behavior in the shopify Api v12.0.1 for the customers endpoint

ShopifyDevSup
Shopify Staff
Shopify Staff
1203 190 420

Thanks for your patience! We've added an additional header `x-shopify-triggered-at` to the `customers/update` webhook that timestamps all changes to the customer object, including customer tags. It will be formatted in UTC to offer higher precision 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

jason-gadget
Shopify Partner
3 0 8

It seems roundabout to only check for this header on `customer/update` webhooks. Is there any plan to fix the updated_at timestamps? 

ShopifyDevSup
Shopify Staff
Shopify Staff
1203 190 420

This is an accepted solution.

Hi @jason-gadget ,

 

Thanks for your reply. The fix for the updated_at timestamps on Customers when tags are added or removed is now in place and we've confirmed it's working on a test store.

 

The new 'X-Shopify-Triggered-At' header field was an improvement intended to address what @pratikvii mentioned about needing to rely on the updated_at timestamp to sort out the order of webhooks and applies to all the webhook topics with increased time precision.

 

Hope you have a great day

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

jason-gadget
Shopify Partner
3 0 8

Just tested and confirm that the `updated_at` timestamps are correctly updated when only changing tags.