# Calculate net sales from orders api

**URL:** <https://developer.squareup.com/forums/t/calculate-net-sales-from-orders-api/23923>\
**Category:** Questions\
**Tags:** orders-api, net\
**Created:** [September 9, 2025, 7:23am UTC](https://developer.squareup.com/forums/t/calculate-net-sales-from-orders-api/23923 "2025-09-09T07:23:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dvan1234](https://avatars.discourse-cdn.com/v4/letter/d/c4cdca/32.png) [@dvan1234](https://developer.squareup.com/forums/u/dvan1234)\
**Post date:** [September 9, 2025, 7:23am UTC](https://developer.squareup.com/forums/t/calculate-net-sales-from-orders-api/23923/1 "2025-09-09T07:23:35Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Square-Dev-AI](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/square-dev-ai/32/2513_2.png) [@Square-Dev-AI](https://developer.squareup.com/forums/u/Square-Dev-AI)\
**Post date:** [September 9, 2025, 7:23am UTC](https://developer.squareup.com/forums/t/calculate-net-sales-from-orders-api/23923/2 "2025-09-09T07:23:55Z")

</div>

👋 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:

> **[Build a Sales Report](https://developer.squareup.com/docs/payments/scenarios/simple-sales-report)**
>
> The Sales Report sample application shows how to build a report that details all the items sold between two dates.

> **[Build a Sales Report](https://developer.squareup.com/docs/customers/scenarios/simple-sales-report)**
>
> The Sales Report sample application shows how to build a report that details all the items sold between two dates.

> **Additional Documentation**
>
> [Build a Sales Report](https://developer.squareup.com/docs/merchants/scenarios/simple-sales-report)  
> [Build a Sales Report](https://developer.squareup.com/docs/commerce/scenarios/simple-sales-report)  
> [Orders API: How It Works](https://developer.squareup.com/docs/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.

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [September 9, 2025, 3:47pm UTC](https://developer.squareup.com/forums/t/calculate-net-sales-from-orders-api/23923/3 "2025-09-09T15:47:40Z")

</div>

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. 🙂

---

<div class="post-metadata">

**Author:** ![ava951robinson](https://avatars.discourse-cdn.com/v4/letter/a/e19adc/32.png) [@ava951robinson](https://developer.squareup.com/forums/u/ava951robinson)\
**Post date:** [September 13, 2025, 4:51am UTC](https://developer.squareup.com/forums/t/calculate-net-sales-from-orders-api/23923/4 "2025-09-13T04:51:32Z")

</div>

Hello,

Thanks to you well support and guide proper way fantastic.
