total_shipping_price_set incorrect after order edit

garyrgilbert
Shopify Partner
394 40 162

 

Hi All,

 

Having an issue with the REST API shipping_lines and total_shipping_price_set.

 

If I edit an order and remove a shipping_line and add a corrected one, it does NOT get removed from the shipping_lines array in the rest_api, it does, however, get removed in the graphQL shippingLines result.

 

Furthermore, total_shipping_price_set now includes both the old and the new shipping prices which reflects an incorrect shipping amount.

 

The order is obviously correct on the orders page.

garyrgilbert_0-1710759928137.png

but the underlying data seems not to be.

garyrgilbert_1-1710759979557.png

 

garyrgilbert_2-1710760088385.png

 

There also doesnt seem to be any way to determine from the order.json which of the shipping_lines is the one being applied to the order since the total_shipping_price_set is an addition of these values. This is totally misleading and results in incorrect results since current_subtotal_price + the total_shipping_price does not equal the current_total_price.

 

The only totals that match also are incorrect.

 

garyrgilbert_4-1710760647244.png

 

You can't rely on total_oustanding because it takes into account partial payments via gift cards or other payment methods so actually reflects the total amount outstanding.. the current_total block fails to have a current_shipping property, and while the current_total_price reflects order_edits, returns and refunds (and discounts) there is no way to historically retrieve order edits to then accurately determine what the current actual shipping costs after an order edit

 

garyrgilbert_5-1710760765526.png

 

So the real question then is.  For shipping_lines, is only the last element in the array ever applied to an order?  If so, why was this implemented completely different from everything else? And when will it be fixed, if ever?

 

Cheers

Gary

 

- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
Replies 0 (0)