Price fields in the Order object, and discrapencies to the Shopify UI

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 1 is £7.90 in the UI, and that value is reflected in current_total_price in the API response.
    • Order 2 is £2.00 in the UI, and that value is not reflected in API response.
  • current_total_price
    • Order 1’s current_total_price is refund applied
    • Order 2’s current_total_price is 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.

There is a lot more “totals” on the order object, like netPaymentSet or refundDiscrepancySet, there definitely is a reason for the difference you see.

Thank you. But I was looking for a consistent way to come to that “Net payment” value. Is there a formula somewhere telling how to use those fields?

And also, isn’t it wrong that in the Orders summary table, the “Total” column is sometimes refund applied (Order 1in my example) and sometimes not (Order 2) ?