Subscription schedules use cases

    Learn how to use subscription schedules.

    The use cases below demonstrate some common ways to use subscription schedules. These use cases are modeled after a fictional newspaper company called The Pacific. The Pacific offers two monthly plans: print and digital. The print plan is for the physical newspaper. The digital plan is for access to the newspaper’s website. Both plans bill monthly.

    Starting a subscription in the future

    By default, when a new customer subscribes to the print plan, their subscription starts on the first of the next month. To accomplish this, the start_date is set to a time in the future. The code below creates a subscription with the print plan that starts in the future:

    curl https://api.stripe.com/v1/subscription_schedules \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -d customer=cus_GBHHxuvBvO26Ea \ -d start_date=1577836800 \ -d end_behavior=release \ -d phases[0][plans][0][plan]=plan_print \ -d phases[0][plans][0][quantity]=1 \ -d phases[0][iterations]=12
    # Set your secret key: remember to change this to your live secret key in production # See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' Stripe::SubscriptionSchedule.create({ customer: 'cus_GBXUtjZo0nHBmW', start_date: '1577836800', end_behavior: 'release', phases: [ { plans: [ {plan: 'plan_print', quantity: 1}, ], iterations: 12, }, ], })
    # Set your secret key: remember to change this to your live secret key in production # See your keys here: https://dashboard.stripe.com/account/apikeys stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' stripe.SubscriptionSchedule.create( customer='cus_GBXV9Q95NFT80k', start_date='1577836800', end_behavior='release', phases=[ { 'plans': [ {'plan': 'plan_print', 'quantity': 1}, ], 'iterations': 12, }, ], )
    // Set your secret key: remember to change this to your live secret key in production // See your keys here: https://dashboard.stripe.com/account/apikeys \Stripe\Stripe::setApiKey('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); StripeSubscriptionSchedule::create([ 'customer' => 'cus_GBXVvM3Lyqlb92', 'start_date' => '1577836800', 'end_behavior' => 'release', 'phases' => [ [ 'plans' => [ [ 'plan' => 'plan_print', 'quantity' => 1, ], ], 'iterations' => 12, ], ], ]);
    // Set your secret key: remember to change this to your live secret key in production // See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.apiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; List<Object> phases = new ArrayList<>(); List<Object> plans = new ArrayList<>(); Map<String, Object> plan1 = new HashMap<>(); plan1.put("plan", "plan_print"); plan1.put("quantity", 1); plans.add(plan1); Map<String, Object> phase1 = new HashMap<>(); phase1.put("plans", plans); phase1.put("iterations", 12); phases.add(phase1); Map<String, Object> params = new HashMap<>(); params.put("customer", "cus_GBXVzJZPdLuVU7"); params.put("start_date", "1577836800"); params.put("end_behavior", "release"); params.put("phases", phases); SubscriptionSchedule subscriptionSchedule = SubscriptionSchedule.create(params);
    // Set your secret key: remember to change this to your live secret key in production // See your keys here: https://dashboard.stripe.com/account/apikeys const stripe = require('stripe')('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); // Starting a subscription 30 days from now stripe.subscriptionSchedules.create( { customer: 'cus_G8BQyXLV4wIrlu', start_date: new Date('2020-01-01').getTime() / 1000, end_behavior: 'release', phases: [ { plans: [{ plan: 'plan_print', quantity: 1 }], iterations: 12 }, ], }, function(err, subscriptionSchedule) { // asynchronously called } );
    // Set your secret key: remember to change this to your live secret key in production // See your keys here: https://dashboard.stripe.com/account/apikeys stripe.Key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc" params := &stripe.SubscriptionScheduleParams{ Customer: stripe.String("cus_G8BQyXLV4wIrlu"), StartDate: stripe.Int64("1577836800"), EndBehavior: stripe.String(string(stripe.SubscriptionScheduleEndBehaviorRelease)), Phases: []*stripe.SubscriptionSchedulePhaseParams{ { Plans: []*stripe.SubscriptionSchedulePhaseItemParams{ { Plan: stripe.String("plan_print"), Quantity: stripe.Int64(1), }, }, Iterations: stripe.Int64(12), }, }, } schedule, _ := subschedule.New(params)
    // Set your secret key: remember to change this to your live secret key in production // See your keys here: https://dashboard.stripe.com/account/apikeys StripeConfiguration.ApiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; var options = new SubscriptionScheduleCreateOptions { Customer = "cus_GBZpSoDXILjq1a", StartDate = DateTimeOffset.FromUnixTimeSeconds("1577836800").UtcDateTime, EndBehavior = "release", Phases = new List<SubscriptionSchedulePhaseOptions> { new SubscriptionSchedulePhaseOptions { Plans = new List<SubscriptionSchedulePhaseItemOptions> { new SubscriptionSchedulePhaseItemOptions { Plan = "plan_print", Quantity = 1, }, }, Iterations = 12, }, }, }; var service = new SubscriptionScheduleService(); service.Create(options);

    Backdating a subscription

    When customers subscribe to the digital plan, The Pacific backdates their subscriptions to the first of the current month. This accomplishes a few things:

    1. It sets the billing cycle anchor to the first of the month so that all subscriptions are invoiced at the same time.
    2. Digital subscribers can access the website immediately and are charged a prorated amount for the remainder of the month.
    curl https://api.stripe.com/v1/subscription_schedules \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -d customer=cus_GBHHxuvBvO26Ea \ -d start_date=1572566400 \ -d end_behavior=release \ -d phases[0][plans][0][plan]=plan_print \ -d phases[0][plans][0][quantity]=1 \ -d phases[0][iterations]=12
    # Set your secret key: remember to change this to your live secret key in production # See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' Stripe::SubscriptionSchedule.create({ customer: 'cus_GBHCmVcdwIb5ye', start_date: '1572566400', end_behavior: 'release', phases: [ { plans: [ {plan: 'plan_print', quantity: 1}, ], iterations: 12, }, ], })
    # Set your secret key: remember to change this to your live secret key in production # See your keys here: https://dashboard.stripe.com/account/apikeys stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' stripe.SubscriptionSchedule.create( customer='cus_GBXV9Q95NFT80k', start_date='1572566400', end_behavior='release', phases=[ { 'plans': [ {'plan': "plan_print", 'quantity': 1}, ], 'iterations': 12, }, ], )
    // Set your secret key: remember to change this to your live secret key in production // See your keys here: https://dashboard.stripe.com/account/apikeys \Stripe\Stripe::setApiKey('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); StripeSubscriptionSchedule::create([ 'customer' => 'cus_GBXVvM3Lyqlb92', 'start_date' => '1572566400', 'end_behavior' => 'release', 'phases' => [ [ 'plans' => [ [ 'plan' => 'plan_print', 'quantity' => 1, ], ], 'iterations' => 12, ], ], ]);
    // Set your secret key: remember to change this to your live secret key in production // See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.apiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; List<Object> phases = new ArrayList<>(); List<Object> plans = new ArrayList<>(); Map<String, Object> plan1 = new HashMap<>(); plan1.put("plan", "plan_print"); plan1.put("quantity", 1); plans.add(plan1); Map<String, Object> phase1 = new HashMap<>(); phase1.put("plans", plans); phase1.put("iterations", 12); phases.add(phase1); Map<String, Object> params = new HashMap<>(); params.put("customer", "cus_GBXVzJZPdLuVU7"); params.put("start_date", "1572566400"); params.put("end_behavior", "release"); params.put("phases", phases); SubscriptionSchedule subscriptionSchedule = SubscriptionSchedule.create(params);
    // Set your secret key: remember to change this to your live secret key in production // See your keys here: https://dashboard.stripe.com/account/apikeys const stripe = require('stripe')('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); // Backdating a subscription to the first day of the previous month. stripe.subscriptionSchedules.create( { customer: 'cus_G8BQyXLV4wIrlu', start_date: new Date('2019-11-01').getTime() / 1000, end_behavior: 'release', phases: [ { plans: [{ plan: 'plan_print', quantity: 1 }], iterations: 12, }, ], }, function(err, subscriptionSchedule) { // asynchronously called } );
    // Set your secret key: remember to change this to your live secret key in production // See your keys here: https://dashboard.stripe.com/account/apikeys stripe.Key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc" params := &stripe.SubscriptionScheduleParams{ Customer: stripe.String("cus_G8BQyXLV4wIrlu"), StartDate: stripe.Int64("1572566400}"), EndBehavior: stripe.String(string(stripe.SubscriptionScheduleEndBehaviorRelease)), Phases: []*stripe.SubscriptionSchedulePhaseParams{ { Plans: []*stripe.SubscriptionSchedulePhaseItemParams{ { Plan: stripe.String("plan_print"), Quantity: stripe.Int64(1), }, }, Iterations: stripe.Int64(12), }, }, } schedule, _ := subschedule.New(params)
    // Set your secret key: remember to change this to your live secret key in production // See your keys here: https://dashboard.stripe.com/account/apikeys StripeConfiguration.ApiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; var options = new SubscriptionScheduleCreateOptions { Customer = "cus_GBa4ZI52MEpjSz", StartDate = DateTimeOffset.FromUnixTimeSeconds("1572566400").UtcDateTime, EndBehavior = "release", Phases = new List<SubscriptionSchedulePhaseOptions> { new SubscriptionSchedulePhaseOptions { Plans = new List<SubscriptionSchedulePhaseItemOptions> { new SubscriptionSchedulePhaseItemOptions { Plan = "plan_print", Quantity = 1, }, }, Iterations = 12, }, }, }; var service = new SubscriptionScheduleService(); service.Create(options);

    Adding a schedule to an existing subscription

    The Pacific discovered that some of their original customers are on subscriptions without schedules. Because these subscriptions exist already, the subscription IDs can be passed in the from_subscription attribute to add a schedule. This creates a schedule with one phase that’s based on the current billing period of the subscription.

    curl https://api.stripe.com/v1/subscription_schedules \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -d from_subscription=sub_GB98WOvaRAWPl6
    # Set your secret key: remember to change this to your live secret key in production # See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' Stripe::SubscriptionSchedule.create({ from_subscription: 'sub_GB98WOvaRAWPl6', })
    # Set your secret key: remember to change this to your live secret key in production # See your keys here: https://dashboard.stripe.com/account/apikeys stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' stripe.SubscriptionSchedule.create( from_subscription='sub_GB98WOvaRAWPl6', )
    // Set your secret key: remember to change this to your live secret key in production // See your keys here: https://dashboard.stripe.com/account/apikeys \Stripe\Stripe::setApiKey('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); StripeSubscriptionSchedule::create([ 'from_subscription' => 'sub_GB98WOvaRAWPl6', ]);
    // Set your secret key: remember to change this to your live secret key in production // See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.apiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; Map<String, String> params = new HashMap<>(); params.put("from_subscription", "sub_GB98WOvaRAWPl6"); SubscriptionSchedule subscriptionSchedule = SubscriptionSchedule.create(params);
    // Set your secret key: remember to change this to your live secret key in production // See your keys here: https://dashboard.stripe.com/account/apikeys const stripe = require('stripe')('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); stripe.subscriptionSchedules.create( { from_subscription: 'sub_GB98WOvaRAWPl6' }, function(err, subscriptionSchedule) { // asynchronously called } );
    // Set your secret key: remember to change this to your live secret key in production // See your keys here: https://dashboard.stripe.com/account/apikeys stripe.Key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc" params := &stripe.SubscriptionScheduleParams{ FromSubscription: stripe.String("sub_GB98WOvaRAWPl6"), } schedule, _ := subschedule.New(params)
    // Set your secret key: remember to change this to your live secret key in production // See your keys here: https://dashboard.stripe.com/account/apikeys StripeConfiguration.ApiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; var options = new SubscriptionScheduleCreateOptions { FromSubscription = "cus_GBGtWriHqoHUxj", }; var service = new SubscriptionScheduleService(); service.Create(options);

    While adding these schedules, some customers want to add a print subscription so The Pacific adds a second phase to the schedule to add the print plan on the first of the next month. You can see an example of this in the next use case.

    Upgrading plans

    The Pacific offers an option to start off on the print plan for a month and then automatically add the digital plan. Some customers prefer this option because they can test out the print publication first and then decide if they want to continue or cancel their subscription.

    curl https://api.stripe.com/v1/subscription_schedules \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -d customer=cus_GBHHxuvBvO26Ea \ -d start_date=now \ -d end_behavior=release \ -d phases[0][plans][0][plan]=digital \ -d phases[0][plans][0][quantity]=1 \ -d phases[0][iterations]=1 \ -d phases[1][plans][0][plan]=digital \ -d phases[1][plans][0][quantity]=1 \ -d phases[1][plans][1][plan]=print \ -d phases[1][plans][1][quantity]=1 \ -d phases[1][iterations]=11
    # Set your secret key: remember to change this to your live secret key in production # See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' Stripe::SubscriptionSchedule.create({ customer: 'cus_GBXUtjZo0nHBmW', start_date: 'now', end_behavior: 'release', phases: [ { plans: [ {plan: 'plan_digital', quantity: 1}, ], iterations: 1, }, { plans: [ {plan: 'plan_digital', quantity: 1}, {plan: 'plan_print', quantity: 1}, ], iterations: 11, }, ], })
    # Set your secret key: remember to change this to your live secret key in production # See your keys here: https://dashboard.stripe.com/account/apikeys stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' stripe.SubscriptionSchedule.create( customer='cus_GBXV9Q95NFT80k', start_date='now', end_behavior='release', phases=[ { 'plans': [ {'plan': 'plan_digital', 'quantity': 1}, ], 'iterations': 1, }, { 'plans': [ {'plan': 'plan_digital', 'quantity': 1}, {'plan': 'plan_print', 'quantity': 1}, ], 'iterations': 11, }, ], )
    // Set your secret key: remember to change this to your live secret key in production // See your keys here: https://dashboard.stripe.com/account/apikeys \Stripe\Stripe::setApiKey('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); StripeSubscriptionSchedule::create([ 'customer' => 'cus_GBXVvM3Lyqlb92', 'start_date' => 'now', 'end_behavior' => 'release', 'phases' => [ [ 'plans' => [ [ 'plan' => 'plan_digital', 'quantity' => 1, ], ], 'iterations' => 1, ], [ 'plans' => [ [ 'plan' => 'plan_digital', 'quantity' => 1, ], [ 'plan' => 'plan_print', 'quantity' => 1, ], ], 'iterations' => 11, ], ], ]);
    // Set your secret key: remember to change this to your live secret key in production // See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.apiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; List<Object> phases = new ArrayList<>(); List<Object> firstPhasePlans = new ArrayList<>(); Map<String, Object> planOneFirstPhase = new HashMap<>(); planOneFirstPhase.put("plan", "plan_digital"); planOneFirstPhase.put("quantity", 1); firstPhasePlans.add(planOneFirstPhase); Map<String, Object> firstPhase = new HashMap<>(); firstPhase.put("plans", firstPhasePlans); firstPhase.put("iterations", 1); phases.add(firstPhase); List<Object> secondPhasePlans = new ArrayList<>(); Map<String, Object> planOneSecondPhase = new HashMap<>(); planOneSecondPhase.put("plan", "plan_digital"); planOneSecondPhase.put("quantity", 1); secondPhasePlans.add(planOneSecondPhase); Map<String, Object> planTwoSecondPhase = new HashMap<>(); planTwoSecondPhase.put("plan", "plan_print"); planTwoSecondPhase.put("quantity", 1); secondPhasePlans.add(planTwoSecondPhase); Map<String, Object> secondPhase = new HashMap<>(); secondPhase.put("plans", secondPhasePlans); secondPhase.put("iterations", 11); phases.add(secondPhase); Map<String, Object> params = new HashMap<>(); params.put("customer", "cus_GBXVzJZPdLuVU7"); params.put("start_date", "now"); params.put("end_behavior", "release"); params.put("phases", phases); SubscriptionSchedule subscriptionSchedule = SubscriptionSchedule.create(params);
    // Set your secret key: remember to change this to your live secret key in production // See your keys here: https://dashboard.stripe.com/account/apikeys const stripe = require('stripe')('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); stripe.subscriptionSchedules.create( { customer: 'cus_G8BQyXLV4wIrlu', start_date: 'now', end_behavior: 'release', phases: [ { plans: [{ plan: 'plan_digital', quantity: 1 }], iterations: 1, }, { plans: [{ plan: 'plan_digital', quantity: 1 }, { plan: 'plan_print', quantity: 1 }], iterations: 11, }, ], }, function(err, subscriptionSchedule) { // asynchronously called } );
    // Set your secret key: remember to change this to your live secret key in production // See your keys here: https://dashboard.stripe.com/account/apikeys stripe.Key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc" params := &stripe.SubscriptionScheduleParams{ Customer: stripe.String("cus_G8BQyXLV4wIrlu"), StartDateNow: stripe.Bool(true), EndBehavior: stripe.String(string(stripe.SubscriptionScheduleEndBehaviorRelease)), Phases: []*stripe.SubscriptionSchedulePhaseParams{ { Plans: []*stripe.SubscriptionSchedulePhaseItemParams{ { Plan: stripe.String("plan_digital"), Quantity: stripe.Int64(1), }, }, Iterations: stripe.Int64(1), }, { Plans: []*stripe.SubscriptionSchedulePhaseItemParams{ { Plan: stripe.String("plan_digital"), Quantity: stripe.Int64(1), }, { Plan: stripe.String("plan_print"), Quantity: stripe.Int64(1), }, }, Iterations: stripe.Int64(11), }, }, } schedule, _ := subschedule.New(params)
    // Set your secret key: remember to change this to your live secret key in production // See your keys here: https://dashboard.stripe.com/account/apikeys StripeConfiguration.ApiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; var options = new SubscriptionScheduleCreateOptions { Customer = "cus_GBZpSoDXILjq1a", StartDate = SubscriptionScheduleStartDate.Now, EndBehavior = "release", Phases = new List<SubscriptionSchedulePhaseOptions> { new SubscriptionSchedulePhaseOptions { Plans = new List<SubscriptionSchedulePhaseItemOptions> { new SubscriptionSchedulePhaseItemOptions { Plan = "plan_digital", Quantity = 1, }, }, Iterations = 1, }, new SubscriptionSchedulePhaseOptions { Plans = new List<SubscriptionSchedulePhaseItemOptions> { new SubscriptionSchedulePhaseItemOptions { Plan = "plan_digital", Quantity = 1, }, new SubscriptionSchedulePhaseItemOptions { Plan = "plan_print", Quantity = 1, }, }, Iterations = 11, }, }, }; var service = new SubscriptionScheduleService(); service.Create(options);

    Downgrading plans

    The Pacific also offers an option to start a subscription with both plans and then downgrade to the print plan for the rest of the subscription. Customers use this option to test out both plans to see how they like them.

    curl https://api.stripe.com/v1/subscription_schedules \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -d customer=cus_GBHHxuvBvO26Ea \ -d start_date=now \ -d end_behavior=release \ -d phases[0][plans][0][plan]=digital \ -d phases[0][plans][0][quantity]=1 \ -d phases[0][plans][1][plan]=print \ -d phases[0][plans][1][quantity]=1 \ -d phases[0][iterations]=1 \ -d phases[1][plans][0][plan]=print \ -d phases[1][plans][0][quantity]=1 \ -d phases[1][iterations]=11
    # Set your secret key: remember to change this to your live secret key in production # See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' Stripe::SubscriptionSchedule.create({ customer: 'cus_GBXUtjZo0nHBmW', start_date: 'now', end_behavior: 'release', phases: [ { plans: [ {plan: 'plan_digital', quantity: 1}, {plan: 'plan_print', quantity: 1}, ], iterations: 1, }, { plans: [ {plan: 'plan_print', quantity: 1}, ], iterations: 11, }, ], })
    # Set your secret key: remember to change this to your live secret key in production # See your keys here: https://dashboard.stripe.com/account/apikeys stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' stripe.SubscriptionSchedule.create( customer='cus_GBXV9Q95NFT80k', start_date='now', end_behavior='release', phases=[ { 'plans': [ {'plan': 'plan_digital', 'quantity': 1}, {'plan': 'plan_print', 'quantity': 1}, ], 'iterations': 1, }, { 'plans': [ {'plan': 'plan_print', 'quantity': 1}, ], 'iterations': 11, }, ], )
    // Set your secret key: remember to change this to your live secret key in production // See your keys here: https://dashboard.stripe.com/account/apikeys \Stripe\Stripe::setApiKey('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); StripeSubscriptionSchedule::create([ 'customer' => 'cus_GBXVvM3Lyqlb92', 'start_date' => 'now', 'end_behavior' => 'release', 'phases' => [ [ 'plans' => [ [ 'plan' => 'plan_digital', 'quantity' => 1, ], [ 'plan' => 'plan_print', 'quantity' => 1, ], ], 'iterations' => 1, ], [ 'plans' => [ [ 'plan' => 'plan_print', 'quantity' => 1, ], ], 'iterations' => 11, ], ], ]);
    // Set your secret key: remember to change this to your live secret key in production // See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.apiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; List<Object> phases = new ArrayList<>(); List<Object> firstPhasePlans = new ArrayList<>(); Map<String, Object> planOneFirstPhase = new HashMap<>(); planOneFirstPhase.put("plan", "plan_digital"); planOneFirstPhase.put("quantity", 1); firstPhasePlans.add(planOneFirstPhase); Map<String, Object> planTwoFirstPhase = new HashMap<>(); planTwoFirstPhase.put("plan", "plan_digital"); planTwoFirstPhase.put("quantity", 1); firstPhasePlans.add(planTwoFirstPhase); Map<String, Object> firstPhase = new HashMap<>(); firstPhase.put("plans", firstPhasePlans); firstPhase.put("iterations", 1); phases.add(firstPhase); List<Object> secondPhasePlans = new ArrayList<>(); Map<String, Object> planOneSecondPhase = new HashMap<>(); planOneSecondPhase.put("plan", "plan_print"); planOneSecondPhase.put("quantity", 1); secondPhasePlans.add(planOneSecondPhase); Map<String, Object> secondPhase = new HashMap<>(); secondPhase.put("plans", secondPhasePlans); secondPhase.put("iterations", 11); phases.add(secondPhase); Map<String, Object> params = new HashMap<>(); params.put("customer", "cus_GBXVzJZPdLuVU7"); params.put("start_date", "now"); params.put("end_behavior", "release"); params.put("phases", phases); SubscriptionSchedule subscriptionSchedule = SubscriptionSchedule.create(params);
    // Set your secret key: remember to change this to your live secret key in production // See your keys here: https://dashboard.stripe.com/account/apikeys const stripe = require('stripe')('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); stripe.subscriptionSchedules.create( { customer: 'cus_G8BQyXLV4wIrlu', start_date: 'now', end_behavior: 'release', phases: [ { plans: [{ plan: 'plan_digital', quantity: 1 }, { plan: 'plan_print', quantity: 1 }], iterations: 1, }, { plans: [{ plan: 'plan_print', quantity: 1 }], iterations: 11, }, ], }, function(err, subscriptionSchedule) { // asynchronously called } );
    // Set your secret key: remember to change this to your live secret key in production // See your keys here: https://dashboard.stripe.com/account/apikeys stripe.Key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc" params := &stripe.SubscriptionScheduleParams{ Customer: stripe.String("cus_G8BQyXLV4wIrlu"), StartDateNow: stripe.Bool(true), EndBehavior: stripe.String(string(stripe.SubscriptionScheduleEndBehaviorRelease)), Phases: []*stripe.SubscriptionSchedulePhaseParams{ { Plans: []*stripe.SubscriptionSchedulePhaseItemParams{ { Plan: stripe.String("plan_digital"), Quantity: stripe.Int64(1), }, { Plan: stripe.String("plan_print"), Quantity: stripe.Int64(1), }, }, Iterations: stripe.Int64(1), }, { Plans: []*stripe.SubscriptionSchedulePhaseItemParams{ { Plan: stripe.String("plan_print"), Quantity: stripe.Int64(1), }, }, Iterations: stripe.Int64(11), }, }, } schedule, _ := subschedule.New(params)
    // Set your secret key: remember to change this to your live secret key in production // See your keys here: https://dashboard.stripe.com/account/apikeys StripeConfiguration.ApiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; var options = new SubscriptionScheduleCreateOptions { Customer = "cus_GBZpSoDXILjq1a", StartDate = SubscriptionScheduleStartDate.Now, EndBehavior = "release", Phases = new List<SubscriptionSchedulePhaseOptions> { new SubscriptionSchedulePhaseOptions { Plans = new List<SubscriptionSchedulePhaseItemOptions> { new SubscriptionSchedulePhaseItemOptions { Plan = "plan_digital", Quantity = 1, }, new SubscriptionSchedulePhaseItemOptions { Plan = "plan_print", Quantity = 1, }, }, Iterations = 1, }, new SubscriptionSchedulePhaseOptions { Plans = new List<SubscriptionSchedulePhaseItemOptions> { new SubscriptionSchedulePhaseItemOptions { Plan = "plan_print", Quantity = 1, }, }, Iterations = 11, }, }, }; var service = new SubscriptionScheduleService(); service.Create(options);

    Increasing the quantity

    You can also schedule increases to the number of plans on a subscription. The schedule below starts with one instance of the digital plan for one month. In the second phase, the quantity is increased to 2 for 11 more months.

    curl https://api.stripe.com/v1/subscription_schedules \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -d customer=cus_GBHHxuvBvO26Ea \ -d start_date=now \ -d end_behavior=release \ -d "phases[][plans][][plan]='plan_digital'" \ -d phases[][plans][][quantity]=1 \ -d phases[][iterations]=1 \ -d "phases[][plans][][plan]='plan_digital'" \ -d phases[][plans][][quantity]=2 \ -d phases[][iterations]=11
    # Set your secret key: remember to change this to your live secret key in production # See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' Stripe::SubscriptionSchedule.create({ customer: 'cus_GBXUtjZo0nHBmW', start_date: "now", end_behavior: 'release', phases: [ { plans: [ {plan: 'plan_digital', quantity: 1}, ], iterations: 1, }, { plans: [ {plan: 'plan_digital', quantity: 2}, ], iterations: 11, }, ], })
    # Set your secret key: remember to change this to your live secret key in production # See your keys here: https://dashboard.stripe.com/account/apikeys stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' stripe.SubscriptionSchedule.create( customer='cus_GBXV9Q95NFT80k', start_date='now', end_behavior='release', phases=[ { 'plans': [ {'plan': 'plan_digital', 'quantity': 1}, ], 'iterations': 1, }, { 'plans': [ {'plan': 'plan_digital', 'quantity': 2}, ], 'iterations': 11, }, ], )
    // Set your secret key: remember to change this to your live secret key in production // See your keys here: https://dashboard.stripe.com/account/apikeys \Stripe\Stripe::setApiKey('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); StripeSubscriptionSchedule::create([ 'customer' => 'cus_GBXVvM3Lyqlb92', 'start_date' => 'now', 'end_behavior' => 'release', 'phases' => [ [ 'plans' => [ [ 'plan' => 'plan_digital', 'quantity' => 1, ], ], 'iterations' => 1, ], [ 'plans' => [ [ 'plan' => 'plan_digital', 'quantity' => 2, ], ], 'iterations' => 11, ], ], ]);
    // Set your secret key: remember to change this to your live secret key in production // See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.apiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; List<Object> phases = new ArrayList<>(); List<Object> firstPhasePlans = new ArrayList<>(); Map<String, Object> planOneFirstPhase = new HashMap<>(); planOneFirstPhase.put("plan", "plan_digital"); planOneFirstPhase.put("quantity", 1); firstPhasePlans.add(planOneFirstPhase); Map<String, Object> phase1 = new HashMap<>(); phase1.put("plans", firstPhasePlans); phase1.put("iterations", 1); phases.add(phase1); List<Object> secondPhasePlans = new ArrayList<>(); Map<String, Object> planOneSecondPhase = new HashMap<>(); planOneSecondPhase.put("plan", "plan_digital"); planOneSecondPhase.put("quantity", 2); secsecondPhasePlans.add(planOneSecondPhase); Map<String, Object> phaseTwo = new HashMap<>(); phaseTwo.put("plans", secondPhasePlans); phaseTwo.put("iterations", 1); phases.add(phaseTwo); Map<String, Object> params = new HashMap<>(); params.put("customer", "cus_GBXVzJZPdLuVU7"); params.put("start_date", "now"); params.put("end_behavior", "release"); params.put("phases", phases); SubscriptionSchedule subscriptionSchedule = SubscriptionSchedule.create(params);
    // Set your secret key: remember to change this to your live secret key in production // See your keys here: https://dashboard.stripe.com/account/apikeys const stripe = require('stripe')('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); stripe.subscriptionSchedules.create( { customer: 'cus_G8BQyXLV4wIrlu', start_date: 'now', end_behavior: 'release', phases: [ { plans: [{ plan: 'plan_digital', quantity: 1 }], iterations: 1 }, { plans: [{ plan: 'plan_digital', quantity: 2 }], iterations: 11, }, ], }, function(err, subscriptionSchedule) { // asynchronously called } );
    // Set your secret key: remember to change this to your live secret key in production // See your keys here: https://dashboard.stripe.com/account/apikeys stripe.Key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc" params := &stripe.SubscriptionScheduleParams{ Customer: stripe.String("cus_G8BQyXLV4wIrlu"), StartDateNow: stripe.Bool(true), EndBehavior: stripe.String(string(stripe.SubscriptionScheduleEndBehaviorRelease)), Phases: []*stripe.SubscriptionSchedulePhaseParams{ { Plans: []*stripe.SubscriptionSchedulePhaseItemParams{ { Plan: stripe.String("plan_digital"), Quantity: stripe.Int64(1), }, }, Iterations: stripe.Int64(1), }, { Plans: []*stripe.SubscriptionSchedulePhaseItemParams{ { Plan: stripe.String("plan_digital"), Quantity: stripe.Int64(2), }, }, Iterations: stripe.Int64(11), }, }, } schedule, _ := subschedule.New(params)
    // Set your secret key: remember to change this to your live secret key in production // See your keys here: https://dashboard.stripe.com/account/apikeys StripeConfiguration.ApiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; var options = new SubscriptionScheduleCreateOptions { Customer = "cus_GBZpSoDXILjq1a", StartDate = SubscriptionScheduleStartDate.Now, EndBehavior = "release", Phases = new List<SubscriptionSchedulePhaseOptions> { new SubscriptionSchedulePhaseOptions { Plans = new List<SubscriptionSchedulePhaseItemOptions> { new SubscriptionSchedulePhaseItemOptions { Plan = "plan_digital", Quantity = 1, }, }, Iterations = 1, }, new SubscriptionSchedulePhaseOptions { Plans = new List<SubscriptionSchedulePhaseItemOptions> { new SubscriptionSchedulePhaseItemOptions { Plan = "plan_digital", Quantity = 2, }, }, Iterations = 11, }, }, }; var service = new SubscriptionScheduleService(); service.Create(options);

    Using coupons

    Sometimes The Pacific runs specials on their subscriptions. The schedule below starts the customer on the print plan at 50% off for six months. In the second phase, the coupon is removed from the subscription for the remaining six months.

    curl https://api.stripe.com/v1/subscription_schedules \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -d customer=cus_GBHHxuvBvO26Ea \ -d start_date=now \ -d end_behavior=release \ -d phases[0][plans][0][plan]=plan_print \ -d phases[0][plans][0][quantity]=1 \ -d phases[0][iterations]=6 \ -d phases[0][coupon]=co_50_percent_off \ -d phases[1][plans][0][plan]=plan_print \ -d phases[1][plans][0][quantity]=1 \ -d phases[1][iterations]=6
    # Set your secret key: remember to change this to your live secret key in production # See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' Stripe::SubscriptionSchedule.create({ customer: 'cus_GBXUtjZo0nHBmW', start_date: 'now', end_behavior: 'release', phases: [ { plans: [ {plan: 'plan_print', quantity: 1}, ], iterations: 6, coupon: 'co_50_percent_off', }, { plans: [ {plan: 'plan_print', quantity: 1}, ], iterations: 6, }, ], })
    # Set your secret key: remember to change this to your live secret key in production # See your keys here: https://dashboard.stripe.com/account/apikeys stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' stripe.SubscriptionSchedule.create( customer='cus_GBXV9Q95NFT80k', start_date='now', end_behavior='release', phases=[ { 'plans': [ {'plan': 'plan_print', 'quantity': 1}, ], 'iterations': 6, 'coupon': 'co_50_percent_off', }, { 'plans': [ {'plan': 'plan_digital', 'quantity': 1}, ], 'iterations': 6, }, ], )
    // Set your secret key: remember to change this to your live secret key in production // See your keys here: https://dashboard.stripe.com/account/apikeys \Stripe\Stripe::setApiKey('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); StripeSubscriptionSchedule::create([ 'customer' => 'cus_GBXVvM3Lyqlb92', 'start_date' => 'now', 'end_behavior' => 'release', 'phases' => [ [ 'plans' => [ [ 'plan' => 'plan_print', 'quantity' => 1, ], ], 'iterations' => 6, 'coupon' => 'co_50_percent_off', ], [ 'plans' => [ [ 'plan' => 'plan_digital', 'quantity' => 1, ], ], 'iterations' => 6, ] ], ]);
    // Set your secret key: remember to change this to your live secret key in production // See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.apiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; List<Object> phases = new ArrayList<>(); List<Object> plans1 = new ArrayList<>(); Map<String, Object> plan1 = new HashMap<>(); plan1.put("plan", "plan_print"); plan1.put("quantity", 1); plans1.add(plan1); Map<String, Object> phase1 = new HashMap<>(); phase1.put("plans", plans); phase1.put("iterations", 6); phase1.put("coupon", "co_50_percent_off"); phases.add(phase1); List<Object> plans2 = new ArrayList<>(); Map<String, Object> plan2 = new HashMap<>(); plan2.put("plan", "plan_print"); plan2.put("quantity", 1); plans2.add(plan2); Map<String, Object> phase2 = new HashMap<>(); phase2.put("plans", plans); phase2.put("iterations", 6); phases.add(phase2); Map<String, Object> params = new HashMap<>(); params.put("customer", "cus_GBXVzJZPdLuVU7"); params.put("start_date", "now"); params.put("end_behavior", "release"); params.put("phases", phases); SubscriptionSchedule subscriptionSchedule = SubscriptionSchedule.create(params);
    // Set your secret key: remember to change this to your live secret key in production // See your keys here: https://dashboard.stripe.com/account/apikeys const stripe = require('stripe')('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); stripe.subscriptionSchedules.create( { customer: 'cus_G8BQyXLV4wIrlu', start_date: 'now', end_behavior: 'release', phases: [ { plans: [{ plan: 'plan_print', quantity: 1 }], iterations: 6, coupon: 'co_50_percent_off', }, { plans: [{ plan: 'plan_print', quantity: 1 }], iterations: 6, }, ], }, function(err, subscriptionSchedule) { // asynchronously called } );
    // Set your secret key: remember to change this to your live secret key in production // See your keys here: https://dashboard.stripe.com/account/apikeys stripe.Key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc" params := &stripe.SubscriptionScheduleParams{ Customer: stripe.String("cus_G8BQyXLV4wIrlu"), StartDateNow: stripe.Bool(true), EndBehavior: stripe.String(string(stripe.SubscriptionScheduleEndBehaviorRelease)), Phases: []*stripe.SubscriptionSchedulePhaseParams{ { Plans: []*stripe.SubscriptionSchedulePhaseItemParams{ { Plan: stripe.String("plan_print"), Quantity: stripe.Int64(1), }, Coupon: stripe.String('co_50_percent_off'), }, Iterations: stripe.Int64(6), }, { Plans: []*stripe.SubscriptionSchedulePhaseItemParams{ { Plan: stripe.String("plan_print"), Quantity: stripe.Int64(1), }, }, Iterations: stripe.Int64(6), }, }, } schedule, _ := subschedule.New(params)
    // Set your secret key: remember to change this to your live secret key in production // See your keys here: https://dashboard.stripe.com/account/apikeys StripeConfiguration.ApiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; var options = new SubscriptionScheduleCreateOptions { Customer = "cus_GBZpSoDXILjq1a", StartDate = SubscriptionScheduleStartDate.Now, EndBehavior = "release", Phases = new List<SubscriptionSchedulePhaseOptions> { new SubscriptionSchedulePhaseOptions { Plans = new List<SubscriptionSchedulePhaseItemOptions> { new SubscriptionSchedulePhaseItemOptions { Plan = "plan_print", Quantity = 1, }, }, Iterations = 6, Coupon = "co_50_percent_off", }, new SubscriptionSchedulePhaseOptions { Plans = new List<SubscriptionSchedulePhaseItemOptions> { new SubscriptionSchedulePhaseItemOptions { Plan = "plan_print", Quantity = 1, }, }, Iterations = 6, }, }, }; var service = new SubscriptionScheduleService(); service.Create(options);

    Changing tax rates

    The Pacific operates in several jurisdictions and some of them have unique tax rates for subscription based businesses. One of these jurisdictions requires two tax rates: one for the first month when a customer initially subscribes, and one for recurring billings.

    curl https://api.stripe.com/v1/subscription_schedules \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -d customer=cus_GBHHxuvBvO26Ea \ -d start_date=now \ -d end_behavior=release \ -d phases[0][plans][0][plan]=digital \ -d phases[0][plans][0][quantity]=1 \ -d phases[0][plans][0][tax_rates][0]=txr_2J8lmBBGHJYyuUJqF6QJtaAA \ -d phases[0][iterations]=1 \ -d phases[1][plans][0][plan]=digital \ -d phases[1][plans][0][quantity]=1 \ -d phases[1][plans][0][tax_rates][0]=txr_2J8lmBBGHJYyuUJqF6QJtaAA \ -d phases[1][iterations]=11
    # Set your secret key: remember to change this to your live secret key in production # See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' Stripe::SubscriptionSchedule.create({ customer: 'cus_GBXUtjZo0nHBmW', start_date: 'now', end_behavior: 'release', phases: [ { plans: [ {plan: 'plan_digital', quantity: 1, tax_rates: ['txr_2J8lmBBGHJYyuUJqF6QJtaAA']}, ], iterations: 1, }, { plans: [ {plan: 'plan_digital', quantity: 1, tax_rates: ['txr_2J8lmBBGHJYyuUJqF6QJtbBB']}, ], iterations: 11, }, ], })
    # Set your secret key: remember to change this to your live secret key in production # See your keys here: https://dashboard.stripe.com/account/apikeys stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' stripe.SubscriptionSchedule.create( customer='cus_GBXV9Q95NFT80k', start_date='now', end_behavior='release', phases=[ { 'plans': [ {'plan': 'plan_print', 'quantity': 1, 'tax_rates': ['txr_2J8lmBBGHJYyuUJqF6QJtaAA']}, ], 'iterations': 1, }, { 'plans': [ {'plan': 'plan_digital', 'quantity': 1, 'tax_rates': ['txr_2J8lmBBGHJYyuUJqF6QJtbBB']}, ], 'iterations': 11, }, ], )
    // Set your secret key: remember to change this to your live secret key in production // See your keys here: https://dashboard.stripe.com/account/apikeys \Stripe\Stripe::setApiKey('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); StripeSubscriptionSchedule::create([ 'customer' => 'cus_GBXVvM3Lyqlb92', 'start_date' => 'now', 'end_behavior' => 'release', 'phases' => [ [ 'plans' => [ [ 'plan' => 'plan_digital', 'quantity' => 1, 'tax_rates' => [ 'txr_2J8lmBBGHJYyuUJqF6QJtaAA', ], ], ], 'iterations' => 1, ], [ 'plans' => [ [ 'plan' => 'plan_digital', 'quantity' => 1, 'tax_rates' => [ 'txr_2J8lmBBGHJYyuUJqF6QJtbBB', ], ], ], 'iterations' => 11, ], ], ]);
    // Set your secret key: remember to change this to your live secret key in production // See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.apiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; List<Object> phases = new ArrayList<>(); List<Object> plans1 = new ArrayList<>(); Map<String, Object> plan1 = new HashMap<>(); plan1.put("plan", "plan_digital"); plan1.put("quantity", 1); List<Object> taxRates1 = new ArrayList<>(); taxRates1.add("txr_2J8lmBBGHJYyuUJqF6QJtaAA"); plan1.put("tax_rates", taxRates1); plans1.add(plan1); Map<String, Object> phase1 = new HashMap<>(); phase1.put("plans", plans1); phase1.put("iterations", 1); phases.add(phase1); List<Object> plans2 = new ArrayList<>(); Map<String, Object> plan2 = new HashMap<>(); plan2.put("plan", "plan_digital"); plan2.put("quantity", 1); List<Object> taxRates2 = new ArrayList<>(); taxRates2.add("txr_2J8lmBBGHJYyuUJqF6QJtbBB"); plan2.put("tax_rates", taxRates2); plans2.add(plan2); Map<String, Object> phase2 = new HashMap<>(); phase2.put("plans", plans2); phase2.put("iterations", 11); phases.add(phase2); Map<String, Object> params = new HashMap<>(); params.put("customer", "cus_GBXVzJZPdLuVU7"); params.put("start_date", "now"); params.put("end_behavior", "release"); params.put("phases", phases); SubscriptionSchedule subscriptionSchedule = SubscriptionSchedule.create(params);
    // Set your secret key: remember to change this to your live secret key in production // See your keys here: https://dashboard.stripe.com/account/apikeys const stripe = require('stripe')('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); stripe.subscriptionSchedules.create( { customer: 'cus_G8BQyXLV4wIrlu', start_date: 'now', end_behavior: 'release', phases: [ { plans: [{ plan: 'plan_digital', quantity: 1, tax_rates: ['txr_2J8lmBBGHJYyuUJqF6QJtaAA'] }], iterations: 1, }, { plans: [{ plan: 'plan_digital', quantity: 1, tax_rates: ['txr_1F6kmAAJVYItwOKqV9IWebBB'] }], iterations: 11, }, ], }, function(err, subscriptionSchedule) { // asynchronously called } );
    // Set your secret key: remember to change this to your live secret key in production // See your keys here: https://dashboard.stripe.com/account/apikeys stripe.Key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc" params := &stripe.SubscriptionScheduleParams{ Customer: stripe.String("cus_G8BQyXLV4wIrlu"), StartDateNow: stripe.Bool(true), EndBehavior: stripe.String(string(stripe.SubscriptionScheduleEndBehaviorRelease)), Phases: []*stripe.SubscriptionSchedulePhaseParams{ { Plans: []*stripe.SubscriptionSchedulePhaseItemParams{ { Plan: stripe.String("plan_digital"), Quantity: stripe.Int64(1), TaxRates: []*string{ stripe.String("txr_2J8lmBBGHJYyuUJqF6QJtaAA"), }, }, }, Iterations: stripe.Int64(1), }, { Plans: []*stripe.SubscriptionSchedulePhaseItemParams{ { Plan: stripe.String("plan_digital"), Quantity: stripe.Int64(2), TaxRates: []*string{ stripe.String("txr_1F6kmAAJVYItwOKqV9IWebBB"), }, }, }, Iterations: stripe.Int64(11), }, }, } schedule, _ := subschedule.New(params)
    // Set your secret key: remember to change this to your live secret key in production // See your keys here: https://dashboard.stripe.com/account/apikeys StripeConfiguration.ApiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; var options = new SubscriptionScheduleCreateOptions { Customer = "cus_GBZpSoDXILjq1a", StartDate = SubscriptionScheduleStartDate.Now, EndBehavior = "release", Phases = new List<SubscriptionSchedulePhaseOptions> { new SubscriptionSchedulePhaseOptions { Plans = new List<SubscriptionSchedulePhaseItemOptions> { new SubscriptionSchedulePhaseItemOptions { Plan = "plan_print", Quantity = 1, TaxRates = new List<string> { "txr_2J8lmBBGHJYyuUJqF6QJtaAA", }, }, }, Iterations = 1, }, new SubscriptionSchedulePhaseOptions { Plans = new List<SubscriptionSchedulePhaseItemOptions> { new SubscriptionSchedulePhaseItemOptions { Plan = "plan_digital", Quantity = 1, TaxRates = new List<string> { "txr_2J8lmBBGHJYyuUJqF6QJtbBB", }, }, }, Iterations = 11, }, }, }; var service = new SubscriptionScheduleService(); service.Create(options);

    Releasing a subscription from a schedule

    You can release a subscription from a schedule as long as the schedule’s status is not_started or active. Releasing leaves the subscription in place, removing the schedule and any remaining phases.

    curl https://api.stripe.com/v1/subscription_schedules/sub_sched_1FdsKnBF6ERF9jhEWilacWsB/release \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc:
    # Set your secret key: remember to change this to your live secret key in production # See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' Stripe::SubscriptionSchedule.release('sub_sched_1FdsKnBF6ERF9jhEWilacWsB')
    # Set your secret key: remember to change this to your live secret key in production # See your keys here: https://dashboard.stripe.com/account/apikeys stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' stripe.SubscriptionSchedule.release('sub_sched_1FdsKnBF6ERF9jhEWilacWsB')
    // Set your secret key: remember to change this to your live secret key in production // See your keys here: https://dashboard.stripe.com/account/apikeys \Stripe\Stripe::setApiKey('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); $schedule = StripeSubscriptionSchedule::retrieve('sub_sched_1FdsKnBF6ERF9jhEWilacWsB'); $schedule->release();
    // Set your secret key: remember to change this to your live secret key in production // See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.apiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; SubscriptionSchedule schedule = SubscriptionSchedule.retrieve("sub_sched_1FdsKnBF6ERF9jhEWilacWsB"); schedule = subscriptionSchedule.release();
    // Set your secret key: remember to change this to your live secret key in production // See your keys here: https://dashboard.stripe.com/account/apikeys const stripe = require('stripe')('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); stripe.subscriptionSchedules.release( 'sub_sched_1FdsKnBF6ERF9jhEWilacWsB', function(err, subscriptionSchedule) { // asynchronously called } );
    // Set your secret key: remember to change this to your live secret key in production // See your keys here: https://dashboard.stripe.com/account/apikeys const stripe = require('stripe')('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); schedule, _ := subscriptionschedule.Release("sub_sched_1FdsKnBF6ERF9jhEWilacWsB", nil)
    // Set your secret key: remember to change this to your live secret key in production // See your keys here: https://dashboard.stripe.com/account/apikeys StripeConfiguration.ApiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; var service = new SubscriptionScheduleService(); service.Release("sub_sched_1FdsKnBF6ERF9jhEWilacWsB");

    Was this page helpful?

    Thank you for helping improve Stripe's documentation. If you need help or have any questions, please consider contacting support.

    On this page