Tax Rates on Invoices

    Assign tax rates to draft invoices to have Stripe calculate tax amounts for you.

    Stripe supports assigning multiple tax rates to invoices in two ways:

    • on individual invoice-items (recommended)
    • on the entire invoice’s subtotal

    Recommended: Setting Tax Rates on individual items

    If creating an invoice through the Dashboard, simply assign tax rates to individual line items.

    When modifying or creating invoice line items through the API, set the invoice item’s tax_rates:

    curl https://api.stripe.com/v1/invoiceitems/ii_CWYWo9Ham19N4a \
      -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \
      -d tax_rates[0]=txr_1EO66sClCIKljWvs98IiVfHW \
      -d tax_rates[1]=txr_1EEOvcClCIKljWvsqYb9U0MB
    
    # 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::InvoiceItem.update(
      'ii_CWYWo9Ham19N4a',
      {
        tax_rates: [
          'txr_1EO66sClCIKljWvs98IiVfHW',
          'txr_1EEOvcClCIKljWvsqYb9U0MB',
        ],
      }
    )
    
    # 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.InvoiceItem.modify(
      'ii_CWYWo9Ham19N4a',
      tax_rates=[
        'txr_1EO66sClCIKljWvs98IiVfHW',
        'txr_1EEOvcClCIKljWvsqYb9U0MB',
      ]
    )
    
    // 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');
    
    \Stripe\InvoiceItem::update(
      'ii_CWYWo9Ham19N4a',
      [
        'tax_rates' => [
          'txr_1EO66sClCIKljWvs98IiVfHW',
          'txr_1EEOvcClCIKljWvsqYb9U0MB',
        ],
      ]
    );
    
    // 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";
    
    InvoiceItem invoiceItem = InvoiceItem.retrieve("ii_CWYWo9Ham19N4a");
    Map<String, Object> updateParams = new HashMap<String, Object>();
    List<String> taxRates = Arrays.asList(
      "txr_1EO66sClCIKljWvs98IiVfHW",
      "txr_1EEOvcClCIKljWvsqYb9U0MB"
    );
    updateParams.put("tax_rates", taxRates);
    invoiceItem.update(updateParams);
    
    // 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.invoiceItems.update(
      'ii_CWYWo9Ham19N4a',
      {
        tax_rates: [
          'txr_1EO66sClCIKljWvs98IiVfHW',
          'txr_1EEOvcClCIKljWvsqYb9U0MB',
        ],
      },
      function(err, invoiceItem) {
        // 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.InvoiceItemParams{
      TaxRates: stripe.StringSlice([]string{
        "txr_1EO66sClCIKljWvs98IiVfHW",
        "txr_1EEOvcClCIKljWvsqYb9U0MB",
      }),
    }
    ii, err := invoiceitem.Update("ii_CWYWo9Ham19N4a", 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 InvoiceItemUpdateOptions {
      TaxRates = new List<string> {
        "txr_1EO66sClCIKljWvs98IiVfHW",
        "txr_1EEOvcClCIKljWvsqYb9U0MB",
      },
    };
    var service = new InvoiceItemService();
    var invoiceItem = service.Update("ii_CWYWo9Ham19N4a", options);
    

    You can add as many as five tax rates to each line item.

    You can update Tax Rates of line items created by a subscription by passing the line item id.

    Setting default tax rates for the entire invoice

    If you sell one type of product, or have especially simple tax needs, you can set a default tax rate on the invoice.

    Default tax rates apply by default to all line items. However, adding an item level tax rate will override the default tax rate. The default tax rate will no longer apply to that item.

    If creating an invoice through the Dashboard, assign default tax rates to apply to the invoice.

    Set the invoice’s default tax rates through the API:

    curl https://api.stripe.com/v1/invoices/in_18jwqyLlRB0eXbMtrUQ97YBw \
      -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \
      -d default_tax_rates[0]=txr_1EO66sClCIKljWvs98IiVfHW \
      -d default_tax_rates[1]=txr_1EEOvcClCIKljWvsqYb9U0MB
    
    # 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::Invoice.update(
      'in_18jwqyLlRB0eXbMtrUQ97YBw',
      {
        default_tax_rates: [
          'txr_1EO66sClCIKljWvs98IiVfHW',
          'txr_1EEOvcClCIKljWvsqYb9U0MB',
        ],
      }
    )
    
    # 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.Invoice.modify(
      'in_18jwqyLlRB0eXbMtrUQ97YBw',
      default_tax_rates=[
        'txr_1EO66sClCIKljWvs98IiVfHW',
        'txr_1EEOvcClCIKljWvsqYb9U0MB',
      ]
    )
    
    // 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');
    
    \Stripe\Invoice::update(
      'in_18jwqyLlRB0eXbMtrUQ97YBw',
      [
        'default_tax_rates' => [
          'txr_1EO66sClCIKljWvs98IiVfHW',
          'txr_1EEOvcClCIKljWvsqYb9U0MB',
        ],
      ]
    );
    
    // 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";
    
    Invoice invoice = Invoice.retrieve("in_18jwqyLlRB0eXbMtrUQ97YBw");
    Map<String, Object> updateParams = new HashMap<String, Object>();
    List<String> defaultTaxRates = Arrays.asList(
      "txr_1EO66sClCIKljWvs98IiVfHW",
      "txr_1EEOvcClCIKljWvsqYb9U0MB"
    );
    updateParams.put("default_tax_rates", defaultTaxRates);
    invoice.update(updateParams);
    
    // 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.invoices.update(
      'in_18jwqyLlRB0eXbMtrUQ97YBw',
      {
        default_tax_rates: [
          'txr_1EO66sClCIKljWvs98IiVfHW',
          'txr_1EEOvcClCIKljWvsqYb9U0MB',
        ],
      },
      function(err, invoice) {
        // 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.InvoiceParams{
      DefaultTaxRates: stripe.StringSlice([]string{
        "txr_1EO66sClCIKljWvs98IiVfHW",
        "txr_1EEOvcClCIKljWvsqYb9U0MB",
      }),
    }
    i, err := invoice.Update("in_18jwqyLlRB0eXbMtrUQ97YBw", 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 InvoiceUpdateOptions {
      DefaultTaxRates = new List<string> {
        "txr_1EO66sClCIKljWvs98IiVfHW",
        "txr_1EEOvcClCIKljWvsqYb9U0MB",
      },
    };
    var service = new InvoiceService();
    var invoice = service.Update("in_18jwqyLlRB0eXbMtrUQ97YBw", options);
    

    You can add as many as five default tax rates to each invoice.

    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.

    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.

    On this page