Automatically collect tax on Checkout sessions
Learn how to automatically calculate taxes in Checkout.
Stripe Tax automatically calculates the taxes on all purchases and subscriptions accumulated during a Checkout session. If you haven’t integrated with Checkout, you must complete the integration using the Accept a Payment guide.
Get started with a video demo
This short video shows to how to enable automatic tax collection when using hosted integrations like Stripe Checkout.
Update your products and prices
Stripe Tax uses information stored on products and prices to calculate tax, such as tax code and tax behavior.
See Specify product tax codes and tax behaviour to learn more.
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.
A customer’s tax rates come from their location, which Checkout assesses from the customer’s address. The address that Checkout uses to calculate taxes depends on whether the customer is new or existing, and whether you collect shipping addresses during the Checkout Session:
New Customer | Existing Customer | |
---|---|---|
Collect a billing address only | Checkout calculates taxes based on the customer’s billing address entered into the Checkout Session | If the customer has a previously saved shipping address, Checkout calculates taxes based on that address. Otherwise, you can calculate taxes based on billing address entered during Checkout (by specifying customer_update[address]=auto) or the billing address saved to the customer (the default behavior). |
Collect a shipping address | Checkout calculates taxes based on the customer’s shipping address entered into the Checkout Session | Checkout calculates taxes based on the customer’s shipping address entered into the Checkout Session. Existing addresses on the customer won’t apply in this case. |
Note
If you wish to ensure that Google Pay is offered as a payment method while using Stripe Tax in Checkout, you must require collecting a shipping address. Apple Pay with Stripe Tax displays only when the customer’s browser supports Apple Pay version 12.
Calculating 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 billing address and shipping information. For tax collection purposes, Checkout uses billing and shipping addresses to determine the customer’s location.
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.
Calculate tax for existing customers
To calculate tax on Checkout sessions created for existing customers, you can set the automatic_
parameter to true
when creating the session. You can either base tax calculations on the customer’s existing addresses or new addresses collected during the session:
Use the existing addresses on the customer for taxes
If you’ve already collected the addresses of existing customers, you can base tax calculations on those addresses rather than the addresses collected during checkout:
The customer address that Checkout uses for taxes: If available, Checkout uses the customer’s saved shipping address to calculate taxes. Otherwise, Checkout uses the customer’s saved billing address to calculate taxes.
Customer address requirements: When using existing addresses for taxes, the customer must either have a valid shipping address or billing address saved. You can see whether or not a customer’s saved addresses are valid by checking the customer’s customer.tax.automatic_tax property. If the property is
supported
ornot_
, it means the customer’s saved addresses are valid, and you can enable Stripe Tax on Checkout sessions for that customer.collecting
Use the addresses collected during Checkout for taxes
You can configure Checkout to save new billing or shipping addresses to a customer. In this case, Checkout calculates tax using the address entered during checkout.
The address that Checkout uses for taxes: If you collect shipping addresses, Checkout uses the shipping address entered during the session to calculate taxes. Otherwise, Checkout uses the billing address entered during the session to calculate taxes.
Where Checkout saves the addresses collected during checkout: If you collect shipping addresses, Checkout saves the shipping address entered during the session to the customer’s customer.shipping.address property. Otherwise, Checkout saves the billing address entered during the session to the customer’s customer.address property. In both cases, the address used for taxes overrides any existing addresses.
If you collect shipping addresses with Checkout, set the customer_
property to auto
so that you copy the shipping information from Checkout to the customer.
If you don’t collect shipping addresses with Checkout, and you want to use billing addresses entered during checkout for taxes, you must save the billing address to the customer. Set the customer_
property to auto
so that you copy the newly-entered address onto the provided customer.
Check the response
To inspect the results of the latest tax calculation, you can read the tax amount calculated by Checkout from the total_details.amount_tax on the Checkout Session resource. Additionally, the tax outcome for each payment is available when viewing a payment in the Dashboard.