Fixed-amount (FixedAmount) line-item discounts are now calculated internally per-unit. With the current API (2026-04 and earlier) you can still pass the total amount and POS converts it automatically. However, when the amount doesn't divide evenly, the total can differ by up to 1 cent.
No matter the quantity, the fixed amount was deducted in a lump sum from the line item's total.
The discount is divided by the quantity and applied per unit. The total is nearly the same, with a discrepancy only when it doesn't divide evenly.
setLineItemDiscount / bulkSetLineItemDiscounts to FixedAmount type pass the line item's total discount amount as before, and the POS system handles the conversion to per-unit automatically.
Custom fixed-amount line item discounts move to per-unit calculation. Amounts that don't divide evenly can change the total.
Percentage-based discounts have no change in how they're calculated. This update applies only to fixed amounts.
setLineItemDiscountFixed-amount discount on a single line item. Pass the total and POS converts it to per-unit.
bulkSetLineItemDiscountsFixed-amount discount across multiple line items at once. Here too, you can keep specifying the total the same way.
| Discount amount passed (total) | Quantity | Per unit (per-unit) | Actual total | Difference |
|---|---|---|---|---|
| $5.00 | 3 units | $5.00 ÷ 3 = $1.67(fraction rounded) | $5.01 | +$0.01 |
| $6.00 | 3 units | $6.00 ÷ 3 = $2.00 (divides evenly) | $6.00 | ±0 |
* The first row is the example given in the article. The second row is a contrast added to illustrate the article's note that there's no difference when it divides evenly.
No changes needed on the extension side. Just pass the line item's total discount amount as before, and POS handles the per-unit conversion for you.
The extension will need to pass the per-unit discount amountdirectly. Specific target versions and timing will be announced as the release approaches (not specified at this time).
Audit the Cart API version your extension uses for fixed-amount line discounts.
If so, no changes are needed. You can keep your current implementation that passes the total amount.
Prepare tests with amounts that don't divide evenly, to be ready for direct per-unit specification in future versions.
Only fixed-amount line discounts are converted to per-unit. Percentage discount calculations stay the same and are unaffected.
No action needed for 2026-04 or earlier. Keep your implementation that passes the total discount amount, and POS automatically converts it to per-unit.
Only when the discount amount doesn't divide evenly by the quantity can the total be off by up to 1 cent (the smallest unit of the local currency). If it divides evenly, there's no difference.
In upcoming API versions, the direction is for extensions to pass per-unit discount amounts directly. The target versions and timing are not specified at this time.
This affects implementations that use the Cart API's setLineItemDiscount / bulkSetLineItemDiscounts with the FixedAmount type. Build your tests on the assumption that a 1-cent difference can occur in receipts and accounting reconciliation. See the Cart API reference for details.
setLineItemDiscount / bulkSetLineItemDiscounts used with FixedAmount stays the same. When you upgrade to a future version, build per-unit support into your plan.