Shopify Discounts Allocator Function API: Stacking Discounts on One Product

Merchants have been asking for this since 2012. Shopify's answer finally exists, and it's narrower than the feature request that inspired it.

"Please add stacking" is one of the longest-running requests in Shopify's community forums, with threads dating back to 2012 and still active over a decade later. Shopify's actual answer to it isn't a settings toggle. It's a developer API, still rolling out, that most merchants have never heard of.

The Discounts Allocator Function API lets a merchant define custom logic for how a discount's value gets distributed across cart items, which is the specific capability needed to stack multiple discounts on the same product, something Shopify's native discount combination settings have never supported. Combining discounts, Shopify's existing feature, lets different discounts apply to different products in the same cart. Stacking, multiple discounts applying to the same product, is a different problem, and the Allocator API is Shopify's purpose-built answer to it.

Why can't native Shopify combinations already do this?

Native "combining discounts" settings control whether two separate discounts can both be active in a cart at once, but each individual product still receives only its single largest applicable discount, never a sum of several. A Shopify Community explanation of the underlying rule states this directly: discounts apply to different items in the cart, and each product receives only the largest applicable discount. To achieve a similar effect natively, merchants set one discount as a product discount and the other as an order discount, which sidesteps the limitation rather than solving it.

This is the exact confusion behind years of frustrated community threads. One long-running thread traces requests for true stacking back to at least 2012, with Shopify's 2022 "Discount Combinations" feature widely seen by merchants as a partial answer that still didn't deliver the stacking specifically being asked for.

What does the Allocator API actually let you build?

The API lets a custom app define its own logic for distributing a discount's value across cart lines, enabling patterns like a maximum discount cap per cart, a limit on how many discounts can apply simultaneously, or applying a discount only to the cheapest or most expensive line item, rather than accepting Shopify's default "largest wins" allocation. Shopify's own changelog entry describes it plainly: the API allows defining custom logic for how discounts are distributed, enabling merchant-specific discount strategies that don't fit Shopify's built-in allocation rules.

A developer breakdown of the API's practical use cases is specific about the headline use case: the most requested feature this API solves for is the ability to stack multiple discounts on a single line item, which was previously not possible with Shopify at all, native settings or otherwise.

What are the current real limitations?

You can install a maximum of one Discounts Allocator Function per store, and as of its most recent documentation, only custom apps on developer preview stores can use it, meaning general merchants can't yet install a public app built on this API the way they would a standard discount app. Shopify's Discounts Allocator Function API reference states both constraints directly: a maximum of one Allocator Function per store, and access currently limited to custom apps on developer preview stores, requiring Partners program enrollment.

That's a meaningfully narrower rollout than the Discount Function API most merchants already use through apps like Flowly: Discount Functions. The Allocator API is still officially unstable, which is Shopify's designation for APIs that can change before general release.

How does this relate to the regular Discount Function API merchants already use?

The standard Discount Function API (the one powering most no-code discount apps today) governs how a single discount function generates candidates and resolves them via a selection strategy; the Allocator API sits at a different layer, governing how a discount's value gets distributed across cart lines once it's been decided to apply. Shopify's Discount Function API documentation confirms up to 25 discount functions can run per store, each unaware of the others, with their outputs combined according to each discount's combination settings, the mechanism most merchants already interact with. The Allocator API is a separate, narrower tool specifically for controlling allocation logic, not a replacement for the discount function layer itself.

Put simply: the Discount Function API decides what discount applies and how much it's worth. The Allocator API, where available, decides how that value gets spread across the cart's line items when the default allocation isn't what a merchant needs.

Is this the fix for the decade-long stacking complaint?

Partially, and only for stores with developer resources to build a custom app on a preview-only API. A tutorial for building one walks through a concrete example: using metafields to cap a 50% discount at a specific dollar amount at the order level, and separately capping the maximum discounted amount for an entire cart at the shop level, both custom allocation logic the native discount engine can't express on its own.

For merchants without in-house developers or a Partners program relationship, this API isn't accessible yet in the way installing a discount app is. It's the direction Shopify is building toward for true stacking, not a feature available today through a simple app install.

Native combinations vs. Discounts Allocator API


Native discount combinations

Discounts Allocator Function API

Different discounts on different products

Yes

Yes

Multiple discounts on the same product

No

Yes, with custom logic

Available to all merchants today

Yes

No — developer preview, custom apps only

Requires custom code

No

Yes

Max installed per store

N/A (many discounts, combined per settings)

One Allocator Function

FAQ

Can Shopify stack two discounts on the same product natively?

No. Native combination settings let different discounts apply to different products in the same cart, but each individual product still only receives its single largest applicable discount.

What does the Discounts Allocator Function API actually solve?

It lets a custom app define its own logic for distributing a discount's value across cart lines, enabling true stacking on a single product, capped discount amounts per cart, and other allocation patterns Shopify's native engine doesn't support.

Can any merchant install an app built on the Allocator API today?

Not yet for most stores. As of current documentation, only custom apps on developer preview stores can use it, and building one requires Partners program enrollment and development resources.

How is the Allocator API different from the regular Discount Function API?

The standard Discount Function API decides what discount applies and how much. The Allocator API operates at a different layer, deciding how a discount's value is distributed across cart line items once it's been decided to apply.

How long has Shopify been asked for true discount stacking?

Community requests for stacking specifically (versus the "combining" feature Shopify shipped in 2022) trace back to at least 2012, making this one of the platform's longest-running open feature requests.

If your store needs standard multi-condition discount logic, tiered pricing, BOGO, segment-based rules, that's covered today through the regular Discount Function API, no developer preview required. Download Flowly directly from the Shopify App Store to build that logic without code, or book a call with Subscribfy's team if genuine same-product stacking is a hard requirement worth discussing against your broader discount strategy.

Image

Book a meeting with our sales team now!

Create predictable revenue from the customers you already have.