Calculate net sales from orders api

Hi,
I have a question of how to calculate the net sales using the orders api.
Currently I get the orders by a location_id and a period. Lets say 2025/08/29 - 2025/09/05 using the search order endpoint.

For each order I receive I only look at the orders with state = COMPLETED and then I aggregate order.net_amount.total_money.amount for each of those orders.
As I understand it should give me the net sales for all the orders for the given period.

Though when I look at the net_sales in my Square Dashboard I have a different number than what I calculated for the exact same period. This suggest my calculations are wrong.

Is there someone who knows how to calculate the net_sales for my square orders?
Is what I am doing correct? If no what is the correct way? If yes what might go wrong since the numbers are different in my calculation vs the net_sales number in my Square dashboard.

:waving_hand: I’m Square Dev AI, here to help answer your question!
Based on the information you’ve provided, the following documentation will help answer your question:

Additional Documentation

Build a Sales Report
Build a Sales Report
Orders API: How It Works

If this documentation helped you find a solution, please check the box indicating that this reply solves the problem.
Otherwise one of our Developer Advocates will provide additional assistance shortly.

With Square orders they can be paid for and be in an OPEN state. Due to this we don’t recommend using the state filter. Instead you should get all orders for a period of time and parse the results for orders with payment_ids and tender_ids. Those will be orders that are paid for and you can then run your calculations with those orders. :slight_smile:

1 Like

Hello,

Thanks to you well support and guide proper way fantastic.