← All breaking-change reports

Shopify breaking change: POS UI extensions 2026-07 uses per-unit fixed-amount line item discounts

shopify · breaking · 2026-07-08 · upstream source

What changed

FixedAmount line-item discounts become per-unit; the automatic total-to-per-unit conversion is removed

From the upstream announcement:

Starting with POS UI extensions API version 2026-07, FixedAmount line item discounts passed to setLineItemDiscount and bulkSetLineItemDiscounts from the Cart API must represent a per-unit discount. Why it's changing In API version 2026-04 and earlier, apps could pass a total fixed discount for the entire line item, and Shopify POS automatically converted it to a per-unit value. In API version 2026-07, this conversion no longer occurs. The value you pass is interpreted directly as the discount applied to each unit in the line item. For example, in API version 2026-07, if you pass '5.00' on a line item with quantity 2, POS applies a $5.00 discount to each unit, for a $10.00 total discount. To apply a $5.00 total discount to a line item with quantity 2, you must instead pass '2.50' as the per-unit discount. What you need to do This change only affects FixedAmount line item discounts. Percen […]

Who is affected

Value-semantics transform at every FixedAmount call site of setLineItemDiscount and bulkSetLineItemDiscounts: the amount argument must become the previous total divided by the line-item quantity.

To find out whether your repo is hit — file and line number, no code leaving your machine:

npx mendapi scan --repo .

How to fix it

Migration path:

Value-semantics transform at every FixedAmount call site of setLineItemDiscount and bulkSetLineItemDiscounts: the amount argument must become the previous total divided by the line-item quantity. The mechanical part is wrapping the existing expression as (total / quantity); the judgement part is rounding, since currency amounts that do not divide evenly need an app-level policy (upstream says to pick a rounded per-unit value consistent with intended totals). Because correctness depends on where the quantity lives in the caller and on the rounding decision, this is an LLM-assisted draft transform: the fix template rewrites the argument and flags non-integral divisions for review. Percentage discount call sites must be left untouched.

Before:

cart.setLineItemDiscount(lineItemId, { type: 'FixedAmount', amount: totalDiscount });

After:

cart.setLineItemDiscount(lineItemId, { type: 'FixedAmount', amount: (totalDiscount / lineItem.quantity).toFixed(2) });

With your own LLM key configured (BYO compute — mendapi never proxies your credentials), npx mendapi llmfix turns this guide into a reviewable draft patch for your repo.

Detected and tracked by mendapi — Dependabot for every API you depend on. Scans run locally; your code never leaves your machine.

Related

Pre-release. Change data is recorded from upstream provider releases, changelogs and OpenAPI spec diffs; every article links its source.