Discount codes on subscriptions: combinesWith ignored, once-per-customer bypassed, deleted codes still billed

Subscription contracts ignore discount combination settings, and recurring orders don’t count as code uses

We build a subscription app on the Admin GraphQL API (2026-07). On our merchants’ stores, customers ended up with several discount codes on one subscription that, by their own settings, may not be combined. Others re-used “once per customer” codes. We tested on a development store (test payments) where Shopify checks discount codes during a subscription’s life.

Summary

  1. Checkout enforces the combination settings (“Combines with”): of codes that don’t allow each other, only one applies.
  2. Creating or updating a subscription contract checks a code’s eligibility (dates, status, customer, products, minimum, uses at checkout), but never its combination settings, and doesn’t count recurring orders as uses.
  3. Billing attempts check nothing: every code on the contract is applied to the order, including codes that were deleted, expired or deactivated after they were added.

So a customer can put codes on a subscription that checkout would never let them combine, and gets all of them on every recurring order.

Setup

All codes: available on subscriptions, recurring cycle limit 10, no minimum, all customers.

Code Discount Class Combines with
product_off 10 % off products (collection “All products”) Product nothing
order_off €10 off the order Order nothing
order_off_5 5 % off the order Order nothing
free_shipping free shipping Shipping nothing
TFCOMB-PRODUCT-1001 (control) 10 % off products Product order, shipping
TFCOMB-ORDER-1001 (control) €3 off the order Order product, shipping

One product (€9.99, weekly selling plan with 20 % off), quantity 2, shipping €4.90.

How each point was tested:

  • Checkout: the Online Store cart, POST /cart/update.js with {"discount": "code1,code2"}. Shopify answers per code in discount_codes[].applicable.
  • Subscription create: subscriptionContractAtomicCreate with discountCodes.
  • Subscription update: subscriptionContractUpdate, then subscriptionDraftDiscountCodeApply per code, then subscriptionDraftCommit.
  • Billing attempt: subscriptionBillingAttemptCreate on the updated contract, then the order’s discountApplications.

“Accepted” below means: no userErrors, no rejectionReason, and the contract carries the code afterwards.

Test 1: combinations (2026-10-01)

Codes Settings allow them together? Checkout (cart) Subscription create Subscription update Billing attempt (order)
product_off (single) applies accepted accepted applied, −€1.58
order_off (single) applies accepted accepted applied, −€10.00
free_shipping (single) applies accepted accepted applied, shipping −€4.90
product_off + order_off no only order_off applies both accepted both accepted both applied, −€11.58
order_off + order_off_5 no only order_off applies both accepted both accepted both applied, −€10.29
product_off + free_shipping no only product_off applies both accepted both accepted both applied, −€6.48
order_off + free_shipping no only order_off applies both accepted both accepted both applied, −€14.90
all four no only order_off applies all four accepted all four accepted all four applied, −€16.70
TFCOMB-PRODUCT-1001 + TFCOMB-ORDER-1001 yes both apply both accepted both accepted both applied, −€4.58

Test 2: eligibility (2026-09-30)

The second column adds a code that is already invalid. The third column adds a valid code, makes it invalid in the admin, and then bills the subscription.

The code … Adding it (subscriptionDraftDiscountCodeApply) Next billing attempt after it became invalid
is expired, not started yet, or deactivated refused: CURRENTLY_INACTIVE still applied
needs a minimum subtotal that isn’t met refused: PURCHASE_NOT_IN_RANGE still applied (minimum raised)
is limited to other customers refused: CUSTOMER_NOT_ELIGIBLE still applied
is limited to other products refused: NO_ENTITLED_LINE_ITEMS not tested
is for one-time purchases only refused: NO_ENTITLED_LINE_ITEMS still applied
is once per customer and was used on a regular order refused: CUSTOMER_USAGE_LIMIT_REACHED still applied
reached its usage limit through a regular order refused: USAGE_LIMIT_REACHED still applied
is once per customer and was used on recurring orders only accepted –
was deleted – still applied

Notes:

  • “Refused” means the mutation returns no userErrors; the problem only shows in appliedDiscount.rejectionReason. We did not commit those drafts.
  • “Regular order” in this test means an order created with orderCreate and the code, because our app can’t create checkouts or draft orders.
  • After two recurring orders with a once-per-customer code, the code’s asyncUsageCount was still 0 (each regular order counted 1), and Shopify accepted the code again for the same customer.
  • The subscription’s own copy of the code does count its uses (usageCount, for the recurring cycle limit). But a removed and re-added code is a new copy that starts at 0 again.

Questions

  1. Is it intended that subscriptionContractAtomicCreate and subscriptionDraftDiscountCodeApply ignore combinesWith, while checkout enforces it? If yes, is there an API that evaluates a set of codes the way the cart does (applicable per code), so apps can apply the same rules?
  2. Should recurring orders count towards “Limit to one use per customer” and the total usage limit?
  3. Is it intended that billing attempts keep applying codes that were deleted, expired or deactivated after they were added?
  4. Does the subscription contract calculation API in 2026-10 change any of this?

What we do in the meantime

Before our app puts a code on a subscription, it:

  • reads the code’s settings (codeDiscountNodeByCode: appliesOncePerCustomer, usageLimit, discountClasses, combinesWith)
  • counts the customer’s orders that carried the code. We read every order’s discountApplications, because the order search discount_code: only matches an order’s first code.
  • refuses the code when its settings don’t allow it, using the same combination rule as checkout: each code must allow the other’s class.

Hi @Fabian_Bosler, I had a look into this for you internally.

On combinations the docs only say a code discount is verified when it’s first applied, either at checkout or when added to an existing contract, and that those conditions aren’t re-evaluated afterward (About subscription contracts). Whether combinesWith is supposed to be checked at apply time isn’t stated anywhere public, so I’ve asked the team that owns the subscriptions API to confirm, including your usage-count observation. The documented behavior is that a code’s usage count increases when it’s saved to the subscription and doesn’t decrease on removal but that’s counter to what you describe, so will confirm.

Expired and deactivated codes continuing to bill is expected. The contract stores a snapshot of the discount that’s independent of the original code, and the recurring payments setting is the only automatic cycle limit (Subscription discounts). Removing a discount from existing contracts is done through your app with subscriptionDraftDiscountRemove and subscriptionDraftCommit.

The newer SubscriptionContractCalculation API replaces the draft mutations and resolves submitted codes during calculation, but I can’t confirm it changes combination or usage enforcement. I’ll report back here when I hear from the team.

Hi @Fabian_Bosler, I heard back from the team that owns the subscriptions API, and your testing was accurate on every point.

On combinations, the legacy subscriptionContractAtomicCreate and draft-update flows evaluate each code independently, so codes that are not allowed to combine can both be saved and billed. The SubscriptionContractCalculation API is the path that evaluates submitted codes together. If codes cannot combine, only the best discount is committed and the others come back with a DISCOUNT_CODE_NOT_APPLIED warning.

For the usage count, saving a discount on a contract does count toward the code’s global usage limit, but asyncUsageCount only reports order-backed usage, so a 0 there does not mean the limit was bypassed. The contracts guide covers the save-time counting.

On once-per-customer, the check looks at previous orders and checkout reservations, but not discounts already saved on contracts, so one customer can attach the same code to multiple contracts. Your app-side check is a sensible guard for that.

Finally, with regard to deletion, it behaves the same as expiry or deactivation. The saved snapshot stays on existing contracts until your app removes it with subscriptionDraftDiscountRemove and subscriptionDraftCommit.

Thanks for your patience while I looked into this for you!