I’m trying to figure out how to map the results I get from the Order Resource and what I see on the UI, and how Shopify calculates “Total Sales”, the one it shows on the homepage.
I’ll give two orders as an example, the result back from to API to compare
Order 1 & 2
Order 1 response
{
"order": {
"id": 1234,
"current_subtotal_price": "0.00",
"current_total_discounts": "0.00",
"current_total_price": "7.90",
"name": "#1950",
"subtotal_price": "139.50",
"total_discounts": "46.50",
"total_line_items_price": "186.00",
"total_price": "147.40"
}
}
Order 2 response
{
"order": {
"id": 5678,
"current_subtotal_price": "0.00",
"current_total_discounts": "0.00",
"current_total_price": "6.30",
"name": "#1987",
"subtotal_price": "0.00",
"total_discounts": "0.00",
"total_line_items_price": "0.00",
"total_price": "6.30"
}
}
Discrepancies
- Net Payment
Order 1is £7.90 in the UI, and that value is reflected incurrent_total_pricein the API response.Order 2is £2.00 in the UI, and that value is not reflected in API response.
current_total_priceOrder 1’scurrent_total_priceis refund appliedOrder 2’scurrent_total_priceis refund not applied
Question
It seems very hard to figure out the logic of those fields. And I can’t reconcile the way Shopify displays the “Total Sales” value on the homepage. I’d appreciate if anyone has solved these.
