Discussing APIs and development related to customers, discounts, and order management.
Hi, I am trying to get the total orders for the last years with the endpoint:
myshopify.com/admin/api/2020-01/orders/count.json?created_at_min=2019-01-01T00:00:00-04:00&created_at_max=2020-01-01T00:00:00-04:00
And I am getting the response:
{ "count": 867 }
However on my dashboard I see 6895 orders!
What is going on, what is missing here?
Solved! Go to the solution
This is an accepted solution.
There is a time restriction unless if you have the elevated permission scope to see all orders. Also a culprit is the status parameter. By default it is set to 'open'. If you want to see all orders regardless of status, try status=any as a parameter.
This is an accepted solution.
Thanks, it increased significantly the total count for 6883, maybe there are more filters, I am going to check the docs.
Tks again
I'm not sure if the restriction is on count.json, but for order look ups, we are restricted to the last 60 days (i think) worth of orders.
As of June 6th, 2018, only the last 60 days' worth of orders from a store will be accessible from the Order resource by default. If you want to access older orders, then you need to request access to all orders. If your app is granted access, then you can add the read_all_orders scope to your app along with read_orders or write_orders. Private apps are not affected by this change and are automatically granted the scope.
This is an accepted solution.
There is a time restriction unless if you have the elevated permission scope to see all orders. Also a culprit is the status parameter. By default it is set to 'open'. If you want to see all orders regardless of status, try status=any as a parameter.
This is an accepted solution.
Thanks, it increased significantly the total count for 6883, maybe there are more filters, I am going to check the docs.
Tks again