Adding tax everywhere feels safe. On a Stripe PaymentIntent it is not: tax goes at one level.
The rule
- Stripe, Payment line items and Stripe API, Create a PaymentIntent:
amount_details[tax][total_tax_amount]andamount_details[line_items][][tax][total_tax_amount]are mutually exclusive. You can only specify one or the other. - With tax per line, the total is the sum of each line's cost plus its tax. With tax per order, it is the sum of the lines plus the order tax.
Why it happens
An integration adds line level tax for Level 3 and keeps the order level tax it already sent for Level 2.
Wrong and right
Wrong: tax at both levels
{
"amount": 10058,
"currency": "usd",
"amount_details": {
"tax": { "total_tax_amount": 658 },
"line_items": [
{ "product_name": "Hex bolts 3/8 in, zinc", "quantity": 200, "unit_cost": 35, "tax": { "total_tax_amount": 490 } },
{ "product_name": "Flat washers 3/8 in", "quantity": 200, "unit_cost": 12, "tax": { "total_tax_amount": 168 } }
]
}
}Right: tax per line only
{
"amount": 10058,
"currency": "usd",
"amount_details": {
"line_items": [
{ "product_name": "Hex bolts 3/8 in, zinc", "quantity": 200, "unit_cost": 35, "tax": { "total_tax_amount": 490 } },
{ "product_name": "Flat washers 3/8 in", "quantity": 200, "unit_cost": 12, "tax": { "total_tax_amount": 168 } }
]
}
}Or drop the line tax and keep "tax": { "total_tax_amount": 658 } at order level.
What to do
- Pick the level your tax service computes at.
- Do the same for discounts:
discount_amountis also order level or line level, not both.
Sources
- Stripe, Payment line items, notes on tax and discount fields (read November 24, 2026).
- Stripe API, Create a PaymentIntent,
amount_details.tax(read November 24, 2026).
Run this sale through the checker.
The sale from this page is already filled in. Press Check transaction, then change it to one of your own. No account needed.