#jeffnv-sub-schedules
1 messages ยท Page 1 of 1 (latest)
You can set an end_date (see https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-phases-end_date) if you want, but you can also just set iterations: 1 (https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-phases-iterations) so that the phase lasts up to one cycle. Once that final phase is over, as long as end_behavior on the Schedule is release then the Subscription will continue in whatever state it's in once the last phase was over
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
ok
so if I create a schedule for a customer, and set iterations for 1
it knows to take effect after the current cycle?
or do I need to create a schedule from the current subscription first?
You'd need to first create a Schedule from the current subscription (using from_subscription https://stripe.com/docs/api/subscription_schedules/create#create_subscription_schedule-from_subscription), and then update the schedule you get back from that to add on an additional phase after the current one is over
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
ok i have that
it makes a phase with start and end for the current period
so I append a new phase, with start as the current end period and iterations set to 1?
and end_date not set?
Almost - when you append the new phase you don't need to set a start since it'll start automatically after the current phase is done
Yes definitely - order of the phases is super important with schedules
ok so i create a schedule from an existing sub
that prepopulates a phase with the current cycle
i append the next phase with iterations 1 and I'm good?
Yup! And to be more specific, when you append the next phase you need to pass in both the current phase AND the new phase when you update the subscription schedule