#abuznego_invoiceitems-batch
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/1243319765314043904
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi there! Taking a look
thank you!
we use the same idempotency key so that in retries, we don't add the same items when an invoice gets created
Okay, I see another request to add an Invoice Item on the same Invoice was made at the exact same time: https://dashboard.stripe.com/logs/req_nymVhjjFG484FV
Because this other call to add an invoice item placed a lock on the Invoice, no other call can be made against this invoice until that first call is done/removes the lock
ok but then if we retry that same request, it will have the same idempotency key and thus return 429 even if there's no lock on it anymore?
Right. If you retry the request and use the same idempotency key, you'll get the same result
If you still need to add this invoice item to the invoice, you should use a different idempotency key
ok and to avoid that error in the future
i am using this library https://hexdocs.pm/stripity_stripe/readme.html
i see no way to configure the network retries
I can't speak to that library since this isn't owned by Stripe but we have some general recommendations for lock timeouts here: https://docs.stripe.com/rate-limits#object-lock-timeouts
You can add some logic on your end to avoid simultaneous requests on the same object and do these sequentially instead
we do them sequentially but it seems like it was done too quickly in between so planning to add some time in between each request
how often are events retried and for how long? for invoice created
Retries for lock timeouts are only automatic if you use Stripe's libraries
but those are called in our system when an invoice is created. how often are those invoice.created events retried
Ah, sorry, I missed your callout of events
If Event delivery to a webhook fails in live mode, we retry for up to three days: https://docs.stripe.com/webhooks#retries
In test mode, we retry three times over the course of a few hours
ok got it. feels hacky to have to add time in between request when we're just going through a list of invoice items to add.
is there no way to add multiple invoice items at once
ok thank you
sure!
the invoice.created event will be retried up to 3 days but how often until then?
there's no set time, it's all dynamic based on the health of your endpoint.