Have your say in Community Polls: What was/is your greatest motivation to start your own business?
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Re: Feedback Wanted: Do you have apps that need to know what's changed on an order?

Feedback Wanted: Do you have apps that need to know what's changed on an order?

Jordan
Shopify Staff
301 3 84

Hi everyone!

I'm a product manager on the orders team here at Shopify and I want to better understand if there's a need among Shopify app developers for fetching what's changed on an order. 

When we released order editing back in late 2019, we introduced a new pattern where many attributes on an order could be updated — we even wrote a blog post about it! The new recommended practice was that for any function of your app that could be affected by an order attribute, you treat the attribute as potentially subject to updates.

With that in mind, do you have apps that need to keep informed of updates? How do you do that today (e.g subscribing to order/updated or order/edited webhooks)? 

More importantly, I'd love to hear if you have a use case for retrieving a history of what attributes have changed on any given order and why — feel free to comment in this thread below or message me directly. 

All the best, 

 

Jordan 

Jordan | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me 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

Replies 9 (9)

ClementBR
Shopify Partner
161 2 51

Hi @Jordan , 

I'll pitch in with our use case, related to reporting and accounting.

When it comes to accounting/reporting, a rule of thumb is that past data should not ever change.

For example, if March is over and I generate a report for March as of today, and I generate the same March report as of tomorrow or next week, I expect the same results.

Unfortunately, this is not the case with the way the current order editing functionality works. Let me explain.

I tried editing an order by either increasing and decreasing the quantity on one of the order line item. Here is what I'm seeing:

1) If I decrease the quantity, a refund is added to the order and the refund's date (processed_at/created_at) is populated with the date of the edit. No problem here. We have all the info we need. Although, it would be nice to be able to tell that the refund was created because of an edit.

2) If I increase the quantity, the existing line item quantity is increased. There is no field in the API to indicate that the quantity was increased, and when.

As a result, the sales report data for that order is changed, as of the date when the order was originally processed. That's problematic. We changed the past!

I think the ideal solution would be to change this behavior. Instead of changing the existing line item, it should append a new line item with the delta quantity. The product and variant information would be the same as the original line item, but that's fine. Of course, this new line item would also need to have an additional date field to indicate when it was added.

An alternative solution might be to add a new array order.edits[], which would contain all the edits made to the order. The items in the order.edits[] array would be of the same shape as the object included in the orders/edited webhook. We don't use the orders_edited webhook, because we cannot reconcile the data or recreate the data by querying the API. For example, if an orders/edited webhook wasn't delivered to the app for some reason, there is no way to reconstruct the information it contained. If there was a new order.edits[] array, we could just load the order. Also, it would be included in the orders/updated webhook.

I hope this helps, let me know if I wasn't clear as it is definitely a tricky topic.

42technologies
Shopify Partner
12 0 5

The above example summarizes the limitations of the Order API very well.

ClementBR
Shopify Partner
161 2 51

Hi @Jordan 

 

Are there plans to act on the feedback I've given?

It's still giving us headaches because it's not possible to provide accurate reporting of edited orders.

Jordan
Shopify Staff
301 3 84

Hi, we're working on a new API that should help alleviate this headache. If you're interested in gaining early access, send me an email at jordan.liddle@shopify.com and we'll set you up once the API is ready to be tested. 

Jordan | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me 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

Jordan
Shopify Staff
301 3 84

I wanted to share an API that we just released that I think your team might find useful: https://shopify.dev/changelog/retrieve-accurate-and-reliable-order-sales-data

Jordan | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me 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

ClementBR
Shopify Partner
161 2 51

No webhook support?

42technologies
Shopify Partner
12 0 5

@Jordan Is there any update on the status?

We are happy to test it and work with merchants who have requested this feature to gather feedback.

TheLoomCollecti
Visitor
2 0 0

Hi ClementBR, did you find a solution to this time stamp problem? If yes, can you please share further information here?

lassejuhlkirk
Shopify Partner
1 0 0

Hi @Jordan Any news on webhook support? 

 

Regards