Reject discount codes with conditions
Discount rejection lets a discount code fail at checkout when your conditions match. Use it when a code is shared beyond the people it was meant for, such as a welcome code used by returning customers.
Create a discount rejection rule
- Go to Checkout rules → Add a rule and pick Discount rejection.
- Enter a Rule name.
- Under Choose a discount code, pick the codes this rule applies to (marker 1).
- Set the conditions under When should this rule run? (marker 2).
- Write the Error message customers see (marker 3). The default is "This discount code isn't valid for your order."
- In the Rule summary card, choose Active or Draft, then click Save in the save bar.

When the conditions match, the code is rejected and the customer sees your message.
Things to know
- Manage your discount codes in Shopify admin under Discounts. Blockly only picks existing codes.
- "Automatic discounts aren't supported here. You can only pick discount codes."
- The message can be up to 255 characters. It can't be translated.
- Discount rejection rules have only Active and Draft. There's no Test mode, so try the rule on a development store or with a code only you know.
- Each rule is created as an automatic discount in Shopify Discounts. Don't delete it there, or the rule stops working. It also counts toward Shopify's cap on active automatic discounts.
Available conditions
| Group | Conditions |
|---|---|
| Popular | Always, Customer email, New customer, Cart quantity |
| Customer | Customer email, Customer tag |
| Cart | Cart subtotal, Cart quantity, Cart weight |
| Product | Product, Product quantity, Collection, Collection product quantity, Collection value, Product SKU, SKU quantity, Product tag, Product vendor |
| Date and time | Hour, Weekday, Hour and weekday |
Examples
- Welcome code for first orders only: New customer, Is not. This condition has no value field. Is not means a returning customer. Code
WELCOME10. - No discount on sale items: Collection, Contains, your Sale collection.
- Minimum cart for a code: Cart subtotal, Less than,
50. Message: "Add $50 or more to use this code." - Weekend-only code: Weekday, Between, Monday and Friday, so the code is rejected on weekdays.