Shopify Discount Combinations: Both Sides Must Agree

Shopify discount combinations are a two-way agreement. Shopify’s help page says two discounts combine only when each is set to allow the other’s class: product, order or shipping. An order code that allows product discounts will not stack with a product sale that disallows order discounts. When a pair fails, the page says the best discount for the cart applies.

The API details below come from the Admin GraphQL API reference for version 2026-10 and the checkout behaviour from Shopify’s help page on combining discounts, both read in December 2026. We ran the code against the 2026-10 schema and sample data, not against a store.

How do Shopify discount combinations work?

Every discount carries one or more classes, which the Admin API returns in discountClasses as PRODUCT, ORDER or SHIPPING. Every discount also has a combinesWith object holding three booleans: productDiscounts, orderDiscounts and shippingDiscounts. The input reference gives false as the default for all three, so a discount created through the API with no combinesWith should combine with nothing.

The help page states the rule from both sides: discounts apply together only when the setting on each one allows it.

Some limits hold whatever the flags say. As the help page describes it, only one shipping discount can apply to an order, so two free shipping offers never combine. Several product discounts and several order discounts can share an order when each allows the other (the same line item is a separate case, covered below). A customer can enter up to five product or order codes plus one shipping code, and the page gives a limit of 25 automatic discounts.

The order of calculation decides what a combination costs. Product discounts come off first, order discounts are worked out on the subtotal that is left, and shipping discounts go last. The page says two percentage order discounts are both calculated on the original subtotal. We read that as side by side and not compounding, so 10% and 15% together take 25% off, not 23.5%.

How do you see which discounts combine?

The admin shows the setting one discount at a time, in the Combinations section of each discount. To see every pair at once, pull the flags with discountNodes, which needs the read_discounts scope:

query DiscountCombinations($cursor: String) {
  discountNodes(first: 100, after: $cursor, query: "status:active") {
    nodes {
      id
      discount {
        ... on DiscountCodeBasic { title discountClasses tags combinesWith { ...Flags } }
        ... on DiscountCodeBxgy { title discountClasses tags combinesWith { ...Flags } }
        ... on DiscountCodeFreeShipping { title discountClasses tags combinesWith { ...Flags } }
        ... on DiscountCodeApp { title discountClasses tags combinesWith { ...Flags } }
        ... on DiscountAutomaticBasic { title discountClasses tags combinesWith { ...Flags } }
        ... on DiscountAutomaticBxgy { title discountClasses tags combinesWith { ...Flags } }
        ... on DiscountAutomaticFreeShipping { title discountClasses tags combinesWith { ...Flags } }
        ... on DiscountAutomaticApp { title discountClasses tags combinesWith { ...Flags } }
      }
    }
    pageInfo { hasNextPage endCursor }
  }
}

fragment Flags on DiscountCombinesWith {
  productDiscounts
  orderDiscounts
  shippingDiscounts
  productDiscountsWithTagsOnSameCartLine
}

The eight near-identical lines are forced: Discount is a union of eight types with no shared interface, and graphql-js rejects a bare discount { title } against the 2026-10 schema with Cannot query field "title" on type "Discount". If all you need is a list for one class, the same query argument accepts filters such as combines_with:product_discounts and discount_class:shipping.

Save the response as response.json and run this with node audit.mjs response.json:

import { readFileSync } from 'node:fs';

const FLAG = {
  PRODUCT: 'productDiscounts',
  ORDER: 'orderDiscounts',
  SHIPPING: 'shippingDiscounts',
};

// Does `from` allow every class that `to` carries?
const allows = (from, to) =>
  to.discountClasses.every((cls) => from.combinesWith[FLAG[cls]]);

// Does `from` list a tag that `to` is tagged with?
const agreesToTag = (from, to) =>
  (from.combinesWith.productDiscountsWithTagsOnSameCartLine ?? []).some((tag) =>
    to.tags.includes(tag),
  );

export function canCombine(a, b) {
  for (const [from, to] of [[a, b], [b, a]]) {
    if (!allows(from, to)) {
      const classes = to.discountClasses.join('+').toLowerCase();
      return { combines: false, why: `"${from.title}" does not allow ${classes} discounts` };
    }
  }
  const both = (cls) => a.discountClasses.includes(cls) && b.discountClasses.includes(cls);
  if (both('SHIPPING')) {
    return { combines: false, why: 'one shipping discount per order' };
  }
  const sameLine = both('PRODUCT') && agreesToTag(a, b) && agreesToTag(b, a);
  return { combines: true, why: sameLine ? 'same line too' : '' };
}

if (process.argv[2]) {
  const { data } = JSON.parse(readFileSync(process.argv[2], 'utf8'));
  const discounts = data.discountNodes.nodes.map((node) => node.discount);
  discounts.forEach((a, i) => {
    for (const b of discounts.slice(i + 1)) {
      const { combines, why } = canCombine(a, b);
      console.log(`${combines ? 'yes' : 'NO '}  ${a.title} + ${b.title}${why ? `  (${why})` : ''}`);
    }
  });
}

With five sample discounts (an order code, an automatic product sale, a free shipping code, a product code and an app discount with two classes) it prints:

