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

30 0 0


I have a question that we calculate total sales from order api but the value from the api is different from the dashboard of shopify which is in the analytics section so how what we do that the value is similar like analytics.

How i use order api?
I calculate total order and sum of all order in the key of total_price through which we find gross sales but we didn't find the total sales or net sales so how can i find that value.
Please look into this matter it's urgent.

Replies 4 (4)

Shopify Staff (Retired)
624 104 187

Hey @deepanshu-mobo ,


From the Shopify documentation ( we can see that Total Sales in our analytic reports is calculated as follows:


total sales = gross sales - discounts - returns + taxes + shipping charges. Where gross sales = product price x quantity (before taxes, shipping, discounts, and returns)


The 'total_price' field from the Orders API does take into account gross sales - discounts + taxes + shipping charges, but not take into account returns. So you will need to calculate how much money was refunded by your store separately. Once you know that information, you should be able to calculate the total sales for your store accurately. 


Also one thing to point out: sales of Gift Cards are not included in to the Shopify "Total Sales" analytics report. So using the Order API you should skip any line items where you sell Gift Cards in your calculation. 


To learn more visit the Shopify Help Center or the Community Blog.

Shopify Partner
2 0 0

Hi Hassain,


Thanks for your helpful answer. To show the daily total sales to our users just like they see it in their Shopify dashboard, we get Orders from the REST API then get SalesAgreements from GraphQL API. This is because we noticed that the orders returned from the REST API dont have the historic modifications that happened to the order (additions or refunds) with their timestamp which matters in calculating total cost like shown in Shopify dashboards. 

So the question here is; Is there an easier way to calculate this? as we are now getting throttled by the GraphQl API as its a bottleneck when we try to fetch it for each order (specially for large scale merchants that have lots of orders per day and lots of modifications per order).


Thanks a lot!

Shopify Partner
4 0 2

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

Rohit Gupta.
Shopify Partner
1 0 0

Same issue. We want to reproduce the total sales but apperantly some upsell apps add order items a day later. If we update the order on the day it got created, we get a diffrent value then the shopify dashboard. We tried to use transactions but it did not worked because of orders that have cash on delivery.


Is there not a clear documentation on how we can reproduce Analytic reports with the REST API? Why do not make them public. The report is really nice because it shows order adjustments for that day. Sadly we can not view them via api.