Guides Fix a problem
How do I block or reject a discount code at Shopify checkout, with a message?
What "reject a code" means
A shopper types a code at checkout. A rejection rule removes it and shows your message, for example This code can't be used with sale items. The code stays valid for everyone else.
Three common asks, and where each is answered below:
- Sale items: "Stop WELCOME10 from stacking on products already marked down." See sale items.
- Wholesale customers: "Wholesale buyers must not use retail codes." See wholesale.
- One use per customer: "A shopper may use WELCOME10 once." See native steps.
What Shopify does on its own, step by step
Shopify's discount settings decide who can use a code and which discounts may stack. They don't reject a code by your own rule (Shopify's discounts FAQ, checked November 7, 2026). These desktop steps give you the closest native control, one use per customer:
- From your Shopify admin, go to Discounts, click Create discount, and in the Select discount type menu click Amount off products or Amount off orders.
- Under Method, choose Discount code and type a code, for example WELCOME10.
- Under Value, choose Percentage or Fixed amount and enter the amount.
- Under Maximum discount uses, check Limit to one per customer. Shopify tracks the customer's email address or phone number.
- To also cap total redemptions, check Limit number of times this discount can be used in total. Setting 200 allows 200 uses across all customers.
- Under Eligibility, choose who can use the code: All customers, Specific customers, Customer segments or Markets.
- Click Save, then test the code at checkout.
Each item links the Shopify page it comes from (checked November 7, 2026).
Shopify can
- Limit a code to one use per customer, or to a total number of uses. Source: help.shopify.com
- Make a code available only to all customers, specific customers, customer segments or markets. Source: help.shopify.com
- Accept up to 5 product or order discount codes and 1 shipping discount code on the same order. Source: help.shopify.com
- Reject a typed code with a custom message through a discount Function, which an app or a custom app provides. Source: help.shopify.com
- Run a public app's Functions on any Shopify plan. Source: shopify.dev
Shopify can’t
- Reject a typed code by a rule of your own from the admin. Shopify points to a third-party app or a custom app. Source: help.shopify.com
- Lower the 5-code limit. Shopify's combinations page states the limit and describes no setting to change it. Source: help.shopify.com
- Reject codes with a Function unless the Function is backed by an automatic discount. Source: shopify.dev
- Let custom apps contain Functions unless the store is on Shopify Plus. Source: shopify.dev
Keep codes off sale items
Shopify has no setting that reads a product's compare-at price. For a product discount you can build a workaround from Shopify's collection conditions:
- Create an automated collection with the condition Compare at price is not set. With the standard Products source, it holds every product where at least one variant has no compare-at price. A compare-at price of $0.00 counts as set.
- In the product discount, set Applies to to Specific collections and pick that collection.
- Save. The code now skips products whose variants all have a compare-at price.
Two limits. A product that mixes marked-down and full-price variants stays in the collection, so the code can still hit its marked-down variants. And an order discount applies to the whole order, so it can't use a collection at all.
Discount Genie covers the order-discount gap with a different test: reject the code whenever the cart holds an item from a sale collection. See the Discount Genie steps. The rule rejects the whole code, not only the sale lines.
Discount Genie's rejection rules don't check compare-at prices. You fill a collection with your sale items, and the rule checks the cart against that collection.
Keep wholesale customers off retail codes
Shopify lets you include customers in a code, not exclude them. The native workaround is a customer segment on every retail code:
- Create a customer segment with the filter customer_tags NOT CONTAINS 'wholesale' (Shopify segment filters).
- Open each retail code, and under Eligibility choose Customer segments and add that segment.
You repeat step 2 for every code, including codes you create later. Discount Genie reverses this: one rule rejects any retail code when the shopper has the wholesale tag.
Reject codes with Discount Genie
Discount Genie is a Shopify discount app by Shopstack, built on Shopify Functions. Each rejection rule runs as a Shopify discount Function in a public app, so it works on any plan, not only Plus. Rejection rules are available on the basic free plan, which covers up to 3 basic discounts.
- In Shopify admin, open Discount Genie and click Rejection rules, then click Create rejection rule.
- In Rule title, name the rule. Shoppers never see it.
- Under Code rejection rules, choose what to reject:
- Limit codes in cart, then Choose option: No codes allowed, or Allow specific quantity and enter a Number of codes allowed.
- Reject codes based on title matching rules: match the code text with equals, starts with, ends with, contains, or their opposites, joined with And or Or. Under When several codes match, choose Reject all matching codes or Keep only the newest matching code.
- Under Set a target audience, limit the rule to some shoppers, for example the Tags condition with wholesale. A rule with customer conditions skips shoppers who aren't logged in, so guests are not rejected.
- Under Set cart qualifiers, limit the rule to some carts. Choose Has specific collection, pick your sale collection, set Based on to Quantity, Condition to Greater than or equals, and enter 1.
- Under Set reject message, write the message. Type {rejected_codes} where you want the rejected code names to appear.
- Save the rule, make sure it is active, and test it with real codes at checkout.
Which qualifiers appear: the target audience offers Email and Tags plus customer segments and specific customers. The cart qualifiers include Shopify market, Has product, Has specific collection and Cart has code.
Rejection rules act only on codes Shopify marks as rejectable. Shopify shows your message as a warning banner at checkout (Shopify's discount rejection tutorial). A rule is saved as an automatic discount, so it counts toward Shopify's limit of 25 active automatic discounts (Shopify discount combinations).
Worked examples
- Block every code on Black Friday. Limit codes in cart, No codes allowed, message Today's sale is already applied. Codes are paused. A shopper who types WELCOME10 sees the message, and the sale price stays.
- At most 2 codes. Allow specific quantity 2. A shopper enters A, B, C, D. Discount Genie keeps the first two codes it receives, A and B, and rejects C and D. Shopify alone accepts up to 5 codes, if their Combinations settings allow it.
- One influencer code. Title matching, Starts with INF, Keep only the newest matching code, 1. A shopper enters INF-ANA, then WELCOME10, then INF-BO. Of the matching codes Discount Genie receives, the last counts as the newest: INF-BO stays, INF-ANA is rejected, and WELCOME10 is never counted because it doesn't match.
- Wholesale. Target audience Tags wholesale, title matching Starts with RETAIL. A tagged, logged-in shopper who enters RETAIL15 is rejected. A guest checkout is not.
Setups to copy
- Sale-items block. Title matching Equals WELCOME10, cart qualifier Has specific collection "Sale items", Quantity greater than or equals 1, message WELCOME10 can't be used on sale items. The rule rejects WELCOME10 only when the cart holds a sale item.
- Influencer cap plus sale block. Two rules: one keeps a single INF code per order, one rejects WELCOME10 when the cart holds a sale item.
Stop a leaked or reused code

Most code abuse is one of three things, and each has its own control:
- One shopper reusing a code: Shopify's Limit to one per customer, in the steps above.
- Several codes stacked: a Discount Genie rule with Allow specific quantity, or the INF example in the worked examples.
- A code that leaked to a coupon site: a rule that matches the code with Equals and rejects it. Anyone who types it sees your message, and you keep the code in Shopify until you retire it.
Test it before launch
Place a test order for each rule with your real codes:
- A cart that should be rejected: expect the banner with your message and no discount from that code.
- A cart that should pass: expect the code to apply normally.
- A logged-out cart for any rule with customer conditions: expect no rejection.
- Several codes in one cart: check which code stays.
Shopify vs Discount Genie for rejecting codes
| Need | Shopify alone | Discount Genie rejection rules |
|---|---|---|
| Reject a typed code with your own message | No admin setting; Shopify's help says a third-party app or a custom app | Yes, you write the message |
| Block every code during a sale | No | Yes, No codes allowed |
| Allow fewer than 5 codes per order | No setting documented | Yes, Allow specific quantity |
| Keep a code off sale items | Collection workaround for product codes only | Reject when the cart holds an item from a sale collection |
| Keep wholesale customers off a code | A segment on each code | One rule with a customer tag |
| One use per customer | Yes, Limit to one per customer | No; use Shopify's setting |
| Price | Included with Shopify | Basic free plan (up to 3 basic discounts) |
FAQ
Can Shopify reject a discount code and show a custom message without an app?
Not from the admin. Shopify's help says to use a third-party app or a custom app that removes the code and shows a custom message (Shopify help). The app uses a discount Function.
Can I use rejection rules on a plan below Shopify Plus?
Yes. A public app's Functions run on any Shopify plan. Only custom apps that contain Functions are limited to Plus (Shopify developer docs).
Can a rule make a code skip only the sale items?
No. A rejection rule removes the whole code. To keep a code off specific products, use the collection workaround for product discounts in the sale items section.
Can a rejection rule stop a customer who already used a code once?
No. Discount Genie's customer conditions don't read order history: total spent and order count aren't supported. Use Shopify's Limit to one per customer setting (Shopify help).
Is a rejection rule free in Discount Genie?
Yes. Rejection rules are available on the basic free plan, which covers up to 3 basic discounts.
Related
- Shopify discount code not working: reasons and fixes
- Exclude products and sale items from a discount code
- Combine and stack discounts on Shopify
- Discounts by customer tag on Shopify
- Black Friday 2026 discount checklist for Shopify
- Cap a Shopify discount at a maximum amount
- Discount code rejection rules (Discount Genie docs)
- Best Shopify discount apps (2026)
- Best Shopify apps to block or limit discount codes
