#tusharvaswani_api

1 messages ยท Page 1 of 1 (latest)

burnt zealotBOT
#

๐Ÿ‘‹ 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.

cobalt void
#

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:

  1. Turn your Subscription into a Subscription Schedule: https://docs.stripe.com/billing/subscriptions/subscription-schedules/use-cases#existing-subscription
  2. 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

orchid matrix
#

oh ok let me check

orchid matrix
#

possible to provide some code sample related to that or some video guide as could not understand it

cobalt void
#

I can't explain it better than the documentation, unfortunately. Which parts exactly are unclear?

burnt zealotBOT
slim aurora
#

๐Ÿ‘‹ taking over for my colleague. Let me know if there's any follow-up Qs I can answer!

orchid matrix
#

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

slim aurora
#

"release"

#

which means once the first iteration is done the subscription schedule will no longer control the subscription

orchid matrix
#

But what about upgrade will that be applied to subscription?

slim aurora
#

you decide

orchid matrix
#

didn't get it

#

like won't stripe update subscription if no then what's the point of subscription schedule

slim aurora
#

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

orchid matrix
#

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?

slim aurora
#

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"

orchid matrix
#

that I understood but still things left to be answered:

  1. I should create a phase that starts at subscription.current_end_date?
  2. I want this to continue forever so what should be the end date and should I even set that at all in this case?
  3. Also the next invoice must be in draft state at subscription.current_end_date. So will the invoice updated with new upgraded price?
slim aurora
#

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 at subscription.current_end_date and add a second phase which starts at the 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?
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

orchid matrix
#

got it ok let me try checking if all this works fine with test clock and all but thanks for help

slim aurora
#

let me know if you need any more help

orchid matrix