Issue with totalPriceSet after removing item using order editing

Hi fellas,

I’m not sure if it’s expected behavior. It would be great if someone could clearify.

In the api, we have 3 prices: originalTotalPriceSet, totalPriceSet and currentTotalPriceSet. Here is the thing:

  • If I create new order, all price sets are the same as it should be. Lets say 100USD.
  • If I use order editing and add new item which cost 500USD, then

originalTotalPriceSet: 100USD
totalPriceSet: 600USD
currentTotalPriceSet: 600USD

which is correct

  • If I use order editing, and remove item, for example the same I added with price 500USD, then

originalTotalPriceSet: 100USD
totalPriceSet: 600USD
currentTotalPriceSet: 100USD

The questions is why totalPriceSet wasn’t changed? Shouldn’t it be 100USD?
However, it was effected when the item was added.

Api: Graphql 2025-01

Thanks a lot!

Shopify’s behavior is expected: originalTotalPriceSet shows the original total, totalPriceSet includes all historical edits (even removed items), and currentTotalPriceSet reflects the final total after edits. Always use currentTotalPriceSet to get the accurate current order total.

Hi Daniel,

I would expect the same behavior. But the issue is that totalPriceSet includes order edits when I add item, but it doesn’t, when I remove item. Screenshot added. :slight_smile:

I can’t use currentTotalPriceSet to generate invoice for refunded orders, because currentTotalPriceSet includes order refunds as well.

I see the issue now. The totalPriceSet should include all edits, both additions and removals. However, it seems Shopify’s behavior isn’t fully consistent when removing items. Ideally, removing an item should update totalPriceSet just like adding an item does.

Since you can’t use currentTotalPriceSet for refunded orders due to its inclusion of refunds, you may need to manually track the changes by comparing totalPriceSet before and after removing the item. Another option is to create custom logic in your app to calculate the correct total, excluding refunded amounts and considering edits.

If this continues to be a problem, I recommend reaching out to Shopify support to see if there’s a bug causing the inconsistency with removing items

Thank you for trying to help! Unfortunately neither suggestion would work :confused:

In case if there would need to create invoice for older orders, the data would be missing.

If it would be the only wrong value, then it would be easy to re-calculate since there is totalRefundedSet and totalRefundedShippingSet attributes, but I don’t see any way to get correct taxes and discounts.