#tusharvaswani_api
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1334876383624564787
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi, let me help you with this.
This can be achieved with Subscription Schedule. This is an advanced feature, and I would only recommend to use it if there's no other workaround. Basically, you need to:
- Turn your Subscription into a Subscription Schedule: https://docs.stripe.com/billing/subscriptions/subscription-schedules/use-cases#existing-subscription
- Add a new phase to the SubSchedule with the new parameters, and set the current phase to 1 iteration.
You can read more about Subscription Schedules here to understand the concept better: https://docs.stripe.com/billing/subscriptions/subscription-schedules
oh ok let me check
possible to provide some code sample related to that or some video guide as could not understand it
I can't explain it better than the documentation, unfortunately. Which parts exactly are unclear?
๐ taking over for my colleague. Let me know if there's any follow-up Qs I can answer!
Hey yes I am confused with the end_behaviour. Like let's say I applied a change to upgrade subscription. Then what kind of end behaviour I should use
ok
"release"
which means once the first iteration is done the subscription schedule will no longer control the subscription
But what about upgrade will that be applied to subscription?
you decide
didn't get it
like won't stripe update subscription if no then what's the point of subscription schedule
the subscription schedule will update the subscription's price when the phase start
but each phase has a start and end date
once the end date reaches that phase, the subscription schedule applies the next phase's price to the subscription
when there's no longer any subsequent phases, the subscription schedule has 2 end_behaviors
1- release: releases the subscription from the schedule... which means that the subscription is no longer controlled by the schedule
2- cancel: the subscription is no longer active
so for my use case where I want to upgrade/downgrade subscription at subscription.current_end_date:
I should create a phase that starts at subscription.current_end_date but I want this to continue forever so what should be the end date and should I even set that at all in this case?
Also the next invoice must be in draft state at subscription.current_end_date. So will the invoice updated with new upgraded price?
if you want for the subscription to continue after the upgrade
the last phase (the upgrade price) should have iterations:1 and end_behavior: "release"
that I understood but still things left to be answered:
- I should create a phase that starts at subscription.current_end_date?
- I want this to continue forever so what should be the end date and should I even set that at all in this case?
- Also the next invoice must be in draft state at subscription.current_end_date. So will the invoice updated with new upgraded price?
I should create a phase that starts at subscription.current_end_date?
first you create a subscription schedule from the subscription, then you update the subscription schedule with the same first phase that now ends atsubscription.current_end_dateand add a second phase which starts at thesubscription.current_end_date
I want this to continue forever so what should be the end date and should I even set that at all in this case?
the last phase (the upgrade price) should have iterations:1 and end_behavior: "release"
Also the next invoice must be in draft state at subscription.current_end_date. So will the invoice updated with new upgraded price?
yes
got it ok let me try checking if all this works fine with test clock and all but thanks for help
let me know if you need any more help
yes I wil try checking this and then will let you know for now everything seems clear