Error returned in case of API Rate Limit?

830 views
Skip to first unread message

Michaël Gallego

unread,
Apr 10, 2014, 12:28:56 PM4/10/14
to api-d...@lists.stripe.com
Hi Stripe,

This is an information I couldn't found on your doc, but is there a specific error we can retrieve from API calls to know if a call was rejected due to an API Rate Limit?

Thanks!

Michelle Bu

unread,
Apr 10, 2014, 12:37:08 PM4/10/14
to api-d...@lists.stripe.com
Great question. We actually added a code recently called `rate_limit`.
I just noticed that it's not documented--will do now :).

Thanks!
- Michelle
> --
> You received this message because you are subscribed to the Google Groups
> "Stripe API Discussion" group.
> To post to this group, send email to api-d...@lists.stripe.com.
> Visit this group at
> http://groups.google.com/a/lists.stripe.com/group/api-discuss/.
>
> To unsubscribe from this group and stop receiving emails from it, send an
> email to api-discuss...@lists.stripe.com.

Michaël Gallego

unread,
Apr 10, 2014, 12:38:41 PM4/10/14
to api-d...@lists.stripe.com
Nice! Thank you, as awalys :).

Michaël Gallego

unread,
Apr 10, 2014, 12:47:01 PM4/10/14
to api-d...@lists.stripe.com
I suppose this is wrapped in an 402 error that has the type "api_error", right?


Le jeudi 10 avril 2014 18:37:08 UTC+2, Michelle Bu a écrit :

Michelle Bu

unread,
Apr 10, 2014, 12:50:40 PM4/10/14
to api-d...@lists.stripe.com
Sorry, the status code is actually just a 400, and the type is
`invalid_request_error`, but the error code is `rate_limit`.
- Michelle

Vladimir Andrijevik

unread,
Apr 10, 2014, 1:39:11 PM4/10/14
to api-d...@lists.stripe.com
Hi Michelle,

Would you consider implementing a rate limiting error as HTTP 429 – Too Many Requests instead?

Returning a 400 Bad Request seems odd here, since the request has valid syntax but is being rejected due to rate limiting. This would also play nice with any code between the client and Stripe which may respond to rate-limiting errors without having to parse the response body or know the specifics of Stripe errors.

Cheers,
Vlad

Michelle Bu

unread,
Apr 11, 2014, 1:21:30 AM4/11/14
to api-d...@lists.stripe.com
Hi Vlad,

Yeah, that'd be ideal but embarrassingly, passing up 429s doesn't play
well with our current internal infrastructure :(. We definitely agree
that 429s would be a better option that having a custom code and we'll
consider moving to that in the future.

Thanks for the suggestion!
- Michelle


On Thu, Apr 10, 2014 at 10:39 AM, Vladimir Andrijevik
<vladimir....@gmail.com> wrote:
> Hi Michelle,
>
> Would you consider implementing a rate limiting error as HTTP 429 - Too Many

Vladimir Andrijevik

unread,
Apr 11, 2014, 8:57:25 AM4/11/14
to api-d...@lists.stripe.com
Hi Michelle,

Thanks for writing back about this and considering :)

Cheers,
Vlad
Reply all
Reply to author
Forward
0 new messages