> ## Documentation Index
> Fetch the complete documentation index at: https://neezon.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Shopify discount code rejection: block codes by cart rules

> Discount code rejection in Smarty declines matching codes at checkout when your cart or customer rules pass, and shows your own message. Pro plan.

> [!NOTE]
>
> **Full setting encyclopedia:** [Features](https://neezon.com/docs/smarty-discounts/features.md) · **Condition names:** [Field conditions](https://neezon.com/docs/smarty-discounts/field-conditions.md)

> [!TIP]
>
> This type follows your shop **billing** tier — **[Plans](https://neezon.com/docs/smarty-discounts/plans.md)**. You may see **New** on this row while the feature rolls out broadly.

## What this type does (and does not do)

This type does **not** apply a dollar or percentage savings. Shopify lists it under **automatic** promotions in Admin, but the behavior at checkout is: when a shopper enters a discount code your rules cover, Shopify can **decline that code** and show **your message** instead of applying whatever discount was attached to it.

Typical reasons merchants use it:

| Goal | Idea |
| - | - |
| **Whitelist-style control** | Block **VIP** codes outside a customer segment or geography. |
| **Stop abuse on certain carts** | Reject stacked or wholesale codes unless the cart qualifies. |
| **Clear storefront messaging** | Replace a generic Shopify error with a **short**, **locale-aware** explanation (up to **120 characters** per message in the editor). |

## What you configure (editor areas)

Smarty organizes the builder into **rejection rules**. Each rule has four parts:

| Area | What it controls |
| - | - |
| **Code match** | **Operator** (is, is not, contains, starts with, …) plus one or **more entered strings** treated as promo **codes** / substrings depending on the operator (case-insensitive matching at checkout). |
| **Conditions** | A nested **rule tree** — same kinds of cart, customer, product, shipping, etc. fields as elsewhere, scoped by [**Rule version**](https://neezon.com/docs/smarty-discounts/features.md#rule-version). Optional: if empty or always “true”, the code match alone triggers rejection when the shopper applies the code. |
| **Checkout message** | Text shown when this rule rejects a code. Add **translations** per published **storefront language** (from Shopify Admin, same locale list the app surfaces when editing). Checkout picks the closest match for the buyer’s locale. |

You can **add multiple rules**. At checkout, for each entered code that Shopify marks as eligible to evaluate, rules are checked **in order** — the **first** rule whose code match **and** conditions both pass is what applies (**one rejection per qualifying code**, then the evaluator moves on).

**Not shown for this type:** **Discount method** (always automatic workflow for this Shopify function shape), discount **value**, **Combinations**, and the usual BXGY/product **apply** flows — compare [Pick a discount type](https://neezon.com/docs/smarty-discounts/discount-types/index.md).

## Has another code

Use this to match another discount code on the cart.

## Rule versions

[**Rule version**](https://neezon.com/docs/smarty-discounts/features.md#rule-version) works like other advanced types: switching version changes **which condition fields** appear (Standard, Customer / Cart, Company on **Shopify Plus** setups, Product / Line, or shipping-augmented sets). If you change version **while drafting** (not editing an existing discount), Smarty resets **conditions** inside each rule while keeping codes and messages so you avoid carrying incompatible trees across versions — same pattern as rebuilding condition trees elsewhere.

**Shopify Plus** shops can expose the **company** rule tier in more presets; other plans still use **Customer**, **Product / Line**, and shipping-augmented **Standard** where the app enables them.

## Import, export, and dashboard

[**Import rule**](https://neezon.com/docs/smarty-discounts/import-export-rules.md) / **Export rule** work for **Discount code rejection** the same as for shipping and other types with export support: exports include your rule structure; importing into another shop may require **re-linking** product, collection, and customer references — see that guide.

On the [**discount list**](https://neezon.com/docs/smarty-discounts/how-the-app-works.md#dashboard-home), Type shows **Discount code rejection** beside other Smarty-created discounts.

## Use cases → what to set

| Your goal | Start with |
| - | - |
| **Block `WHOLESALE` outside B2B** | One rule: code operator **is** / **starts with**, list the code(s); **Conditions** → company or customer tags. |
| **Generic “not valid today” messaging** | One rule covering the code substring; narrow **Conditions** by **cart subtotal** or **country** so other carts still redeem the original discount. |
| **Localized storefront copy** | **Checkout message**: add rows for secondary languages your shop publishes. |

Always run a [**checkout test**](https://neezon.com/docs/smarty-discounts/create-discount.md#save-and-test): apply a matching code **with** a cart that satisfies the rule, then retry with a cart that **should** still allow the code.

## Quick answers

### How do I block a discount code on Shopify for some carts or customers?

Create a **Discount code rejection** discount (**Pro** plan) and add a rule with a **code match** (for example **is** or **starts with** plus the code), **Conditions** such as customer tags, company, cart subtotal, or country, and a **checkout message**. When a shopper enters a matching code and the conditions pass, Shopify declines the code and shows your message.

### Does discount code rejection give shoppers a discount?

No. It applies no savings; it only declines the codes your rules match and shows your message (up to 120 characters per language).

### What happens if more than one rejection rule matches?

Rules are checked in order, and the first rule whose code match and conditions both pass rejects the code. Each qualifying code is rejected once.

## When another type fits better

If you wanted to **apply** savings instead of **blocking** a code, choose **Amount off order**, **product**, **shipping**, or **BXGY** depending on whether the lever is cart total, products, shipping, or buy‑get bundles — [Match your sale](https://neezon.com/docs/smarty-discounts/match-your-sale.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.