Closed ljrahn closed 1 week ago
Hi @ljrahn can you share with me the ID of the request that returned 400 so that I can investigate further?
@seanzhang-stripe sure thing. you could use this one.
"requestId": "req_SBKgR0ZWLrckkG"
is this what you're looking for?
Thanks for the ID. I confirmed that the response code is indeed 400 and you are using Stripe API version > 2015-09-08. I'll flag this internally to the relevant team.
Just out of curiosity, why do you need to create a large number of connected accounts in a short period time?
Great! thanks. And hmm, i just verified the stripe version from the request is 2023-10-16, not sure where 2015 came from, but no big deal.
And its not a huge deal, i won't be creating this many accounts in prod. Im using vitest for testing, and they make it hard to run tests sequentially, because their single threaded/single process modes put tests in the same global context, and i end up getting some conflicts, so the parallelism of the tests cause me to create more than 5 accounts in a second. Unless im missing something or im approaching this wrong 🤷
I mean you are using a Stripe API version that is greater than 2015-09-08, because Stripe returns 400 for rate limit errors before API Version 2015-09-08. I should have included this context in my earlier answer. Sorry about the confusion.
Ohh lol i missed the '>' haha. All good, thanks a lot!!
Hi @ljrahn The 400 status code is coming from the API endpoint, and the SDK is simply reflecting that. I will close this ticket and follow up internally with the team that manages this endpoint. Please don't hesitate to reopen this ticket if you have any further questions.
Describe the bug
When i am creating connected accounts too quickly, i get an error with an HTTP status code of 400:
To Reproduce
Simply attempt to create more than 5 accounts within 1 second using a test API key.
Expected behavior
It should either return a StripeAPIError with a 429 status code, or a StripeRateLimitError. Currently theres no way to detect if im hitting a rate limit error on this endpoint (without checking the message) so i can retry after backing off for some amount of time.
Code snippets
No response
OS
macOS
Node version
v20.12.2
Library version
stripe v15.12.0
API version
2023-10-16
Additional context
No response