"X-Shopify-Shop-Api-Call-Limit" for throttled requests ( 429 Too Many Requests ) has value "1/40"

SachinSS
New Member
4 0 0

Hey all, 

I've triggered a Shopify REST API multiple times and the request got throttled. The header info of this throttled request had the value - "X-Shopify-Shop-Api-Call-Limit": ["1/40"].

However, as per the Shopify document ( reference - https://shopify.dev/api/usage/rate-limits#rest-admin-api-rate-limits ), the request would be throttled once the request goes over a rate limit (example- X-Shopify-Shop-Api-Call-Limit: 40/40 ).

Can someone please help if there is any field in the header information or any way I can identify the throttled requests, and handle such scenarios accordingly.

Replies 3 (3)
L_J_K
Shopify Staff
368 54 65

Hey @SachinSS 

If you had the x-request_id from the throttled request headers we can take a look!

On the throttled requests, they would return a client side 429 status - "too many requests" - and a message that a throttle had been applied.

Sounds like you know about the X-Shopify-Shop-Api-Call-Limit header already, but The Retry-After header contains the number of seconds to wait until you can make a request again once you've been throttled. Worth noting though, that any request made before the wait time has finished will be throttled. 

There's some recommendations on handling such scenario's here if it helps too. Thanks!

| API Support @ Shopify |
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
SachinSS
New Member
4 0 0

Hey @L_J_K , 

Thank you for your response.

Here is the request ID for one such throttled request - "X-Request-ID": ["e6ca081e-4d49-4b17-96ab-9e6721e13281"]

This header payload did not contain the "Retry-After" field as well.

Please let me know if you need any further information to look into this issue.

L_J_K
Shopify Staff
368 54 65

Hey @SachinSS 

Thanks! I checked out that request ID and I see what's happening now.

So you're hitting the update_tracking.json endpoint more than 5 times a minute. On the 429 throttle, you should  be returned "upgrade to a paid account to remove this limit".

I can see you're making these calls on a Partner Test Store and you're hitting that resource more than 5 times a minute. Certain endpoints like the Fulfillments endpoint has restrictions on the amount of calls per minute - please see here. If you'd like to hit that endpoint more than that, you would need to upgrade to a paid plan.

I note you're calling 2019-10 of the API - well worth bumping up to the latest 2021-07 version (versioning docs here if need be). Hope that explains at least!

| API Support @ Shopify |
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!