#bkrnetic - charge for all previous invoices
1 messages · Page 1 of 1 (latest)
There isn't a built in way to do this but you can do your own process to charge for all of them. The simplest way to do this in the API would be making the pay invoice call on each Invoice though that would attempt this in two payments https://stripe.com/docs/api/invoices/pay
To do this in one payment, you can void the older invoices and recreate that Invoice's line items on the newer invoice, then make the payment call on that newer invoice
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Hmm, how will that affect the status of subscription?
Btw, if I have it set up that Stripe handles recurring payments automatically or by sending an email link to the customer if 3D secure is needed, will the "pay call" trigger that?
The subscription status is based on the status of the most recent Invoice. So if you put all of the items on the latest invoice and it is paid, the subscription will go back to active
Yes, it should email them if that payment requires 3DS auth
So just to clarify: to charge all of the invoices at once, I should void all of the invoices, including the one with status open (the first unpaid), except the last one in draft status, and put line items to that last invoice and attempt charge?
And the other option is to simply go through each invoice and call pay method? If I do so, will the Stripe attempt to charge again if some of those fail?
Let me know if I need to paraphrase, I'm aware it might be confusing.
Yes, those are the two options more or less: reattempting payment on each invoice or manipulating your invoices such that there is one with all the unpaid things.
Stripe will attempt to pay the Invoice when you make that API call but it will not start another round of retries if one of those payments fail.
I think we are on the same page, this is just a process with a lot of moving parts
And if I set auto_advance to true? How will that affect the flow?
Affect which part of this flow?
Stripe attempting to retry the payments
The docs say:
- Collect new payment information.
- Turn automatic collection back on by setting auto advance to true on draft invoices.
- Finalise, then pay the draft invoices. Pay the most recent invoice before its due date to update the status of the subscription to active.
I'm not sure how this works in the background. E.g. I complete step one, I update all the draft invoices with auto_advance = true, and I finalise draft invoices.
Will Stripe attempt to charge finalised invoices within some time or I should trigger pay action manually?
Yes, an invoice will go out of its draft state after an hour and payment will be attempted automatically when the invoice is finalized
And ah I see, auto_advance is the parameter that tells Stripe to try to charge automatically when the invoice is finalized https://stripe.com/docs/api/invoices/finalize#finalize_invoice-auto_advance
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Okey, I will try both of the scenarios and see what suits me the best. The first one is easier but my client will have bigger fee then + it is not really good for UX, since customers will need to wait for 1 hour or more to have subscription reactivated (to have access to our service enabled again) even though they were ready to complete the payment at that very moment.
I'm writing this just in case you catch something that I got wrong and correct me! Haha.
However, I have one more question - I have used this guide (https://stripe.com/docs/billing/subscriptions/subscription-schedules/use-cases#installment-plans) to implement payments in installments.
What happens if invoices are not paid and subscription ended meanwhile? Do these invoice stay in draft state and it is expected from us to handle such cases manually via dashboard or...?
If you don't want to wait for the invoice to re-finalize, you can make an API call to finalize it whenever you want. https://stripe.com/docs/api/invoices/finalize
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
What happens to the subscription itself and its invoices are determined by your dashboard settings. We have settings to leave them as is or to cancel the subscription, void the invoices, etc