#kirito
1 messages · Page 1 of 1 (latest)
Hello 👋
Cancelled is a terminal state for the subscription. Are you trying to re-activate the subscription? If so, You can't reactivate it and you'll need to create a new subscription instead.
I understand, then I want to know what happen if the payment of the subscription doesn't succeed even after trying multiple time , I want after waiting for a certain time to change the subscription status to something that will indicate that it need a payment method, and when the customer add a new payement method it change it status to active.
It depends on your billing settings
If you look under "Manage failed payments" section on this page
https://dashboard.stripe.com/settings/billing/automatic
You should be able to configure the behavior
what change will happen if I mark the subscription as unpaid, will that be shown on the status of the subscription?
yup, it should update the status of the subscription
https://stripe.com/docs/api/subscriptions/object#subscription_object-status
I understand and how to pay a subscription with status unpaid ?
and what webhooks event will detect that, is it "customer.subscription.updated"
and what webhooks event will detect that, is it "customer.subscription.updated"
That's correct.
I understand and how to pay a subscription with status unpaid ?
There are a couple of options, you can integrate customer portal to allow your customers to add a new payment method and pay past invoices
https://stripe.com/docs/customer-management
Alternatively, you can send the invoice for manual payment using the API
https://stripe.com/docs/api/invoices/send
OR expand the at latest_invoice property on the subscription to find the PaymentIntent clientSecret and render Elements to collect a new PaymentMethod
https://stripe.com/docs/api/subscriptions/object#subscription_object-latest_invoice
https://stripe.com/docs/api/invoices/object#invoice_object-payment_intent
I understand, thank you, last question can a subscription be unpaid and at the same time have end date still in the future ?
do you mean if the cycle keeps going even if the subscription status is "unpaid" ?
yes
I believe so. The new invoices would still be generated
then I would not only need to pay the last one but all the previews unpaid one manually ?
yup, customer portal should list all of them.
what is that customer portal ?
Its a prebuilt UI that allows customers to view their subscriptions, payment methods and invoices all in one place
Emm, I want to do it using my integrated UI, is there a way to easily do it ?
Another option would be to use a SetupIntent to collect a new PaymentMethod and set it as default on the customer. After that you can call Pay an invoice API for the unpaid invoices
I just ran a quick test and it looks like the actual behavior is a bit different
1/ Subscription will be in unpaid status once all the retries have failed
2/ the invoice that failed the payment will stay open failed status
(as long as you don't change it to uncollectible under Manage failed payments settings)
https://dashboard.stripe.com/settings/billing/automatic
3/ The subscription cycle would still continue and generate new invoices, however the invoices will be in draft mode
4/ Once you recollect the PaymentMethod, you can finalize these invoices by calling the API which then will tell Stripe to charge the payment method on file
https://stripe.com/docs/api/invoices/finalize
I understand thank you
when finalizing invoice will it automatically attempt payment
yup as long as the invoice has auto_advance set to true , it should attempt to charge the PaymentMethod
You can set that when you finalize
thank you