Mapping code often copies every field, empty or not, and a zero discount is the most common empty value. Stripe does not accept it.
The rule
amount_details.discount_amountandline_items[].discount_amounttake an integer greater than 0 (Stripe API, Create a PaymentIntent).- The two are mutually exclusive: a discount goes on the order or on the lines (Stripe, Payment line items).
Why it happens
Order systems store "no discount" as 0, and a mapper that sends every field passes it through.
Wrong and right
Wrong: a zero discount
{
"amount": 10058,
"currency": "usd",
"amount_details": {
"discount_amount": 0,
"tax": { "total_tax_amount": 658 },
"line_items": [
{ "product_name": "Hex bolts 3/8 in, zinc", "quantity": 200, "unit_cost": 35 },
{ "product_name": "Flat washers 3/8 in", "quantity": 200, "unit_cost": 12 }
]
}
}Right: no discount field
{
"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 },
{ "product_name": "Flat washers 3/8 in", "quantity": 200, "unit_cost": 12 }
]
}
}What to do
- Send
discount_amountonly when it is above zero. - When there is a discount, subtract it in the amount: lines plus tax plus shipping minus discount.
Sources
- Stripe API, Create a PaymentIntent,
amount_details.discount_amount(read November 24, 2026). - Stripe, Payment line items, notes on discount fields (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.