Hi,
Due to our business we need sometimes to cancel “cancellation” of a subscription doing the following:
Unfortunately this changes the billing anchor of a subscription to be set to the day of the cancellation. Our business requires us to have billing cycles that start at the beginning of each month. Looking at subscription schedules it seems possible to reset a billing cycle anchor by setting a phase that will start at the end of the current month. What we would like to do is therefore:
Phase 1: starts at the current billing cycle period end (the cancelled end of the subscription) and ends at the end of the month Phase 2: starts at the end of the previous phase (beginning of month) and has a billing cycle anchor set to “phase_start”. No end date is set so that this phase lasts until further changes are made.
We tried in test mode with the following code
schedule = Stripe::SubscriptionSchedule.create({
from_subscription: ‘sub_1K2BG6EqnnYTeijJd8lo5fnU’
})
schedule = Stripe::SubscriptionSchedule.create({
from_subscription: ‘sub_1K2BG6EqnnYTeijJd8lo5fnU’
})
Stripe::SubscriptionSchedule.update(
‘sub_sched_1Js3gjEqnnYTeijJL603YRJo’,
{
phases: [
{
start_date: schedule.current_phase.end_date + 1,
items: [
{price: “price_1JtaKNEqnnYTeijJtNiP1N2X”},
],
end_date: Time.zone.today.end_of_month.end_of_day.to_i,
},
{
items: [
{price: “price_1JtaKNEqnnYTeijJtNiP1N2X”},
],
iterations: 11,
billing_cycle_anchor: ‘phase_start’,
}
]
}
)
--
To unsubscribe from this group and stop receiving emails from it, send an email to api-discuss...@lists.stripe.com.
To unsubscribe from this topic, visit https://groups.google.com/a/lists.stripe.com/d/topic/api-discuss/gl0oVouRHeg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to api-discuss...@lists.stripe.com.