#duracel-schedule-error

1 messages · Page 1 of 1 (latest)

feral ruinBOT
wheat osprey
#

duracel-schedule-error

orchid perch
#

Is there another way to add a new schedule to an existing subscription?

#

My use case is when a customer is subscribed to an annual plan and decides to switch to a monthly plan. I'd like to subscribe them to the monthly plan at the end of the current subscription's billing cycle (a year from now)

wheat osprey
#

So you have an existing Subscription. What you want is
1/ Create a SubscriptionSchedule from that existing Subscription using from_subscription
2/ Update that Schedule and pass the same first phase (current one) and add a new one at the end that makes the switch to the new Price

orchid perch
#

Did step #1 but am stuck on #2

wheat osprey
#

1/ Don't use this tool you're going to just struggle and struggle and struggle. Use real code based on the Stripe client library/SDK your usual code uses
2/ Read the docs about schedules carefully
3/ You have to pass all phases on update, not just the new one

orchid perch
#

If I just created a SubscriptionSchedule from an existing schedule, wouldn't that schedule be phase[0] and then the new one be phase[1]?

wheat osprey
#

yes

#

When you create the schedule look at the exact response, it has an entire phase in it and you have to re-pass all relevant phases. It's... convoluted I would say
We're working on a better approach in the future where you can "amend" a schedule and add new phases

orchid perch
#

I'm using this tool because my app is built in Bubble and I've been unable to use the code from stripe there, so parameters are the only way for now

wheat osprey
#

you can still write code locally as a developer