Sign in
An image of the Stripe logo
Create account
Sign in
Home
Payments
Business operations
Financial services
Developer tools
No-code
All products
Home
Payments
Business operations
Home
Payments
Business operations
Financial services
Developer tools
Support
Overview
Online payments
Products and prices
Invoicing
Subscriptions
Quotes
In-person payments
Multiparty payments
After the payment
Add payment methods
Payment Links
Stripe Checkout
    Overview
    How Checkout works
    Quickstart
    Fulfill your orders
    Migrate payment methods to the Dashboard
    Migrate from legacy Checkout
    Migrate Checkout to use Prices
    Customize your integration
    Customize branding
    Collect taxes
    Collect tax IDs
    Collect phone numbers
    Post-payment invoices
    Make line item quantities adjustable
    Add custom fields
    Let customers decide what to pay
    Boost revenue
    Present local currencies
    Configure subscription upsells
    Configure cross-sells
    Recover abandoned carts
    Collect consent for promotional emails
    Analyze conversion funnel
    Additional features
    Add discounts
    Add shipping
    Start a free trial without collecting payment details
    Manage limited inventory
    Guest customers
Stripe Elements
About the APIs
Regulation support
Implementation guides
Testing
Checkout
·
HomePayments

Collect taxes in Checkout

Learn how to collect taxes for one-time payments in Stripe Checkout.

Stripe offers two ways to calculate tax on your Checkout Sessions: Stripe Tax and Tax Rates.

  • Stripe Tax—a paid product that automatically calculates the tax on your transactions without the need to define the rates and rules. Fees only apply after you’ve added at least one location where you’re registered to calculate and remit tax.

  • Tax Rates—a free feature that allows you to define any number of tax rates for invoices, subscriptions, and one-time payments that use Checkout. Stripe won’t create or maintain any tax rates on your behalf.

Stripe Tax allows you to calculate the tax on your one-time and recurring payments when you use Checkout. You can enable Stripe Tax to automatically compute taxes on all of your Checkout purchases and subscriptions. Make sure to integrate Checkout before reading through this guide.

Log in or sign up for Stripe to activate Stripe Tax.

Update your Products and Prices

When calculating tax, Stripe Tax uses information stored on the Products and Prices APIs to determine the right rates and rules. You can update your Checkout products and prices to include:

  • tax_behavior—Specifies whether the price is considered inclusive or exclusive of taxes.
  • tax_code (optional)—Specifies the product tax category. If you don’t set a tax_code on a product, we apply your default product tax category. For more information, consult our list of tax categories.

When you set the tax_behavior parameter to exclusive, it adds tax to the subtotal. This is common in US markets and for business-to-business (B2B) sales. If you set the tax_behavior to inclusive, the amount your buyer pays never changes (even if the tax rate varies). This is common practice for business-to-consumer (B2C) buyers in markets outside of the US. If you don’t want to create your products and prices upfront, you can pass the price_data.tax_behavior and product_data.tax_code parameters in your Checkout session.

Learn more about Products, prices, tax categories, and tax behavior.

Create a Checkout Session

After updating your products and prices, you’re ready to start calculating tax on your Checkout sessions. You can create sessions for one-time and recurring purchases.

To calculate tax for new customers, Checkout validates and uses the provided shipping or billing address. For existing customers, Checkout calculates tax by validating and using the attached customer shipping or billing address. If you capture a new billing or shipping address for an existing customer, Checkout won’t automatically override the previous billing or shipping information. You must explicitly request customer address changes.

When you enable Stripe Tax in Checkout, Google Pay is only available to customers for sessions that require collecting a shipping address. Apple Pay with Stripe Tax displays only when the customer’s browser supports Apple Pay version 12.

Calculate tax for new customers

If you don’t pass in an existing customer when creating a Checkout session, Checkout creates a new customer and automatically saves the billing address and shipping information. Checkout uses the shipping address entered during the session to determine the customer’s location for calculating tax. If you don’t collect shipping information, Checkout uses the billing address.

Command Line
curl https://api.stripe.com/v1/checkout/sessions \ -u
sk_test_4eC39HqLyjWDarjtT1zdp7dc
: \ -d "line_items[0][price]"=price_H5ggYwtDq4fbrJ \ -d "line_items[0][quantity]"=2 \ -d "automatic_tax[enabled]"="true" \ -d mode=payment \ -d success_url="https://example.com/success" \ -d cancel_url="https://example.com/cancel"

OptionalCalculate tax for existing customers

OptionalCheck the response

See also

  • Collect tax IDs
Was this page helpful?
Questions? Contact us.
Watch our developer tutorials.
Check out our product changelog.
Powered by Markdoc
You can unsubscribe at any time. Read our privacy policy.
On this page
Update your Products and Prices
Create a Checkout Session
Calculate tax for new customers
Calculate tax for existing customers
Check the response
See also
Stripe Shell
Test mode
Welcome to the Stripe Shell! Stripe Shell is a browser-based shell with the Stripe CLI pre-installed. Login to your Stripe account and press Control + Backtick on your keyboard to start managing your Stripe resources in test mode. - View supported Stripe commands: - Find webhook events: - Listen for webhook events: - Call Stripe APIs: stripe [api resource] [operation] (e.g. )
The Stripe Shell is best experienced on desktop.
$