News |
shopify

Enhanced discounts support in the Shopify Functions Cart

Source: Shopify Dev Changelog

Shopify Functions Gain Access to Detailed Discount Data

Shopify Functions can now access comprehensive discount information through the GraphQL API version 2026-04. The update provides discount data at three distinct levels within the cart structure.

What Changed

Functions now receive discount information for cart-level applications, line item-level allocations, and delivery group-level allocations. The visibility of this discount data depends on function execution order. Functions that run after discount calculations can access complete discount information, while those executing earlier in the sequence see limited or no discount data.

Impact for Shopify App Developers

Developers building custom pricing logic, shipping calculators, or cart transformation functions can now make decisions based on applied discounts. This access enables functions to calculate accurate totals, apply conditional logic based on discount types, or create complex pricing rules that account for existing promotions.

Apps that modify cart contents or calculate fees can now factor in active discounts without requiring separate API calls or workarounds. This reduces the need for external discount tracking systems in custom storefronts or headless commerce implementations.

Technical Considerations

Developers need to verify their function’s position in the execution sequence to ensure discount data availability. Functions positioned before discount calculations in the execution order will not have access to this information. Testing should confirm that discount data appears as expected for functions that depend on this information for their logic.

The feature requires GraphQL API version 2026-04 or later. Existing functions may need version updates to access the new discount data structure.

Read the full announcement →

Stay in the loop

Get Shopify ecosystem news and positioning insights for app founders.

Unsubscribe anytime. No spam, I promise.