What API can I use to accurately calculate total sales per day?

Hi everyone,

I am trying to have the total sales per day per country through a REST api, and was wondering which one I could use since the Analytics API has been deprecated. The Report API doesn’t seem to work either, as it give the report metadata and not the data itself.

A solution that I have often seen suggested is to build the total sales by using the Orders API mixed it with other raw data such as transactions for refunds. Unfortunately, it never ends up being correct. The formula should be: sum(total_price) - sum(refunds) but for having tried for many days, it never gives the same exact number as the ones shown in the total report. I couldn’t find the exact formula used by Shopify, neither on the forum nor in the documentation. (the formula given in the docs, gross_sales = quantity x price, doesn’t work either).

So if you know which API I could use to directly fetch the total sales, it would be great.

Thanks for the help

Hi Keanna,

Which API are you using to fetch the total sales with your app if I may ask?