Order count API returning "Internal Server Error"

New Member
1 0 0

We are trying to use Shopify API to count orders after specific time with public app API. We notice the following API consistently returning Error on some stores with over 100k lifetime orders:


Normal case:

curl -X GET -H 'Content-Type: application/json' -H 'X-Shopify-Access-Token: <redacted>' -G 'https://<redacted>.myshopify.com/admin/api/2019-07/orders/count.json?status=any&updated_at_max=2019-09-30T23:59:59.999999+00:00&updated_at_min=2019-08-30T23:59:59.999999+00:00'




Error case:

curl -X GET -H 'Content-Type: application/json' -H 'X-Shopify-Access-Token: <redacted>' -G 'https://<redacted>.myshopify.com/admin/api/2019-07/orders/count.json?status=any&updated_at_max=2019-09-30T23:59:59.999999+00:00'



{"errors":"Internal Server Error"}

Please advice.

Shopify Staff
Shopify Staff
31 4 6



Thanks for bringing this to our attention. I've been able to replicate the issue and have brought it up with our developers who are investigating.


In the meantime, I can confirm that making the call multiple times eventually allows it to succeed because the initial calls cause these records to be cached. If you haven't already, it would also be best practice to implement retry logic to catch any errors that may occur in the future, which will also help in this case.


I'll post back with an update once I hear back from our developers.

JB | Developer Support @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution