#차가운새우
1 messages · Page 1 of 1 (latest)
Hi there, can you elaborate more?
okay
Maybe you can use an example to walk me through
we are utilizing stripe.js to gather card and billing information from customers and make setup intent confirmed, and pass the payment method id to backend to use stripe API for making subscription
since setup intent is confirmed already what backend site do is just make subscription with collection_method=charge_automatically, but when we make subscription with this option the invoice finalizes right after created
and the invoice is not editable after finalized, so we want to find a way to add description before finalized or way to delay the finalizing so we can edit it
Got it, thanks for the context.
You can listen to the invoice.created event in your webhook endpoint. When this event happens, the invoice is still in draft mode so you can still update the description. Once that's done, you can call the finalize API to finalize the invoice
oh great
so do we need to change collection_method other than charge_automatically?
No need to change, you can keep it as charge_automatically
but when we call subscription call with this
https://api.stripe.com/v1/subscriptions
we found that the invoice finalizes soon after without any other action, did you mean when we call to update invoice we can keep it as draft mode?
That's the default behaviour for charge_automatically invoice. But there are still ways to change the first invoice https://stripe.com/docs/billing/invoices/subscription#update-first-invoice