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.
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.
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
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.