> ## 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 with cart rules

> In Smarty, start from Discount code rejection (Create discount → Select discount type). It prevents selected discount codes from applying when cart and checkout conditions match, and shows a custom checkout message. Billing/tier limits: **[Plans](../plans)**. Same condition names as other types: Field conditions.

<Note>
  **Full setting encyclopedia:** [Features](../features) · **Condition names:** [Field conditions](../field-conditions)
</Note>

<Tip>
  This type follows your shop **billing** tier — **[Plans](../plans)**. You may see **New** on this row while the feature rolls out broadly.
</Tip>

## 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**](../features#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](index).

## Rule versions

[**Rule version**](../features#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**](../import-export-rules) / **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**](../how-the-app-works#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**](../create-discount#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.

## 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](../match-your-sale).