NO   WELCOME10 + Winter sale  ("WELCOME10" does not allow product discounts)
yes  WELCOME10 + FREESHIP
NO   WELCOME10 + LOYAL5  ("WELCOME10" does not allow product discounts)
NO   WELCOME10 + Member perks  ("WELCOME10" does not allow order+shipping discounts)
yes  Winter sale + FREESHIP
yes  Winter sale + LOYAL5  (same line too)
yes  Winter sale + Member perks
yes  FREESHIP + LOYAL5
NO   FREESHIP + Member perks  ("FREESHIP" does not allow order+shipping discounts)
NO   LOYAL5 + Member perks  ("LOYAL5" does not allow order+shipping discounts)

The helper encodes three rules. Each side must allow every class the other carries, because the help page says a discount with several classes combines only with discounts that allow all of them. Two discounts that both carry the shipping class are refused, which for an app discount with shipping as one class among several is our assumption, since the page only describes the plain case. And two product discounts are marked for the same line only when the tag rule further down is met.

This is our reading of the documented rules, not Shopify’s own calculation, and it says nothing about minimum spends, customer eligibility or which discount wins when a pair fails.

Why is a code refused alongside an existing discount?

According to the help page, a shopper who enters codes that cannot combine is told the discount could not be used with their existing discounts. The existing discount may be an automatic one they never typed, which is why the audit includes automatic discounts. The page also describes a shipping code being turned down, with a message that the cart already has a better combination, when it cannot combine with a product or order discount already there.

The fix is to change the flag on the side the audit names. For the first line of the output that is the code:

mutation AllowProductDiscounts($id: ID!) {
  discountCodeBasicUpdate(
    id: $id
    basicCodeDiscount: {
      combinesWith: { productDiscounts: true, orderDiscounts: false, shippingDiscounts: true }
    }
  ) {
    codeDiscountNode { id }
    userErrors { field code message }
  }
}

Each of the eight types has its own update mutation, from discountCodeBasicUpdate to discountAutomaticAppUpdate, and each input takes the same combinesWith. We send all three flags because the reference lists false as the default for each and does not say whether an update leaves an omitted flag alone. The schema’s INVALID_COMBINES_WITH_FOR_DISCOUNT_CLASS user error covers a bad pairing, though its description does not say which settings each class rejects.

The help page says editing a discount’s combinations does not alter orders that already used it. On a headless storefront, the Storefront API cart reports discountCodes { code applicable }, and none of the twelve DISCOUNT_ values in the 2026-10 CartWarningCode enum names a combination failure. We have not tested what a non-combining code returns there.

How do app discounts from Functions combine?

App discounts combine by the same flags, and each extra class costs them combinations. A Function discount can carry several classes, discountClasses is required when you create one, and Shopify’s discounts guide says to “Set only the classes that your Function returns operations for”. In the sample output, Member perks carries order and shipping, so WELCOME10 refuses it even though WELCOME10 allows shipping discounts. A class declared just in case is one more flag every other discount has to set.

Functions cannot see each other’s discounts either. The Discount Function API reference says “All discount functions run concurrently, and have no knowledge of each other”, and that their output is combined “in alignment with the combination and stacking rules set on the discount node”. A Function can reject an entered code that is marked rejectable. It cannot change another discount’s amount, targets or settings. The Discounts Allocator Function API, which in the changelog’s words “let an app control how discounts were allocated across cart lines”, will not ship: the guide says its preview “ended on September 10, 2026, and the API won’t be released”. That leaves combinesWith as the control. We cover the settings UI for a discount Function separately.

Can two product discounts apply to the same line?

Only on Shopify Plus, and only with tags, according to the Admin reference. By default one product discount applies per cart line. The 2026-04 reference is the first to list a fourth combinesWith field, productDiscountsWithTagsOnSameCartLine, which holds the tags a discount agrees to share a line with, matched against the other discount’s own tags. The reference puts the rule this way: “Two discounts apply together only if each one allows at least one tag that the other is tagged with.”

In the sample, Winter sale is tagged seasonal and allows loyalty, and LOYAL5 is the reverse, so the helper marks the pair “same line too”. The schema’s error descriptions give a maximum of five tags on a discount and ten in the allowed list, and include PRODUCT_DISCOUNTS_WITH_TAGS_ON_SAME_CART_LINE_NOT_ENTITLED for a shop whose plan does not allow the field. Setting tags in an update overwrites the existing ones. Buy X Get Y discounts stack only on the products the customer gets.

Which combinations should you allow?

We would write the matrix down before a sale and make the audit output match it, reading the “yes” lines as closely as the “NO” lines. A wrongly refused code produces a message at checkout. Two order codes that wrongly combine produce only a lower total, which nobody reports.

Our starting point is that codes combine with shipping discounts, a product sale combines with an order code only where the margin survives both, and order discounts do not combine with each other. Codes that arrived from another platform need checking first, because imported discount codes carry whatever flags the import script set.

With two or three discounts we would skip the script and open the Combinations section. The script is for a long list, or for app discounts whose classes are not obvious from the title.

Whoooop Ltd builds and customises Shopify stores, including the custom features a stock theme leaves out, such as bundles and trade pricing. If discounts are one part of a larger piece of work on your store, our Shopify development service page describes what we take on.

Need this built properly?

Get in touch

Hack the planet!