Price doesn't get deducted from total_price field after editing an order

Solved
Highlighted
Excursionist
22 1 15

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:

edited-order-summary.jpg

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",
...
0 Likes
Highlighted
Shopify Staff
Shopify Staff
51 10 5

This is an accepted solution.

Hi there, 

 

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`

 

Cheers

 

0 Likes
Highlighted
Excursionist
22 1 15

So I have to use two APIs in order to get an answer for this simple question?
That doesn't make any sense.

If it is important enough to put it in GraphQL, why not adding this in the REST API?...

Is this in the roadmap? 

1 Like