Applying Taxes to Subscriptions

    Learn how to automatically charge tax on a subscription.

    If you need to collect any type of tax on a subscription, such as VAT or sales tax, provide a tax_percent when creating the subscription. The value should be a decimal, with up to four decimal places, representing a percent (i.e., a 6.34% tax is set using 6.34). The calculated tax amount is rounded to the nearest unit (e.g., cents).

    curl https://api.stripe.com/v1/subscriptions \
       -u sk_test_BQokikJOvBiI2HlWgH4olfQ2: \
       -d customer=cus_4fdAW5ftNQow1a \
       -d items[0][plan]=plan_CBb6IXqvTLXp3f \
       -d tax_percent="6.34"
    
    # 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_BQokikJOvBiI2HlWgH4olfQ2"
    
    subscription = Stripe::Subscription.create({
        customer: 'cus_4fdAW5ftNQow1a',
        items: [{plan: 'plan_CBb6IXqvTLXp3f'}],
        tax_percent: 6.34,
    })
    
    # 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_BQokikJOvBiI2HlWgH4olfQ2"
    
    subscription = stripe.Subscription.create(
      customer='cus_4fdAW5ftNQow1a',
      items=[{'plan': 'plan_CBb6IXqvTLXp3f'}],
      tax_percent=6.34,
    )
    
    // 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_BQokikJOvBiI2HlWgH4olfQ2");
    
    $subscription = \Stripe\Subscription::create([
        'customer' => 'cus_4fdAW5ftNQow1a',
        'items' => [['plan' => 'plan_CBb6IXqvTLXp3f']],
        'tax_percent' => 6.34,
    ]);
    
    // 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_BQokikJOvBiI2HlWgH4olfQ2";
    
    Map<String, Object> item = new HashMap<>();
    item.put("plan", "plan_CBb6IXqvTLXp3f");
    Map<String, Object> items = new HashMap<>();
    items.put("0", item);
    Map<String, Object> params = new HashMap<>();
    params.put("customer", "cus_4fdAW5ftNQow1a");
    params.put("items", items);
    params.put("tax_percent", 6.34);
    Subscription subscription = Subscription.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
    var stripe = require("stripe")("sk_test_BQokikJOvBiI2HlWgH4olfQ2");
    
    const subscription = stripe.subscriptions.create({
      customer: 'cus_4fdAW5ftNQow1a',
      items: [{plan: 'plan_CBb6IXqvTLXp3f'}],
      tax_percent: 6.34,
    });
    
    // 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_BQokikJOvBiI2HlWgH4olfQ2"
    
    items := []*stripe.SubscriptionItemsParams{
      {
        Plan: stripe.String("plan_CBb6IXqvTLXp3f"),
      },
    }
    params := &stripe.SubscriptionParams{
      Customer: stripe.String("cus_4fdAW5ftNQow1a"),
      Items: items,
      TaxPercent: stripe.Float64(6.34),
    }
    subscription, _ := sub.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.SetApiKey("sk_test_BQokikJOvBiI2HlWgH4olfQ2");
    
    var items = new List<StripeSubscriptionItemOption> {
        new StripeSubscriptionItemOption {PlanId = "plan_CBb6IXqvTLXp3f"}
    };
    var options = new StripeSubscriptionCreateOptions {
        Items = items,
        TaxPercent = 6.34m,
    };
    var service = new StripeSubscriptionService();
    StripeSubscription subscription = service.Create("cus_4fdAW5ftNQow1a", options);
    

    Taxes are automatically calculated on the invoice subtotal, factoring in any discounts or invoice items.

    Sales tax laws vary by region and even by product or service. We recommend checking with a qualified accountant to identify your business’ requirements. To look up tax rates, or for more complex needs, consider using a third-party service that works with Stripe.

    Next steps

    Now that you understand how to charge taxes on subscriptions, you may want to check out:

    Questions?

    We're always happy to help with code or other questions you might have! Search our documentation, contact support, or connect with our sales team. You can also chat live with other developers in #stripe on freenode.

    Was this page helpful? Yes No

    Send

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