#bkrnetic - charge for all previous invoices

1 messages · Page 1 of 1 (latest)

arctic adder
#

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

hasty siren
#

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?

arctic adder
#

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

hasty siren
#

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.

arctic adder
#

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

hasty siren
#

And if I set auto_advance to true? How will that affect the flow?

arctic adder
#

Affect which part of this flow?

hasty siren
#

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?

arctic adder
#

Yes, an invoice will go out of its draft state after an hour and payment will be attempted automatically when the invoice is finalized

hasty siren
#

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.

arctic adder
#

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