Billing examples

    This page explores some common billing use cases and demonstrates how to model them with products and plans. The following examples follow a fictional company, SqueakyCar, that’s offering a car wash service. Washers come to the customer’s home to wash their cars.

    Simple monthly billing

    Many businesses begin with a simple monthly rate or “per-seat” pricing. This is modeled by specifying the amount on a Plan. Specify a quantity when creating a subscription to charge for multiple seats or licenses.

    SqueakyCar’s new car wash service charges $20 per car each month. First, they create a Product to describe what they’re selling—in this case, a weekly car washing service:

    curl https://api.stripe.com/v1/products \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -d name="Weekly Car Wash Service" \ -d type=service
    # Set your secret key. Remember to switch to your live secret key in production! # See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' Stripe::Product.create({ name: 'Weekly Car Wash Service', type: 'service', })
    # Set your secret key. Remember to switch to your live secret key in production! # See your keys here: https://dashboard.stripe.com/account/apikeys stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' stripe.Product.create( name='Weekly Car Wash Service', type='service', )
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys \Stripe\Stripe::setApiKey('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); \Stripe\Product::create([ 'name' => 'Weekly Car Wash Service', 'type' => 'service', ]);
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.apiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; ProductCreateParams params = ProductCreateParams.builder() .setName("Weekly Car Wash Service") .setType(ProductCreateParams.Type.SERVICE) .build(); Product product = Product.create(params);
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys const stripe = require('stripe')('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); const product = await stripe.products.create({ name: 'Weekly Car Wash Service', type: 'service', });
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys stripe.Key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc" params := &stripe.ProductParams{ Name: stripe.String("Weekly Car Wash Service"), Type: stripe.String(string(stripe.ProductTypeService)), } p, _ := product.New(params)
    // Set your secret key. Remember to switch 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 ProductCreateOptions { Name = "Weekly Car Wash Service", Type = "service", }; var service = new ProductService(); var product = service.Create(options);

    Next, they add a plan to the product. The following example shows how to add a plan that bills $20 USD per month:

    curl https://api.stripe.com/v1/plans \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -d nickname="Standard Monthly" \ -d product="{{CAR_WASH_PRODUCT_ID}}" \ -d amount=2000 \ -d currency=usd \ -d interval=month \ -d usage_type=licensed
    # Set your secret key. Remember to switch to your live secret key in production! # See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' Stripe::Plan.create({ nickname: 'Standard Monthly', product: '{{CAR_WASH_PRODUCT_ID}}', amount: 2000, currency: 'usd', interval: 'month', usage_type: 'licensed', })
    # Set your secret key. Remember to switch to your live secret key in production! # See your keys here: https://dashboard.stripe.com/account/apikeys stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' stripe.Plan.create( nickname='Standard Monthly', product='{{CAR_WASH_PRODUCT_ID}}', amount=2000, currency='usd', interval='month', usage_type='licensed', )
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys \Stripe\Stripe::setApiKey('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); \Stripe\Plan::create([ 'nickname' => 'Standard Monthly', 'product' => '{{CAR_WASH_PRODUCT_ID}}', 'amount' => 2000, 'currency' => 'usd', 'interval' => 'month', 'usage_type' => 'licensed', ]);
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.apiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; PlanCreateParams params = PlanCreateParams.builder() .setNickname("Standard Monthly") .setProduct("{{CAR_WASH_PRODUCT_ID}}") .setAmount(2000L) .setCurrency("usd") .setInterval(PlanCreateParams.Interval.MONTH) .setUsageType(PlanCreateParams.UsageType.LICENSED) .build(); Plan plan = Plan.create(params);
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys const stripe = require('stripe')('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); const plan = await stripe.plans.create({ nickname: 'Standard Monthly', product: '{{CAR_WASH_PRODUCT_ID}}', amount: 2000, currency: 'usd', interval: 'month', usage_type: 'LICENSED', });
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys stripe.Key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc" params := &stripe.PlanParams{ Nickname: stripe.String("Standard Monthly"), ProductID: stripe.String("{{CAR_WASH_PRODUCT_ID}}"), Amount: stripe.Int64(2000), Currency: stripe.String(string(stripe.CurrencyUSD)), Interval: stripe.String(string(stripe.PlanIntervalMonth)), UsageType: stripe.String(string(stripe.PlanUsageTypeLicensed)), } pl, _ := plan.New(params)
    // Set your secret key. Remember to switch 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 PlanCreateOptions { Nickname = "Standard Monthly", Product = "{{CAR_WASH_PRODUCT_ID}}", Amount = 2000, Currency = "usd", Interval = "month", UsageType = "licensed", }; var service = new PlanService(); var plan = service.Create(options);

    This example demonstrates how to create a subscription to SqueakyCar’s service for a customer with two cars, specifying plan and quantity:

    curl https://api.stripe.com/v1/subscriptions \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -d customer="{{CUSTOMER_ID}}" \ -d "items[0][plan]"="{{STANDARD_MONTHLY_USD_PLAN_ID}}" \ -d "items[0][quantity]"=2
    # Set your secret key. Remember to switch to your live secret key in production! # See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' Stripe::Subscription.create({ customer: '{{CUSTOMER_ID}}', items: [ { plan: '{{STANDARD_MONTHLY_USD_PLAN_ID}}', quantity: 2, }, ], })
    # Set your secret key. Remember to switch to your live secret key in production! # See your keys here: https://dashboard.stripe.com/account/apikeys stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' stripe.Subscription.create( customer='{{CUSTOMER_ID}}', items=[ { 'plan': '{{STANDARD_MONTHLY_USD_PLAN_ID}}', 'quantity': 2, }, ] )
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys \Stripe\Stripe::setApiKey('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); \Stripe\Subscription::create([ 'customer' => '{{CUSTOMER_ID}}', 'items' => [ [ 'plan' => '{{STANDARD_MONTHLY_USD_PLAN_ID}}', 'quantity' => 2, ], ], ]);
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.apiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; SubscriptionCreateParams params = SubscriptionCreateParams.builder() .setCustomer("{{CUSTOMER_ID}}") .addItem( SubscriptionCreateParams.Item.builder() .setPlan("{{STANDARD_MONTHLY_USD_PLAN_ID}}") .setQuantity(2L) .build()) .build(); Subscription subscription = Subscription.create(params);
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys const stripe = require('stripe')('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); const subscription = await stripe.subscriptions.create({ customer: '{{CUSTOMER_ID}}', items: [ { plan: '{{STANDARD_MONTHLY_USD_PLAN_ID}}', quantity: 2, }, ], });
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys stripe.Key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc" params := &stripe.SubscriptionParams{ Customer: stripe.String("{{CUSTOMER_ID}}"), Items: []*stripe.SubscriptionItemsParams{ { Plan: stripe.String("{{STANDARD_MONTHLY_USD_PLAN_ID}}"), Quantity: stripe.Int64(2), }, }, } s, _ := sub.New(params)
    // Set your secret key. Remember to switch 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 SubscriptionCreateOptions { Customer = "{{CUSTOMER_ID}}", Items = new List<SubscriptionItemOptions> { new SubscriptionItemOptions { Plan = "{{STANDARD_MONTHLY_USD_PLAN_ID}}", Quantity = 2, }, }, }; var service = new SubscriptionService(); var subscription = service.Create(options);

    Varying pricing

    Products can use multiple plans to define different pricing options. The product description is shared between plans and appears the same on the customer’s receipt and invoice—only the pricing differs based on the plan.

    As SqueakyCar’s product matures, they begin offering the same product at different price points. Specifically, certain customers are willing to pay for discounted up-front quarterly and yearly subscriptions. SqueakyCar creates a quarterly $57 plan:

    curl https://api.stripe.com/v1/plans \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -d nickname="Standard Quarterly" \ -d product="{{CAR_WASH_PRODUCT_ID}}" \ -d amount=5700 \ -d currency=usd \ -d interval=month \ -d interval_count=3 \ -d usage_type=licensed
    # Set your secret key. Remember to switch to your live secret key in production! # See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' Stripe::Plan.create({ nickname: 'Standard Quarterly', product: '{{CAR_WASH_PRODUCT_ID}}', amount: 5700, currency: 'usd', interval: 'month', interval_count: 3, usage_type: 'licensed', })
    # Set your secret key. Remember to switch to your live secret key in production! # See your keys here: https://dashboard.stripe.com/account/apikeys stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' stripe.Plan.create( nickname='Standard Quarterly', product='{{CAR_WASH_PRODUCT_ID}}', amount=5700, currency='usd', interval='month', interval_count=3, usage_type='licensed', )
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys \Stripe\Stripe::setApiKey('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); \Stripe\Plan::create([ 'nickname' => 'Standard Quarterly', 'product' => '{{CAR_WASH_PRODUCT_ID}}', 'amount' => 5700, 'currency' => 'usd', 'interval' => 'month', 'interval_count' => 3, 'usage_type' => 'licensed', ]);
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.apiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; PlanCreateParams params = PlanCreateParams.builder() .setNickname("Standard Quarterly") .setProduct("{{CAR_WASH_PRODUCT_ID}}") .setAmount(5700L) .setCurrency("usd") .setInterval(PlanCreateParams.Interval.MONTH) .setIntervalCount(3L), .setUsageType(PlanCreateParams.UsageType.LICENSED) .build(); Plan plan = Plan.create(params);
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys const stripe = require('stripe')('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); const plan = await stripe.plans.create({ nickname: 'Standard Quarterly', product: '{{CAR_WASH_PRODUCT_ID}}', amount: 5700, currency: 'usd', interval: 'month', interval_count: 3, usage_type: 'LICENSED', });
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys stripe.Key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc" params := &stripe.PlanParams{ Nickname: stripe.String("Standard Quarterly"), ProductID: stripe.String("{{CAR_WASH_PRODUCT_ID}}"), Amount: stripe.Int64(5700), Currency: stripe.String(string(stripe.CurrencyUSD)), Interval: stripe.String(string(stripe.PlanIntervalMonth)), IntervalCount: stripe.Int64(3), UsageType: stripe.String(string(stripe.PlanUsageTypeLicensed)), } pl, _ := plan.New(params)
    // Set your secret key. Remember to switch 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 PlanCreateOptions { Nickname = "Standard Quarterly", Product = "{{CAR_WASH_PRODUCT_ID}}", Amount = 5700, Currency = "usd", Interval = "month", IntervalCount = 3, UsageType = "licensed", }; var service = new PlanService(); var plan = service.Create(options);

    And a yearly $220 plan:

    curl https://api.stripe.com/v1/plans \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -d nickname="Standard Yearly" \ -d product="{{CAR_WASH_PRODUCT_ID}}" \ -d amount=22000 \ -d currency=usd \ -d interval=year \ -d usage_type=licensed
    # Set your secret key. Remember to switch to your live secret key in production! # See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' Stripe::Plan.create({ nickname: 'Standard Yearly', product: '{{CAR_WASH_PRODUCT_ID}}', amount: 22000, currency: 'usd', interval: 'year', usage_type: 'licensed', })
    # Set your secret key. Remember to switch to your live secret key in production! # See your keys here: https://dashboard.stripe.com/account/apikeys stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' stripe.Plan.create( nickname='Standard Yearly', product='{{CAR_WASH_PRODUCT_ID}}', amount=22000, currency='usd', interval='year', usage_type='licensed', )
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys \Stripe\Stripe::setApiKey('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); \Stripe\Plan::create([ 'nickname' => 'Standard Yearly', 'product' => '{{CAR_WASH_PRODUCT_ID}}', 'amount' => 22000, 'currency' => 'usd', 'interval' => 'year', 'usage_type' => 'licensed', ]);
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.apiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; PlanCreateParams params = PlanCreateParams.builder() .setNickname("Standard Yearly") .setProduct("{{CAR_WASH_PRODUCT_ID}}") .setAmount(22000L) .setCurrency("usd") .setInterval(PlanCreateParams.Interval.YEAR) .setUsageType(PlanCreateParams.UsageType.LICENSED) .build(); Plan plan = Plan.create(params);
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys const stripe = require('stripe')('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); const plan = await stripe.plans.create({ nickname: 'Standard Yearly', product: '{{CAR_WASH_PRODUCT_ID}}', amount: 22000, currency: 'usd', interval: 'year', usage_type: 'LICENSED', });
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys stripe.Key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc" params := &stripe.PlanParams{ Nickname: stripe.String("Standard Yearly"), ProductID: stripe.String("{{CAR_WASH_PRODUCT_ID}}"), Amount: stripe.Int64(22000), Currency: stripe.String(string(stripe.CurrencyUSD)), Interval: stripe.String(string(stripe.PlanIntervalYear)), UsageType: stripe.String(string(stripe.PlanUsageTypeLicensed)), } pl, _ := plan.New(params)
    // Set your secret key. Remember to switch 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 PlanCreateOptions { Nickname = "Standard Yearly", Product = "{{CAR_WASH_PRODUCT_ID}}", Amount = 22000, Currency = "usd", Interval = "month", UsageType = "licensed", }; var service = new PlanService(); var plan = service.Create(options);

    As SqueakyCar expands to different markets, such as Canada, they can add pricing plans in different currencies:

    curl https://api.stripe.com/v1/plans \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -d nickname="Canadian Monthly" \ -d product="{{CAR_WASH_PRODUCT_ID}}" \ -d amount=3500 \ -d currency=cad \ -d interval=month \ -d usage_type=licensed
    # Set your secret key. Remember to switch to your live secret key in production! # See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' Stripe::Plan.create({ nickname: 'Canadian Monthly', product: '{{CAR_WASH_PRODUCT_ID}}', amount: 3500, currency: 'cad', interval: 'month', usage_type: 'licensed', })
    # Set your secret key. Remember to switch to your live secret key in production! # See your keys here: https://dashboard.stripe.com/account/apikeys stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' stripe.Plan.create( nickname='Canadian Monthly', product='{{CAR_WASH_PRODUCT_ID}}', amount=3500, currency='cad', interval='month', usage_type='licensed', )
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys \Stripe\Stripe::setApiKey('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); \Stripe\Plan::create([ 'nickname' => 'Canadian Monthly', 'product' => '{{CAR_WASH_PRODUCT_ID}}', 'amount' => 3500, 'currency' => 'cad', 'interval' => 'month', 'usage_type' => 'licensed', ]);
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.apiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; PlanCreateParams params = PlanCreateParams.builder() .setNickname("Canadian Monthly") .setProduct("{{CAR_WASH_PRODUCT_ID}}") .setAmount(3500L) .setCurrency("cad") .setInterval(PlanCreateParams.Interval.MONTH) .setUsageType(PlanCreateParams.UsageType.LICENSED) .build(); Plan plan = Plan.create(params);
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys const stripe = require('stripe')('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); const plan = await stripe.plans.create({ nickname: 'Canadian Monthly', product: '{{CAR_WASH_PRODUCT_ID}}', amount: 3500, currency: 'cad', interval: 'month', usage_type: 'LICENSED', });
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys stripe.Key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc" params := &stripe.PlanParams{ Nickname: stripe.String("Canadian Monthly"), ProductID: stripe.String("{{CAR_WASH_PRODUCT_ID}}"), Amount: stripe.Int64(3500), Currency: stripe.String(string(stripe.CurrencyCAD)), Interval: stripe.String(string(stripe.PlanIntervalMonth)), UsageType: stripe.String(string(stripe.PlanUsageTypeLicensed)), } pl, _ := plan.New(params)
    // Set your secret key. Remember to switch 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 PlanCreateOptions { Nickname = "Canadian Monthly", Product = "{{CAR_WASH_PRODUCT_ID}}", Amount = 3500, Currency = "cad", Interval = "month", UsageType = "licensed", }; var service = new PlanService(); var plan = service.Create(options);

    And the UK:

    curl https://api.stripe.com/v1/plans \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -d nickname="UK Monthly" \ -d product="{{CAR_WASH_PRODUCT_ID}}" \ -d amount=1800 \ -d currency=gbp \ -d interval=month \ -d usage_type=licensed
    # Set your secret key. Remember to switch to your live secret key in production! # See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' Stripe::Plan.create({ nickname: 'UK Monthly', product: '{{CAR_WASH_PRODUCT_ID}}', amount: 1800, currency: 'gbp', interval: 'month', usage_type: 'licensed', })
    # Set your secret key. Remember to switch to your live secret key in production! # See your keys here: https://dashboard.stripe.com/account/apikeys stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' stripe.Plan.create( nickname='UK Monthly', product='{{CAR_WASH_PRODUCT_ID}}', amount=1800, currency='gbp', interval='month', usage_type='licensed', )
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys \Stripe\Stripe::setApiKey('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); \Stripe\Plan::create([ 'nickname' => 'UK Monthly', 'product' => '{{CAR_WASH_PRODUCT_ID}}', 'amount' => 1800, 'currency' => 'gbp', 'interval' => 'month', 'usage_type' => 'licensed', ]);
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.apiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; PlanCreateParams params = PlanCreateParams.builder() .setNickname("UK Monthly") .setProduct("{{CAR_WASH_PRODUCT_ID}}") .setAmount(1800L) .setCurrency("gbp") .setInterval(PlanCreateParams.Interval.MONTH) .setUsageType(PlanCreateParams.UsageType.LICENSED) .build(); Plan plan = Plan.create(params);
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys const stripe = require('stripe')('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); const plan = await stripe.plans.create({ nickname: 'UK Monthly', product: '{{CAR_WASH_PRODUCT_ID}}', amount: 1800, currency: 'gbp', interval: 'month', usage_type: 'LICENSED', });
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys stripe.Key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc" params := &stripe.PlanParams{ Nickname: stripe.String("UK Monthly"), ProductID: stripe.String("{{CAR_WASH_PRODUCT_ID}}"), Amount: stripe.Int64(1800), Currency: stripe.String(string(stripe.CurrencyGBP)), Interval: stripe.String(string(stripe.PlanIntervalMonth)), UsageType: stripe.String(string(stripe.PlanUsageTypeLicensed)), } pl, _ := plan.New(params)
    // Set your secret key. Remember to switch 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 PlanCreateOptions { Nickname = "UK Monthly", Product = "{{CAR_WASH_PRODUCT_ID}}", Amount = 1800, Currency = "gbp", Interval = "month", UsageType = "licensed", }; var service = new PlanService(); var plan = service.Create(options);

    Flat fee

    You can subscribe the customer to two separate products to model a pricing structure that includes both a base fee and additional per-seat pricing. One product serves as the flat base price and the other product represents the variable per-seat pricing.

    SqueakyCar has seen a boom in multi-car households, so they are changing their pricing to introduce a new base fee that they will charge their customers alongside the per-car monthly fee. They create a Product and Plan for the base fee:

    curl https://api.stripe.com/v1/plans \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -d nickname="Monthly Base Fee" \ -d product="{{BASE_FEE_PRODUCT_ID}" \ -d amount=500 \ -d currency=usd \ -d interval=month \ -d usage_type=licensed
    # Set your secret key. Remember to switch to your live secret key in production! # See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' Stripe::Plan.create({ nickname: 'Monthly Base Fee', product: '{{BASE_FEE_PRODUCT_ID}', amount: 500, currency: 'usd', interval: 'month', usage_type: 'licensed', })
    # Set your secret key. Remember to switch to your live secret key in production! # See your keys here: https://dashboard.stripe.com/account/apikeys stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' stripe.Plan.create( nickname='Monthly Base Fee', product='{{BASE_FEE_PRODUCT_ID}', amount=500, currency='usd', interval='month', usage_type='licensed', )
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys \Stripe\Stripe::setApiKey('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); \Stripe\Plan::create([ 'nickname' => 'Monthly Base Fee', 'product' => '{{BASE_FEE_PRODUCT_ID}', 'amount' => 500, 'currency' => 'usd', 'interval' => 'month', 'usage_type' => 'licensed', ]);
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.apiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; PlanCreateParams params = PlanCreateParams.builder() .setNickname("Monthly Base Fee") .setProduct("{{BASE_FEE_PRODUCT_ID}") .setAmount(500L) .setCurrency("usd") .setInterval(PlanCreateParams.Interval.MONTH) .setUsageType(PlanCreateParams.UsageType.LICENSED) .build(); Plan plan = Plan.create(params);
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys const stripe = require('stripe')('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); const plan = await stripe.plans.create({ nickname: 'Monthly Base Fee', product: '{{BASE_FEE_PRODUCT_ID}', amount: 500, currency: 'usd', interval: 'month', usage_type: 'LICENSED', });
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys stripe.Key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc" params := &stripe.PlanParams{ Nickname: stripe.String("Monthly Base Fee"), ProductID: stripe.String("{{BASE_FEE_PRODUCT_ID}"), Amount: stripe.Int64(500), Currency: stripe.String(string(stripe.CurrencyUSD)), Interval: stripe.String(string(stripe.PlanIntervalMonth)), UsageType: stripe.String(string(stripe.PlanUsageTypeLicensed)), } pl, _ := plan.New(params)
    // Set your secret key. Remember to switch 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 PlanCreateOptions { Nickname = "Monthly Base Fee", Product = "{{BASE_FEE_PRODUCT_ID}", Amount = 500, Currency = "usd", Interval = "month", UsageType = "licensed", }; var service = new PlanService(); var plan = service.Create(options);

    And a monthly plan that charges $15 per car:

    curl https://api.stripe.com/v1/plans \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -d nickname="Per Car Monthly" \ -d product="{{CAR_WASH_PRODUCT_ID}}" \ -d amount=1500 \ -d currency=usd \ -d interval=month \ -d usage_type=licensed
    # Set your secret key. Remember to switch to your live secret key in production! # See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' Stripe::Plan.create({ nickname: 'Per Car Monthly', product: '{{CAR_WASH_PRODUCT_ID}}', amount: 1500, currency: 'usd', interval: 'month', usage_type: 'licensed', })
    # Set your secret key. Remember to switch to your live secret key in production! # See your keys here: https://dashboard.stripe.com/account/apikeys stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' stripe.Plan.create( nickname='Per Car Monthly', product='{{CAR_WASH_PRODUCT_ID}}', amount=1500, currency='usd', interval='month', usage_type='licensed', )
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys \Stripe\Stripe::setApiKey('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); \Stripe\Plan::create([ 'nickname' => 'Per Car Monthly', 'product' => '{{CAR_WASH_PRODUCT_ID}}', 'amount' => 1500, 'currency' => 'usd', 'interval' => 'month', 'usage_type' => 'licensed', ]);
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.apiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; PlanCreateParams params = PlanCreateParams.builder() .setNickname("Per Car Monthly") .setProduct("{{CAR_WASH_PRODUCT_ID}}") .setAmount(1500L) .setCurrency("usd") .setInterval(PlanCreateParams.Interval.MONTH) .setUsageType(PlanCreateParams.UsageType.LICENSED) .build(); Plan plan = Plan.create(params);
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys const stripe = require('stripe')('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); const plan = await stripe.plans.create({ nickname: 'Per Car Monthly', product: '{{CAR_WASH_PRODUCT_ID}}', amount: 1500, currency: 'usd', interval: 'month', usage_type: 'LICENSED', });
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys stripe.Key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc" params := &stripe.PlanParams{ Nickname: stripe.String("Per Car Monthly"), ProductID: stripe.String("{{CAR_WASH_PRODUCT_ID}}"), Amount: stripe.Int64(1500), Currency: stripe.String(string(stripe.CurrencyUSD)), Interval: stripe.String(string(stripe.PlanIntervalMonth)), UsageType: stripe.String(string(stripe.PlanUsageTypeLicensed)), } pl, _ := plan.New(params)
    // Set your secret key. Remember to switch 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 PlanCreateOptions { Nickname = "Per Car Monthly", Product = "{{CAR_WASH_PRODUCT_ID}}", Amount = 1500, Currency = "usd", Interval = "month", UsageType = "licensed", }; var service = new PlanService(); var plan = service.Create(options);

    The following example demonstrates how to subscribe a customer with three cars to the base fee plan and the per-car plan:

    curl https://api.stripe.com/v1/subscriptions \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -d customer="{{CUSTOMER_ID}}" \ -d "items[0][plan]"="{{BASE_FEE_PLAN_ID}}" \ -d "items[0][quantity]"=1 \ -d "items[1][plan]"="{{PER_CAR_PLAN_ID}}" \ -d "items[1][quantity]"=3
    # Set your secret key. Remember to switch to your live secret key in production! # See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' Stripe::Subscription.create({ customer: '{{CUSTOMER_ID}}', items: [ { plan: '{{BASE_FEE_PLAN_ID}}', quantity: 1, }, { plan: '{{PER_CAR_PLAN_ID}}', quantity: 3, }, ], })
    # Set your secret key. Remember to switch to your live secret key in production! # See your keys here: https://dashboard.stripe.com/account/apikeys stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' stripe.Subscription.create( customer='{{CUSTOMER_ID}}', items=[ { 'plan': '{{BASE_FEE_PLAN_ID}}', 'quantity': 1, }, { 'plan': '{{PER_CAR_PLAN_ID}}', 'quantity': 3, }, ] )
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys \Stripe\Stripe::setApiKey('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); \Stripe\Subscription::create([ 'customer' => '{{CUSTOMER_ID}}', 'items' => [ [ 'plan' => '{{BASE_FEE_PLAN_ID}}', 'quantity' => 1, ], [ 'plan' => '{{PER_CAR_PLAN_ID}}', 'quantity' => 3, ], ], ]);
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.apiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; SubscriptionCreateParams params = SubscriptionCreateParams.builder() .setCustomer("{{CUSTOMER_ID}}") .addItem( SubscriptionCreateParams.Item.builder() .setPlan("{{BASE_FEE_PLAN_ID}}") .setQuantity(1L) .build()) .addItem( SubscriptionCreateParams.Item.builder() .setPlan("{{PER_CAR_PLAN_ID}}") .setQuantity(3L) .build()) .build(); Subscription subscription = Subscription.create(params);
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys const stripe = require('stripe')('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); const subscription = await stripe.subscriptions.create({ customer: '{{CUSTOMER_ID}}', items: [ { plan: '{{BASE_FEE_PLAN_ID}}', quantity: 1, }, { plan: '{{PER_CAR_PLAN_ID}}', quantity: 3, }, ], });
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys stripe.Key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc" params := &stripe.SubscriptionParams{ Customer: stripe.String("{{CUSTOMER_ID}}"), Items: []*stripe.SubscriptionItemsParams{ { Plan: stripe.String("{{BASE_FEE_PLAN_ID}}"), Quantity: stripe.Int64(1), }, { Plan: stripe.String("{{PER_CAR_PLAN_ID}}"), Quantity: stripe.Int64(3), }, }, } s, _ := sub.New(params)
    // Set your secret key. Remember to switch 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 SubscriptionCreateOptions { Customer = "{{CUSTOMER_ID}}", Items = new List<SubscriptionItemOptions> { new SubscriptionItemOptions { Plan = "{{BASE_FEE_PLAN_ID}}", Quantity = 1, }, new SubscriptionItemOptions { Plan = "{{PER_CAR_PLAN_ID}}", Quantity = 3, }, }, }; var service = new SubscriptionService(); var subscription = service.Create(options);

    This results in a $50 charge every month: the $5 base monthly rate, plus $15 each for 3 cars.

    Usage-based pricing

    Metered billing is useful in cases where you want to charge your customers a granular amount based on their consumption of your service during the billing cycle, instead of explicitly setting quantities. For example, SqueakyCar can use metered billing to offer a service where they wash their customer’s cars as needed, and charge at the end of the month for the total number of washes.

    The following example shows how to set the value of usage_type to create a plan with metered billing. In this case, they charge $7 per car wash:

    curl https://api.stripe.com/v1/plans \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -d nickname="Metered Monthly Plan" \ -d product="{{CAR_WASH_PRODUCT_ID}}" \ -d amount=700 \ -d currency=usd \ -d interval=month \ -d usage_type=metered
    # Set your secret key. Remember to switch to your live secret key in production! # See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' Stripe::Plan.create({ nickname: 'Metered Monthly Plan', product: '{{CAR_WASH_PRODUCT_ID}}', amount: 700, currency: 'usd', interval: 'month', usage_type: 'metered', })
    # Set your secret key. Remember to switch to your live secret key in production! # See your keys here: https://dashboard.stripe.com/account/apikeys stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' stripe.Plan.create( nickname='Metered Monthly Plan', product='{{CAR_WASH_PRODUCT_ID}}', amount=700, currency='usd', interval='month', usage_type='metered', )
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys \Stripe\Stripe::setApiKey('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); \Stripe\Plan::create([ 'nickname' => 'Metered Monthly Plan', 'product' => '{{CAR_WASH_PRODUCT_ID}}', 'amount' => 700, 'currency' => 'usd', 'interval' => 'month', 'usage_type' => 'metered', ]);
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.apiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; PlanCreateParams params = PlanCreateParams.builder() .setNickname("Metered Monthly Plan") .setProduct("{{CAR_WASH_PRODUCT_ID}}") .setAmount(700L) .setCurrency("usd") .setInterval(PlanCreateParams.Interval.MONTH) .setUsageType(PlanCreateParams.UsageType.METERED) .build(); Plan plan = Plan.create(params);
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys const stripe = require('stripe')('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); const plan = await stripe.plans.create({ nickname: 'Metered Monthly Plan', product: '{{CAR_WASH_PRODUCT_ID}}', amount: 700, currency: 'usd', interval: 'month', usage_type: 'METERED', });
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys stripe.Key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc" params := &stripe.PlanParams{ Nickname: stripe.String("Metered Monthly Plan"), ProductID: stripe.String("{{CAR_WASH_PRODUCT_ID}}"), Amount: stripe.Int64(700), Currency: stripe.String(string(stripe.CurrencyUSD)), Interval: stripe.String(string(stripe.PlanIntervalMonth)), UsageType: stripe.String(string(stripe.PlanUsageTypeMetered)), } pl, _ := plan.New(params)
    // Set your secret key. Remember to switch 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 PlanCreateOptions { Nickname = "Metered Monthly Plan", Product = "{{CAR_WASH_PRODUCT_ID}}", Amount = 700, Currency = "usd", Interval = "month", UsageType = "metered", }; var service = new PlanService(); var plan = service.Create(options);

    Metered billing can also be applied in situations where the unit you are measuring is not strictly based on a sum. For example, imagine that in addition to car washing, SqueakyCar also rents out garage parking spots to their customers, and wants to charge for the maximum number of parking spots used per customer per month. SqueakyCar can configure this with the aggregate_usage parameter.

    curl https://api.stripe.com/v1/plans \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -d nickname="Monthly Parking Plan" \ -d product="{{CAR_PARKING_PRODUCT_ID}}" \ -d amount=20000 \ -d currency=usd \ -d interval=month \ -d usage_type=metered \ -d aggregate_usage=max
    # Set your secret key. Remember to switch to your live secret key in production! # See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' Stripe::Plan.create({ nickname: 'Monthly Parking Plan', product: '{{CAR_PARKING_PRODUCT_ID}}', amount: 20000, currency: 'usd', interval: 'month', usage_type: 'metered', aggregate_usage: 'max', })
    # Set your secret key. Remember to switch to your live secret key in production! # See your keys here: https://dashboard.stripe.com/account/apikeys stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' stripe.Plan.create( nickname='Monthly Parking Plan', product='{{CAR_PARKING_PRODUCT_ID}}', amount=20000, currency='usd', interval='month', usage_type='metered', aggregate_usage='max', )
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys \Stripe\Stripe::setApiKey('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); \Stripe\Plan::create([ 'nickname' => 'Monthly Parking Plan', 'product' => '{{CAR_PARKING_PRODUCT_ID}}', 'amount' => 20000, 'currency' => 'usd', 'interval' => 'month', 'usage_type' => 'metered', 'aggregate_usage' => 'max', ]);
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.apiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; PlanCreateParams params = PlanCreateParams.builder() .setNickname("Monthly Parking Plan") .setProduct("{{CAR_PARKING_PRODUCT_ID}}") .setAmount(20000L) .setCurrency("usd") .setInterval(PlanCreateParams.Interval.MONTH) .setUsageType(PlanCreateParams.UsageType.METERED) .setAggregateUsage(PlanCreateParams.AggregateUsage.MAX), .build(); Plan plan = Plan.create(params);
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys const stripe = require('stripe')('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); const plan = await stripe.plans.create({ nickname: 'Monthly Parking Plan', product: '{{CAR_PARKING_PRODUCT_ID}}', amount: 20000, currency: 'usd', interval: 'month', usage_type: 'METERED', aggregate_usage: 'MAX', });
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys stripe.Key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc" params := &stripe.PlanParams{ Nickname: stripe.String("Monthly Parking Plan"), ProductID: stripe.String("{{CAR_PARKING_PRODUCT_ID}}"), Amount: stripe.Int64(20000), Currency: stripe.String(string(stripe.CurrencyUSD)), Interval: stripe.String(string(stripe.PlanIntervalMonth)), UsageType: stripe.String(string(stripe.PlanUsageTypeMetered)), AggregateUsage: stripe.String(string(stripe.PlanAggregateUsageMax)), } pl, _ := plan.New(params)
    // Set your secret key. Remember to switch 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 PlanCreateOptions { Nickname = "Monthly Parking Plan", Product = "{{CAR_PARKING_PRODUCT_ID}}", Amount = 20000, Currency = "usd", Interval = "month", UsageType = "metered", AggregateUsage = "max", }; var service = new PlanService(); var plan = service.Create(options);

    Imagine that a customer has two cars parked on June 1st, then parks a third car on the 15th, and later removes one of the first two cars on the 20th. The billed amount at the end of the month is $600 (three cars maximum usage during the month, charging $200 per car).

    Usage-based pricing can also be combined with flat fees (as shown above) to charge a flat monthly rate in addition to charging for usage over the billing cycle.

    Pricing tiers

    Plans can represent pricing tiers, allowing the unit cost to change with quantity or usage. SqueakyCar might, for example, want to offer lower rates for customers who use more washes per month. The following examples show two different ways to adjust pricing as usage increases: volume-based pricing and graduated pricing. To demonstrate these approaches to tiered pricing, we will use the following tiers:

    Number of car washes Price per wash
    1 - 5 $7
    6 - 10 $6.50
    11+ $6

    Volume-based pricing

    With volume-based pricing, the subscription item is billed at the tier corresponding to the amount of usage at the end of the period. To implement volume-based billing tiers, set volume as the value of tiers_mode:

    curl https://api.stripe.com/v1/plans \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -d nickname="Car Wash Volume Pricing" \ -d "tiers[0][unit_amount]"=700 \ -d "tiers[0][up_to]"=5 \ -d "tiers[1][unit_amount]"=650 \ -d "tiers[1][up_to]"=10 \ -d "tiers[2][unit_amount]"=600 \ -d "tiers[2][up_to]"=inf \ -d currency=usd \ -d interval=month \ -d product="{{CAR_WASH_PRODUCT_ID}}" \ -d tiers_mode=volume \ -d billing_scheme=tiered \ -d usage_type=metered
    # Set your secret key. Remember to switch to your live secret key in production! # See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' Stripe::Plan.create({ nickname: 'Car Wash Volume Pricing', product: '{{CAR_WASH_PRODUCT_ID}}', currency: 'usd', interval: 'month', usage_type: 'metered', billing_scheme: 'tiered', tiers_mode: 'volume', tiers: [ { unit_amount: 700, up_to: '5', }, { unit_amount: 650, up_to: '10', }, { unit_amount: 600, up_to: 'inf', }, ], })
    # Set your secret key. Remember to switch to your live secret key in production! # See your keys here: https://dashboard.stripe.com/account/apikeys stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' stripe.Plan.create( nickname='Car Wash Volume Pricing', product='{{CAR_WASH_PRODUCT_ID}}', currency='usd', interval='month', usage_type='metered', billing_scheme='tiered', tiers_mode='volume', tiers=[ { 'unit_amount': 700, 'up_to': '5', }, { 'unit_amount': 650, 'up_to': '10', }, { 'unit_amount': 600, 'up_to': 'inf', }, ] )
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys \Stripe\Stripe::setApiKey('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); \Stripe\Plan::create([ 'nickname' => 'Car Wash Volume Pricing', 'product' => '{{CAR_WASH_PRODUCT_ID}}', 'currency' => 'usd', 'interval' => 'month', 'usage_type' => 'metered', 'billing_scheme' => 'tiered', 'tiers_mode' => 'volume', 'tiers' => [ [ 'unit_amount' => 700, 'up_to' => '5', ], [ 'unit_amount' => 650, 'up_to' => '10', ], [ 'unit_amount' => 600, 'up_to' => 'inf', ] ] ]);
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.apiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; Map<String, Object> firstTier = new HashMap<String, Object>(); firstTier.put("unitAmount", 700); firstTier.put("upTo", "5"); Map<String, Object> secondTier = new HashMap<String, Object>(); secondTier.put("unitAmount", 650); secondTier.put("upTo", "10"); Map<String, Object> thirdTier = new HashMap<String, Object>(); thirdTier.put("unitAmount", 600); thirdTier.put("upTo", "inf"); Map<String, Object> tiers = new HashMap<String, Object>(); tiers.put("0", firstTier); tiers.put("1", secondTier); tiers.put("2", thirdTier); Map<String, Object> planParams = new HashMap<String, Object>(); planParams.put("nickname", "Car Wash Volume Pricing"); planParams.put("product", "{{CAR_WASH_PRODUCT_ID}}"); planParams.put("currency", "usd"); planParams.put("interval", "month"); planParams.put("usage_type", "metered"); planParams.put("billing_scheme", "tiered"); planParams.put("tiers_mode", "volume"); planParams.put("tiers", tiers); Plan.create(planParams);
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys const stripe = require('stripe')('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); const plan = await stripe.plans.create({ nickname: 'Car Wash Volume Pricing', product: '{{CAR_WASH_PRODUCT_ID}}', currency: 'usd', interval: 'month', usage_type: 'metered', billing_scheme: 'tiered', tiers_mode: 'volume', tiers: [ { unit_amount: 700, up_to: 5, }, { unit_amount: 650, up_to: 10, }, { unit_amount: 600, up_to: 'inf', }, ], });
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys stripe.Key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc" params := &stripe.PlanParams{ Nickname: stripe.String("Car Wash Volume Pricing"), ProductID: stripe.String("{{CAR_WASH_PRODUCT_ID}}"), Currency: stripe.String(string(stripe.CurrencyUSD)), Interval: stripe.String(string(stripe.PlanIntervalMonth)), UsageType: stripe.String(string(stripe.PlanUsageTypeMetered)), BillingScheme: stripe.String(string(stripe.PlanBillingSchemeTiered)), TiersMode: stripe.String(stripe.String(stripe.PlanTiersModeVolume)), Tiers: []*stripe.PlanTier{ { UnitAmount: 700, UpTo: "5", }, { UnitAmount: 650, UpTo: "10", }, { UnitAmount: 600, UpTo: "inf", }, }, } pl, _ := plan.New(params)
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys StripeConfiguration.ApiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; var tiers = new List<PlanTierOptions> { new PlanTierOptions { UnitAmount = 700, UpTo = 5, }, new PlanTierOptions { UnitAmount = 650, UpTo = 10, }, new PlanTierOptions { UnitAmount = 600, UpTo = PlanTierUpTo.Inf, }, }; var planOptions = new PlanCreateOptions { Nickname = "Car Wash Volume Pricing", Product = "{{CAR_WASH_PRODUCT_ID}}", Interval = "month", Currency = "usd", UsageType = "metered", BillingScheme = "tiered", TiersMode = "volume", Tiers = tiers, }; var planService = new PlanService(); var plan = planService.Create(planOptions);

    Under volume-based pricing, a customer with 5 car washes is charged $35 at the end of the period: $7 for each of the 5 washes. However, if they accumulate 6 washes the following month, then all washes are billed at the 6-10 rate. That month, they are charged $39 ($6.50 × 6).

    Graduated pricing

    While similar to volume pricing, graduated pricing charges for the usage in each tier instead of applying a single price to all usage. Set the value of tiers_mode to graduated to use graduated tiers:

    curl https://api.stripe.com/v1/plans \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -d nickname="Car Wash Graduated Pricing" \ -d "tiers[0][unit_amount]"=700 \ -d "tiers[0][up_to]"=5 \ -d "tiers[1][unit_amount]"=650 \ -d "tiers[1][up_to]"=10 \ -d "tiers[2][unit_amount]"=600 \ -d "tiers[2][up_to]"=inf \ -d currency=usd \ -d interval=month \ -d product="{{CAR_WASH_PRODUCT_ID}}" \ -d tiers_mode=graduated \ -d billing_scheme=tiered \ -d usage_type=metered
    # Set your secret key. Remember to switch to your live secret key in production! # See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' Stripe::Plan.create({ nickname: 'Car Wash Graduated Pricing', product: '{{CAR_WASH_PRODUCT_ID}}', currency: 'usd', interval: 'month', usage_type: 'metered', billing_scheme: 'tiered', tiers_mode: 'graduated', tiers: [ { unit_amount: 700, up_to: '5', }, { unit_amount: 650, up_to: '10', }, { unit_amount: 600, up_to: 'inf', }, ], })
    # Set your secret key. Remember to switch to your live secret key in production! # See your keys here: https://dashboard.stripe.com/account/apikeys stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' stripe.Plan.create( nickname='Car Wash Graduated Pricing', product='{{CAR_WASH_PRODUCT_ID}}', currency='usd', interval='month', usage_type='metered', billing_scheme='tiered', tiers_mode='graduated', tiers=[ { 'unit_amount': 700, 'up_to': '5', }, { 'unit_amount': 650, 'up_to': '10', }, { 'unit_amount': 600, 'up_to': 'inf', }, ], )
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys \Stripe\Stripe::setApiKey('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); \Stripe\Plan::create([ 'nickname' => 'Car Wash Graduated Pricing', 'product' => '{{CAR_WASH_PRODUCT_ID}}', 'currency' => 'usd', 'interval' => 'month', 'usage_type' => 'metered', 'billing_scheme' => 'tiered', 'tiers_mode' => 'graduated', 'tiers' => [ [ 'unit_amount' => 700, 'up_to' => '5', ], [ 'unit_amount' => 650, 'up_to' => '10', ], [ 'unit_amount' => 600, 'up_to' => 'inf', ] ] ]);
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.apiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; Map<String, Object> firstTier = new HashMap<String, Object>(); item.put("unitAmount", 700); item.put("upTo", "5"); Map<String, Object> secondTier = new HashMap<String, Object>(); item.put("unitAmount", 650); item.put("upTo", "10"); Map<String, Object> thirdTier = new HashMap<String, Object>(); item.put("unitAmount", 600); item.put("upTo", "inf"); Map<String, Object> items = new HashMap<String, Object>(); items.put("0", firstTier); items.put("1", secondTier); items.put("2", thirdTier); Map<String, Object> planParams = new HashMap<String, Object>(); planParams.put("nickname", "Car Wash Graduated Pricing"); planParams.put("product", "{{CAR_WASH_PRODUCT_ID}}"); planParams.put("currency", "usd"); planParams.put("interval", "month"); planParams.put("usage_type", "metered"); planParams.put("billing_scheme", "tiered"); planParams.put("tiers_mode", "graduated"); planParams.put("tiers", tiers); Plan.create(planParams);
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys const stripe = require('stripe')('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); const plan = await stripe.plans.create({ nickname: 'Car Wash Graduated Pricing', product: '{{CAR_WASH_PRODUCT_ID}}', currency: 'usd', interval: 'month', usage_type: 'metered', billing_scheme: 'tiered', tiers_mode: 'graduated', tiers: [ { unit_amount: 700, up_to: 5, }, { unit_amount: 650, up_to: 10, }, { unit_amount: 600, up_to: 'inf', }, ], });
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys stripe.Key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc" params := &stripe.PlanParams{ Nickname: stripe.String("Car Wash Graduated Pricing"), ProductID: stripe.String("{{CAR_WASH_PRODUCT_ID}}"), Currency: stripe.String(string(stripe.CurrencyUSD)), Interval: stripe.String(string(stripe.PlanIntervalMonth)), UsageType: stripe.String(string(stripe.PlanUsageTypeMetered)), BillingScheme: stripe.String(string(stripe.PlanBillingSchemeTiered)), TiersMode: stripe.String(stripe.String(stripe.PlanTiersModeGraduated)), Tiers: []*stripe.PlanTier{ { UnitAmount: 700, UpTo: "5", }, { UnitAmount: 650, UpTo: "10", }, { UnitAmount: 600, UpTo: "inf", }, }, } pl, _ := plan.New(params)
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys StripeConfiguration.ApiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; var tiers = new List<PlanTierOptions> { new PlanTierOptions { UnitAmount = 700, UpTo = 5, }, new PlanTierOptions { UnitAmount = 650, UpTo = 10, }, new PlanTierOptions { UnitAmount = 600, UpTo = PlanTierUpTo.Inf, }, }; var planOptions = new PlanCreateOptions { Nickname = "Car Wash Graduated Pricing", Product = "{{CAR_WASH_PRODUCT_ID}}", Interval = "month", Currency = "usd", UsageType = "metered", BillingScheme = "tiered", TiersMode = "graduated", Tiers = tiers, }; var planService = new PlanService(); var plan = planService.Create(planOptions);

    With graduated pricing, 5 car washes result in the same charge as volume-based pricing—$35 total at $7 per wash. This changes as usage breaks out of the first tier. A customer with more than 5 washes is charged $7 per wash for the first 5 washes, then $6.50 for washes 6 through 10, and finally $6 per wash thereafter. A customer with 6 car washes would be charged $41.50, $35 for the first 5 washes and $6.50 for the 6th wash.

    Transforming usage

    Use the transform_usage option to aggregate usage before multiplying by unit cost. This is useful if you want to report a different quantity or usage before totaling price.

    SqueakyCar decided to expand their car wash offerings with a premium waxing service. Car waxing can be time consuming, so they charge an extra usage fee (another Product) based on the time washers spend waxing the car. Washers report the exact amount of time spent waxing the cars, but SqueakyCar doesn’t want to charge customers by the minute. Instead, they will charge for each hour spent waxing—even a partial hour.

    First, create the premium waxing product:

    curl https://api.stripe.com/v1/products \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -d name="Premium Wax Service" \ -d unit_label="Hour(s)" \ -d type=service
    # Set your secret key. Remember to switch to your live secret key in production! # See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' Stripe::Product.create({ name: 'Premium Wax Service', unit_label: 'Hour(s)', type: 'service', })
    # Set your secret key. Remember to switch to your live secret key in production! # See your keys here: https://dashboard.stripe.com/account/apikeys stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' stripe.Product.create( name='Premium Wax Service', unit_label='Hour(s)', type='service', )
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys \Stripe\Stripe::setApiKey('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); \Stripe\Product::create([ 'name' => 'Premium Wax Service', 'unit_label' => 'Hour(s)', 'type' => 'service', ]);
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.apiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; Map<String, Object> productParams = new HashMap<String, Object>(); productParams.put("name", "Premium Wax Service"); productParams.put("unit_label", "Hour(s)"); productParams.put("type", "service"); Product.create(productParams);
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys const stripe = require('stripe')('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); const product = await stripe.products.create({ name: 'Premium Wax Service', unit_label: 'Hour(s)', type: 'service', });
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys stripe.Key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc" params := &stripe.ProductParams{ Name: stripe.String("Premium Wax Service"), UnitLabel: stripe.String("Hour(s)"), Type: stripe.String(string(stripe.ProductTypeService)), } prod, _ := product.New(params)
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys StripeConfiguration.ApiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; var productService = new ProductService(); var options = new ProductCreateOptions { Name = "Premium Wax Service", UnitLabel = "Hour(s)", Type = "service", }; var product = productService.Create(options);

    Next, price the waxing service, charging $5 an hour and rounding up (to charge for a full hour even if only part of the hour is used):

    curl https://api.stripe.com/v1/plans \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -d nickname="Hours Waxing Rate" \ -d amount=500 \ -d currency=usd \ -d interval=month \ -d product="{{WAX_SERVICE_PRODUCT_ID}}" \ -d "transform_usage[divide_by]"=60 \ -d "transform_usage[round]"=up \ -d usage_type=metered
    # Set your secret key. Remember to switch to your live secret key in production! # See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' Stripe::Plan.create({ nickname: 'Hours Waxing Rate', product: '{{WAX_SERVICE_PRODUCT_ID}}', amount: 500, currency: 'usd', interval: 'month', usage_type: 'metered', transform_usage: { divide_by: 60, round: 'up', }, })
    # Set your secret key. Remember to switch to your live secret key in production! # See your keys here: https://dashboard.stripe.com/account/apikeys stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' stripe.Plan.create( nickname='Hours Waxing Rate', product='{{WAX_SERVICE_PRODUCT_ID}}', amount=500, currency='usd', interval='month', usage_type='metered', transform_usage={ 'divide_by': 60, 'round': 'up' }, )
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys \Stripe\Stripe::setApiKey('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); \Stripe\Plan::create([ 'nickname' => 'Hours Waxing Rate', 'product' => '{{WAX_SERVICE_PRODUCT_ID}}', 'amount' => 500, 'currency' => 'usd', 'interval' => 'month', 'usage_type' => 'metered', 'transform_usage' => [ 'divide_by' => 60, 'round' => 'up', ], ]);
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.apiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; Map<String, Object> transformUsage = new HashMap<String, Object>(); transformUsage.put("divide_by", 60); transformUsage.put("round", up); Map<String, Object> planParams = new HashMap<String, Object>(); planParams.put("nickname", "Hours Waxing Rate"); planParams.put("product", "{{WAX_SERVICE_PRODUCT_ID}}"); planParams.put("amount", 500); planParams.put("currency", "usd"); planParams.put("interval", "month"); planParams.put("usage_type", "metered"); planParams.put("transform_usage", transformUsage); Plan.create(planParams);
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys const stripe = require('stripe')('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); const plan = await stripe.plans.create({ nickname: 'Hours Waxing Rate', product: '{{WAX_SERVICE_PRODUCT_ID}}', amount: 500, currency: 'usd', interval: 'month', usage_type: 'metered', transform_usage: { divide_by: 60, round: 'up', }, });
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys stripe.Key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc" params := &stripe.PlanParams{ Nickname: stripe.String("Hours Waxing Rate"), ProductID: stripe.String("{{WAX_SERVICE_PRODUCT_ID}}"), Amount: stripe.Int64(500), Currency: stripe.String(string(stripe.CurrencyUSD)), Interval: stripe.String(string(stripe.PlanIntervalMonth)), UsageType: stripe.String(string(stripe.PlanUsageTypeMetered)), TransformUsage: []*stripe.PlanTransformUsageParams{ DivideBy: stripe.Int64(60), Round: stripe.String(string(stripe.PlanTransformUsageRoundUp)), }, } pl, _ := plan.New(params)
    // Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys StripeConfiguration.ApiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; var transformUsage = new PlanTransformUsageOptions { DivideBy = 60, Round = "up", }; var planOptions = new PlanCreateOptions { Nickname = "Hours Waxing Rate", Product = "{{WAX_SERVICE_PRODUCT_ID}}", Amount = 500, Interval = "month", Currency = "usd", UsageType = "metered", TransformUsage = transformUsage, }; var planService = new PlanService(); var plan = planService.Create(planOptions);

    If a washer spends 150 minutes waxing a customer’s cars, that customer would be charged $15 for 3 hours of waxing (2 hours and 30 minutes, rounded up).

    Was this page helpful?

    Feedback about this page?

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

    On this page