New: Blockly Checkout Customizer is live — checkout rules, upsells & checkout analytics.Install free
HomeHelp CenterCheckout CustomizerReject discount codes with conditions

Reject discount codes with conditions

Blockly Checkout Customizer Updated November 24, 2026

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

  1. Go to Checkout rules → Add a rule and pick Discount rejection.
  2. Enter a Rule name.
  3. Under Choose a discount code, pick the codes this rule applies to (marker 1).
  4. Set the conditions under When should this rule run? (marker 2).
  5. Write the Error message customers see (marker 3). The default is "This discount code isn't valid for your order."
  6. In the Rule summary card, choose Active or Draft, then click Save in the save bar.
Discount rejection rule for WELCOME10 when the customer is not new
Pick the code (1), set the condition (2) and write the message (3).

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

GroupConditions
PopularAlways, Customer email, New customer, Cart quantity
CustomerCustomer email, Customer tag
CartCart subtotal, Cart quantity, Cart weight
ProductProduct, Product quantity, Collection, Collection product quantity, Collection value, Product SKU, SKU quantity, Product tag, Product vendor
Date and timeHour, 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.