When editing an order, removing some line items and adding others, the order total price changes accordingly on the interface.
However, when fetching through the API, the total_price (and other price related fields) is showing the sum of previous total price with the new one, which doesn't make sense at all.
How can we get the updated order total price from the API?
Do we have to calculate it somehow?
Attaching screenshot of interface, and the relevant parts of API response down in the bottom:
The order price before (API):
... "total_price": "168.48", "subtotal_price": "144.00", ...
The order price after the edit (API):
... "total_price": "317.07", "subtotal_price": "271.00", ...
Solved! Go to the solution
This is an accepted solution.
This is the expected behaviour of the orders API. The "total_price" field will return to you the total price of all line_items including those which have been refunded. If you would like to retrieve updated values for the order (i.e. total_price) you should query the GraphQL Admin API with the field `netPaymentSet`