← All articles

October 8, 2026 · Muhammad Umar · More by Muhammad Umar

Shopify Discount Functions Gain Cart-Wide Visibility

As of API 2026-04, Shopify discount functions can see what other discounts already did to a cart — but only if they run after them.

Shopify Discount Functions Gain Cart-Wide Visibility — ASSOSIATIX Journal

As of GraphQL API version 2026-04, Shopify Functions gained the ability to read what other discounts have already done to a cart — a capability that changes how tiered, bundle, and stacking logic should be scoped, but only for functions that execute late enough to see it.

Three levels of discount visibility, added in API 2026-04

Shopify's changelog describes three tiers of discount information now available inside a Function's cart input: cart-level data covering all discount applications on the cart, line-item-level data showing discounts allocated to specific lines, and delivery-level data showing discounts allocated to delivery groups. A single discount function can act on this information across three discount classes at once — product, order, and shipping — so one function can, for example, reduce both the order total and the delivery cost in a single run.

Visibility depends on where your function runs in the sequence

The catch is in one line of Shopify's own changelog: based on the function execution order, only functions that execute after discounts can see complete discount information. A function scoped to apply a tier only once a cart has already been discounted below a certain threshold needs to actually run after the discounts it's checking for — otherwise it's working from an incomplete picture of what's already been applied. Shopify's documentation doesn't specify the default sequence or how that order is configured, so any tiered or exclusion logic that depends on "what's already discounted" needs to be verified against the actual execution order in the store it runs on, not assumed.

Up to 25 functions, stacked by the discount node, not by you

A store can activate up to 25 discount functions at once, and Shopify is explicit that they run concurrently with no knowledge of each other's logic. How one function's output combines with another's isn't decided inside the function itself — it's governed by the combination and stacking rules set on the discount node. That separation matters for anyone debugging why two discounts interacted unexpectedly: the fix usually isn't in either function's code, it's in how the discount node combines their candidates.

The subscription gotcha: a shipping discount that resets itself

The Discount Function API's compatibility notes flag a specific trap for subscriptions: a discount function isn't re-run when a recurring order is created, and any shipping discount applied to the origin order defaults to a 100% shipping discount on every recurring order, regardless of what the original discount's value actually was. A function offering 20% off shipping on the first order will produce free shipping on every renewal after it, unless that's explicitly accounted for elsewhere. The same not-re-run behavior applies to edited orders in checkout, so a function's output should be treated as a one-time calculation, not something that stays in sync with the order afterward.

Sources

Conversion & Growth

ASSOSIATIX works on this every day. See our Shopify Conversion & Performance Optimization service

$./start-project.sh

READY TO BUILD
WHAT'S NEXT?

Tell us where you are and where you want to go. We'll help you choose the right path—storefront, system, product, or a focused growth sprint.