Stripe offers two ways to calculate tax on your Checkout Sessions: Stripe Tax and Tax Rates.
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.
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
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
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
product_data.tax_code parameters in your 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.
Apple Pay and Google Pay
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.
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.
curl https://api.stripe.com/v1/checkout/sessions \
-d "line_items[price]"=price_H5ggYwtDq4fbrJ \
-d "line_items[quantity]"=2 \
-d "automatic_tax[enabled]"="true" \
-d mode=payment \
-d success_url="https://example.com/success" \