#Pain-subscriptions-limit
1 messages ยท Page 1 of 1 (latest)
Hello ๐
I don't think there are any limits on the number of subscriptions. Are you getting any errors creating more?
Yes, that's correct
When I tried adding them directly from the dashboard I received an error
Sorry was 3 not 5.
Give me a moment to see if I can reproduce
Is it possible that it's happening because I'm using the test clock?
I also seem to be getting this error constantly when attempting to retrieve an invoice
message: 'This object cannot be accessed right now because another API request or Stripe process is currently accessing it. If you see this error intermittently, retry the request. If you see this error frequently and are making multiple concurrent requests to a single object, make your requests serially or at a lower rate.',
Ah yes. that must be it. Test clocks have different behavior.
I am trying to grab two different invoices
My flow is to currently listen to incoming events from the Webhook for invoice.paid I have 2 subscriptions for 1 customer, when I speed up the time so both of them get paid I get the rate limiting error?
Status is 429, so it's stating I'm sending too many requests but I'm only sending 2?
Do you have request IDs for these by any chance?
req_nP1xJg8DZR1Nmz
That's the only request ID in the error
const invoice = await stripe.invoices.retrieve(
event.data.object.id,
{
expand: ['customer', 'lines.data.plan.product', 'subscription']
}
);
Gotcha. I don't think you're hitting the rate limit but it is possible that the test clock takes a little longer to release the objects.
Can you try adding a timeout maybe to see if that helps? AFAIK You'd not see these errors in live mode
I see, because from what I know I can send up to 100 requests per second
You want me to add a timeout before retrieving the objects?
Yeah adding a timeout should probably tell us how long the test clock takes in order to release the objects
I will try a 2 second time out
It does the first one successfully
I will attempt with 5 seconds
Alright, I've tried all the way up to 5 seconds, nothing seems to work below
but 5 seconds does work
Nevermind seems like even that has issues from time to time
I will increase it to 6 seconds
hmm interesting.
I believe you won't see the same behavior if you were to create subscriptions without test clocks
Yeah I believe there are some restrictions on the testclock, I guess it makes sense.
I will just remove the timeout in production and catch errors, will keep an eye out to see if they keep occurring.
Appreciate the feedback.
Yup, NP! Feel free to use test mode objects in order to test this prior to deployment
Will do, have a great day.
Good luck ๐
That's weird now it's not letting me grab even one?
I tried removing the timeout
I have a question, will the invoice_pdf we sent to the user prior to paying?
Or is just a receipt that's sent to them?
It's a copy of the finalized invoice
I don't think users can pay using this URL
Hosted invoice URL would include a link to the receipt once the payment has been made
I know we do surface this somewhere on the object
Just having trouble locating the exact docs
I remember seeing this in the object a while ago, that's why I'm asking too.
You'd see it on the charge
https://stripe.com/docs/api/charges/object?lang=node#charge_object-receipt_url
It is based on your account settings
I see, what about the invoice_pdf?
that should have the copy of the finalized invoice
Different from a receipt
Just the receipt
unless your invoices are sent to customers for manual payments
I have these set up so only the receipt should be sent
and this setting is off, but this is for 3D secure
This one is on, so does that mean that invoice will be sent to the customer?
I believe that option only works for send_invoice option
Oh I see, so only the receipt will go out from stripe as I have that enabled?
let me rephrase
if you use the send_invoice behavior when creating an Invoice, you can manually send it through the send endpoint
OR
you can have it automatically send the Invoice email to the Customer when the Invoice is finalized
the latter being that toggle^
Oh I see, got it. Thank you very much for the clarification!