#cian54
1 messages · Page 1 of 1 (latest)
Yes you can still make the modify call on the subscription directly or you can modify the active phase on the schedule. I think updating the active phase is typically more straightforward. Updating the subscription with that call will still create a new phase on the schedule
but updating the active phase don't charge the user imideatly it pass the subscription to the new one while waiting for the user to pay
Not quite sure what you mean. Is there already a pending update or payment?
Do you have the ID of an example subscription that you did this kind of update with?
req_4OraUbpCtcuhM9
👋 Hopping in here
If I understand correctly, you want the phase to immediately apply and charge the user a prorated amount correct?
yes otherwise keep the current subscription
hmm I don't think Subscription Schedules support this yet.
Subscriptions API has a way to mark the update pending payment_behavior=pending_if_incomplete and set proration_behavior to generate the invoice
Updating a Schedule only allows you to set the proration behaviour
https://stripe.com/docs/api/subscription_schedules/create#create_subscription_schedule-phases-proration_behavior
So in case the invoice payment fails, it won't automatically go back to the current (before the update) schedule
how can I go back manually ?
You would need to update the phases again
how with wich webhooks ?
I believe you can listen to invoice.payment_failed events. That event is generated when the payment for the invoice fails
but how exactly can I handle this case because it can fails for a different of reason ?
The invoice generated via the update should have billing_reason set to subscription_update I believe
https://stripe.com/docs/api/invoices/object#invoice_object-billing_reason
Ok I understand thank you