Solved

Seemingly incorrect count for orders

wottavm
Visitor
3 0 0

Hello everyone,

I am using the order count API to check if a customer has orders in their shop.
The API returns a number of orders that seems to be correct but when I call the orders API I am only getting 236 orders.


Maybe I'm missing some crucial information but there seems to be a huge difference between the API result and what our client sees.

We expect a count of 22714 but are getting 56.

 

// Orders count API call
https://FAKE_TENANT.myshopify.com/admin/api/2021-10/orders/count.json?status=any

// Orders API call
https://FAKE_TENANT.myshopify.com/admin/api/2021-10/orders.json?limit=250&order=updated_at_min%2Basc&updated_at_max=2022-04-01T14%3A25%3A31%2B0200

 


We are also not getting the Link header when calling the orders API.

 

Does anybody have an idea why we are not getting the data needed that we expected?

Accepted Solution (1)

GrahamS
Shopify Staff (Retired)
193 37 54

This is an accepted solution.

I see in your count call that you are passing status=any, but not in you regular call. This means the regular call would omit any non-open order, so if your customer has any cancelled or archived orders, they would be filtered out of that query response.

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

View solution in original post

Replies 2 (2)

GrahamS
Shopify Staff (Retired)
193 37 54

This is an accepted solution.

I see in your count call that you are passing status=any, but not in you regular call. This means the regular call would omit any non-open order, so if your customer has any cancelled or archived orders, they would be filtered out of that query response.

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

wottavm
Visitor
3 0 0

Hi @GrahamS,

With pain in my heart, I want to confirm that this was the case indeed.

Although it was really insightful how you answered the question.
I want to thank you for your time.

~ Wouter.