Calculate tax in your custom payment flowsPrivate preview
Learn how to integrate taxes with the Stripe Tax and Payment Intents APIs.
The Stripe Tax API enables you to calculate tax in your custom payment flows. If you use the Payment Intents API, Stripe can submit tax transactions in the payment lifecycle.
Calculate tax
You can integrate the Tax API with a PaymentIntent by associating it with a Tax Calculation
object. Use calculate tax to get a new Tax Calculation
object with information about how much tax to collect.
Link tax calculation to the PaymentIntent
When creating or modifying a PaymentIntent, include the Tax Calculation
ID and set the amount
to the amount_
of the Tax Calculation object.
Supported endpoints
The following endpoints support setting a calculation on a PaymentIntent.
- Create: /v1/payment_intents
- Update: /v1/payment_intents/:id
- Confirm: /v1/payment_intents/:id/confirm
- Capture: /v1/payment_intents/:id/capture
Limitations
- You can only link new calculations to a PaymentIntent until it transitions to a
succeeded
state. - A tax calculation can transition to only one tax
Transaction
. If multiple PaymentIntents transition to asucceeded
state with the same linked calculation, accounting reflects only the first one.
Resulting Stripe actions
If the PaymentIntent is correctly linked to the Tax Calculation
object, Stripe automatically:
- Creates a tax transaction from the calculation after the PaymentIntent transitions to a
succeeded
state - Performs a tax reversal of a tax transaction for any refunds (created with API or Dashboard) for the PaymentIntent
- Creates a tax reversal for a reversal, if a refund has failed
- Includes the total tax information in
PaymentIntent
receipts
Stripe won’t:
- Change the PaymentIntent amount based on the linked tax calculation
- Alter the tax transaction amount based on the PaymentIntent captured amount
- Automatically create a tax reversal for disputes