#Timothée
1 messages · Page 1 of 1 (latest)
Hi! Let me help you with this.
Great thank you !
How can I schedule a subscription to be downgraded to another plan at period end?
There's a Subscription Schedules API that can help you do exactly that. It's an advanced feature: https://stripe.com/docs/billing/subscriptions/subscription-schedules
I can just put the end of the billing period timestamp to the phases "end_date" ?
Or should I use iterations ?
It's better to use iterations. You can set it to 1
So if the customer is halfway through the current billing period, I can just put 1 iteration for the current plan ?
The next phase should be the definitive plan. So basically "infinity" iteration ?
Actually, if it's just 1 period, you don't need to use Subscription Schedules. You can just update subscription with "proration_behaviour": "none"
Hum, I'm not sure because the subscription will be updated immediately instead at the end of the billing period no ?
The price will be updated immediately, but the user will only be billed with the updated amount at the start of the new period.
Yes but our application is enabling / disabling features depending on the current plan so I would prefer that he keeps his plan until the end of the billing period.
For example If I do that
stripe.SubscriptionSchedule.create(
customer="cus_N6jepJKDsc44Ms",
start_date=1673440421,
end_behavior="release",
phases=[
{
"items": [
{
"price": "plan_large",
"quantity": 1,
},
],
"iterations": 1,
},
{
"items": [
{
"price": "plan_small",
"quantity": 1,
},
],
"iterations": 1,
}
],
)
In this case you will need to use Subscription Schedules
Is it going to work even if it's halfway through the current billing period ?
Another question : Is it possible to do that with the customer portal ?
If you already have an existing subscription, then you'd pass the from_subscription parameter when creating the schedule: https://stripe.com/docs/api/subscription_schedules/create#create_subscription_schedule-from_subscription
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Otherwise your schedule will ultimate just create a new subscription
Do what?
In the Stripe customer portal. Is there an option to allow customers to downgrade their plans at period end.
There is an option to cancel at period end. But I don't see an option to downgrade at period end.
No, portal doesn't support that today. The upgrades/downgrades are immediate AFAIK
np!
Have a great day !
and you