#umethi
1 messages · Page 1 of 1 (latest)
Good question. Do you have the ID of any example invoices (in_123) that failed that way?
Alternatively, if I received a finalization failed event, will this work to fix any type of error?
- Update the affected invoice so automatic_tax[enabled]=false.
- Update the affected subscription so automatic_tax[enabled]=false.
- Finalize the affected invoice.
I don't, is there way to manually create an invoice that fails finalization?
We're moreso just trying to understand if finalization fails, in which cases can we automatically retry the finalization and when we need additional information from the customer
Thanks for the info. As a quick heads up, the server is getting a bit too busy for me to look in to this properly. I'm pulling in a colleague who should be able to help in a minute
Hi looking into this. Give me a min to catch up
So the field you want to look at for errors that can be retried/handled programmatically is this one: https://stripe.com/docs/api/invoices/object#invoice_object-last_finalization_error-code
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
As you can see there's a bunch of cases: https://stripe.com/docs/error-codes
The last_finalization_error hash right?
Or specifically the error code
So it seems like most of these error cases are tied to address issues
If we do this instead, will it successfully finalize the invoice?
- Update the affected invoice so automatic_tax[enabled]=false.
- Update the affected subscription so automatic_tax[enabled]=false.
- Finalize the affected invoice.
If automatic tax was the issue, then yeah that is how to handle that specific case
So to make sure I'm understanding correctly, in most cases, we can't just retry finalization, correct?
It's hard to say because finalization can fail for so many different reasons, but yeah there are plenty of cases where you can't just retry
Even if the last_finalization_error.type is one of api_error, card_error, idempotency_error, or invalid_request_error
So then last question, once we investigate the last_finalization_error and find out the error code and have it fixed (manually or by the customer)
Will the invoice automatically be finalized or we need to finalize it ourselves via the API endpoint?
You'll need to manually finalize after
No problem. I will say invoice finalization errors are frequently due to automatic tax, so you may find that to be the usual culprit if you're facing invoice finalization errors
But depends on your integration
We do kind of mention this here: https://stripe.com/docs/billing/subscriptions/overview#:~:text=invoice.-,finalization_failed,-The invoice couldn’t
And if automatic tax is the issue
This is a potential fix:
- Update the affected invoice so automatic_tax[enabled]=false.
- Update the affected subscription so automatic_tax[enabled]=false.
- Finalize the affected invoice.
This is very helpful, thank you!