#i'm a cyborg but that's okay

1 messages · Page 1 of 1 (latest)

tropic wharfBOT
raven wolf
#

Hi, yes - you'd want to use our Subscriptions Schedules API, https://stripe.com/docs/api/subscription_schedules

You'd add different phases. For the first phase, they'd stay on plan 3 then the seconds phase, plan 2 starts after the previous phase ends.

frank rain
#

so, when a user initially subscribes to a plan using checkout, i'll get a subscription id. And, when they change their plan, I'll use the existing subscription_id to create a schedule.
Does creating a new schedule kind of invalidates the existing subscription_id? Do I have to store this new subscription schedule ID somewhere in my database?

raven wolf
frank rain
#

Does creating a new schedule kind of invalidates the existing subscription_id? Do I have to store this new subscription schedule ID somewhere in my database?
The guide doesn't addresses these questions :(

raven wolf
#

What does 'invalidate' mean? You should be able to see the subscription id

frank rain
#

Does subscription_id remains the same for a particular customer even if they change their plan?

raven wolf
frank rain
#

alright. One more thing, if I create a subscription schedule, but then like I said in the upgrade scenario, when a user tries to upgrade, i'll upgrade the user immediately.
For this, I'll have to release a subscription schedule, and generate an invoice immediately, right?

#

I don't think I'll need to cancel a schedule, because that would cancel the existing subscription as well.

raven wolf
frank rain
#

cool.
So, here's the complete flow. Please correct me if something is wrong.
User subscribes for a first time -> Stripe checkout -> Subscription is created
User changes plan(upgrade) -> Create a subscription schedule using existing subscription id with invoice immediately(removing any phases before)
User changes plan(downgrade) -> Create/modify subscription schedule adding a new phase(removing any phases before except the ongoing plan)
That's it.

raven wolf
#

What do you mean by 'removing any phases before'? You wouldn't remove a phase

frank rain
#

so, lets say a user is on plan 3, and they chose to downgrade to plan 2. I won't let them downgrade immediately, instead schedule plan 2 to take effect after the current plan 3 ends. In this case, my phase would contain step for plan 2.

However, before plan 2 takes place, user chooses to downgrade to plan 1 instead, so in this case I'll have to remove previous plan 2 step, and add in step for plan 1.

So, i'm guessing i'll have to remove the plan 2 phase, and add in plan 1 phase, right?

raven wolf
#

I see, yes -- you'd want to test this in your test enviroment first to make sure that it's doing everything that you intent id to do.

frank rain
#

Cool, i'll test this. Thanks a lot for your help!