Shopify Functions Product Discount API multiple discounts

Topic summary

Multiple product discounts from Shopify Functions’ Product Discount API were initially blocked by DiscountApplicationStrategy allowing only FIRST or MAXIMUM, preventing stacking or applying different discounts to different products in the same checkout. Many reported this limitation and asked for parity with legacy Script Editor.

Key developments:

  • Shopify acknowledged the limitation and said a fix was in progress without timelines.
  • A temporary “unstable” workaround added ALL to the schema, enabling multiple discounts but with issues (e.g., first discount message reused on all lines).
  • API 2024-01 introduced DiscountApplicationStrategy.ALL. Several users confirm it now applies multiple discounts across different variants/lines as intended.

Remaining issues and notes:

  • Discounts target productVariant (variant ID), not the specific cart line; identical variants in multiple lines can receive the same discount unintentionally. Workaround: specify target quantities per variant to limit how many units get discounted.
  • Some still want true line-item targeting and per-line messages, and broader parity with Scripts.
  • Older multi-code approaches via /discount/CODE and cart permalinks reportedly stopped stacking multiple discounts despite docs.

Status: Partially resolved with ALL in 2024-01; further refinements (line-level targeting, message scoping) remain open. Code examples and screenshots are central to understanding the solutions.

Summarized with AI on December 29. AI used: gpt-5.

Bump +1. @Shopify_77

This is also an issue for us. We need to be able to apply different discount amounts on different line items. This should be based on the line item, not the variant ID. We need the same capabilities that the Script Editor currently has.

1 Like