FROM CACHE - en_header

Order count API returning "Internal Server Error"

ppac
New Member
2 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'

return 

{"count":4900}

 

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'

 

return  

{"errors":"Internal Server Error"}

Please advice.

Reply 1 (1)
_JB
Shopify Staff
Shopify Staff
836 99 214

Hey 

 

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 | Solutions Engineer @ Shopify 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog