Adds the ability to opt out of strict arithmetic validation for Payment Line Items
What’s new
You can now opt out of strict arithmetic validation for Payment Line Items on a per-request basis by using the amount_details.enforce_arithmetic_validation parameter.
Impact
By default, Stripe validates that your line item data passed as part of the Payment Line Items feature adds up correctly. When the sum of line items doesn’t match the total amount, Stripe returns a 400 error so you can correct discrepancies before processing the payment.
You can now opt out of this strict validation on a per-request basis by setting amount_details.enforce_arithmetic_validation to false. When you do this:
- The request proceeds even if line item amounts don’t match the total.
- Stripe returns validation error details in the amount_details.error field in the response.
- For card payments, Stripe doesn’t send line item data with arithmetic errors to card networks, preventing the transaction from qualifying for L2/L3 interchange savings.