#_api
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1292719252075446324
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
https://docs.stripe.com/rate-limits#rate-limiter
The basic rate limiter restricts the number of API requests per second as follows:
Live mode: 100 read operations and 100 write operations
Test mode: 25 read operations and 25 write operations
Hi! Can you share the request ID (req_xxx)? Here's how you can find it: https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support site provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
Sure. This is my test req Id.
req_67aXwd4ym5dELz
Thanks, let me take a look
Ok, so there were some earlier request to update the subscription item of the same subscription.
Instead of updating the subscription items individually, you should update the subscription items https://docs.stripe.com/api/subscriptions/update#update_subscription-items in one request.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Yeah, in our environment we need to update subscription quantity one by one when new person was invited to organization or leave organization.
So, I want to know is how many times are max limit request in an hour using this API. There is no exact count of limit in an hour in subscription update API docs. And also is there any way to increase limit of this API?
The Http status of this request is 429, indicating that it's a rate limited due to object lock https://docs.stripe.com/rate-limits#object-lock-timeouts
When you created a request to update a Stripe resource, stripe will lock the relevant object (i.e., the subscription) to ensure the data integrity
Therefore, increasing a limit in your case doesn't really help. What you should do is to aggregate the changes in your application first, and change one API request to update all changed fields.
Understood.
However, the way it should be implemented in the current service is that when a new person joins the organization, the payment should be made immediately, and if someone leaves, the refund should be made on a pro-rated basis, so the update of the quantity should be made immediately.
Is it possible to handle this case using the meter API in stripe? Does the meter API not have API limits like subscription updates?
Meter APIs has a higher rate limit, but I'm not entirely sure if it's the best billing model for your use case.
Do you expect your customer to update the quantity very often?
I'm not sure how often users will use the API to update subscription quantities, but if we know what the limit is for that API in an hour, then we can put a limit on it.
Also, when a 429 error occurs, is it possible for stripe to retry the process when it's back to normal, or to allow retries?
Stripe will retry a 429 error if the error code is lock_timeout. No it won't retry req_67aXwd4ym5dELz as its code is rate_limit
So we don't know when this rate limit will be released? When I called the update API again 5-10 minutes after seeing this error, I got the same error.
What's the new request ID?
A rough guess is that the number of times subscriptions go up or down in an organizational model is probably no more than 100 in an hour.
Even if the rate limit is a bit higher in Live mode, can't it cover the above number of API requests?
You said you got the same error after 5-10 mins, kindly share with me the ID of the request so I can check again
Sure.
req_JnqcFn0uVEsrM7
req_wLDQAxMv2gLGqw
req_4mL3sEgyiWwfy3
I'm still working at this, and I'll let you know when I find something
Okay. Thank you.
Thanks for waiting.
I noticed that you are using a test clock for this customer. Can you advance the test lock after each update?
Are you saying to turn back the test clock?
No, you can't turn back the clock,
I mean you should advance the test clock after each update to the subscription. Updating the same subscription many times without advancing the test clock will result in an error
oh i understood.
I'll test again and ask you if the same thing happens
Thank u for answer.
Happy to help!