Is there any way to find total sales through order api?

Topic summary

Goal: Reproduce Shopify Analytics “Total sales” via APIs; REST Orders sums don’t match dashboard.

Key formula (from docs):

  • Total sales = gross sales − discounts − returns + taxes + shipping.
  • Gross sales = product price × quantity (pre-tax, shipping, discounts, returns).
  • Gift card sales are excluded from Total sales.

API behavior:

  • Orders API total_price = gross sales − discounts + taxes + shipping (does NOT subtract returns/refunds).
  • Must compute refunds separately and exclude gift card line items to match Analytics.

Workarounds and challenges:

  • Some use REST Orders + GraphQL SalesAgreements to capture historic modifications (additions/refunds with timestamps) for accurate daily totals, but hit GraphQL throttling at scale.
  • Late modifications (e.g., upsell apps adding items a day later) cause daily mismatches if only creation date is used.
  • Transactions didn’t cover cash-on-delivery scenarios for some users.

Hints/questions:

  • Consider filtering by updated_at vs processed_at when pulling Orders.
  • Use Order Events and Tender Transactions in REST to capture adjustments and payment details.

Status: No single official API endpoint mirrors Analytics; guidance exists, but an easier, fully documented method remains open.

Summarized with AI on December 22. AI used: gpt-5.

When you get Orders using REST, do you use updated_at or processed_at for filtering? I need to calculate daily sales as per your answer