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

# Reject Discount Codes

> Advanced Rules template for rejecting specific discount codes when custom conditions are met in AIOD.

Use **Reject Discount Codes** when a merchant wants AIOD to block specific discount codes after matching rule conditions are met.

This template is inside the **Advanced Rules** parent template. In Shopify admin, open **Apps** > **AIOD Discount & Gift** > **Discount Templates**, click **Create** on **Advanced Rules**, then choose **Reject Discount Codes** on the **Select type** page.

The parent card says: "Create custom logic and complex promotions." The parent example shown in AIOD is "Get 20% off shirts, free gift and free shipping."

The inner template card says: "Reject specific discount codes when the rules are met."

## When to use this template

Use this template for:

* Blocking one or more discount codes for a matching cart.
* Preventing a code from being used by certain customers.
* Rejecting codes when a cart contains specific products, collections, variants, purchase types, or destinations.
* Rejecting codes based on cart subtotal, cart quantity, order weight, customer tags, past order count, login status, or customer email.

Use **Custom Rule Builder** instead when the merchant wants to create a discount, not reject discount codes.

## Related Advanced Rules templates

The **Advanced Rules** parent opens two inner templates:

| Inner template            | Use it for                                                                     |
| ------------------------- | ------------------------------------------------------------------------------ |
| **Custom Rule Builder**   | Build a custom discount with flexible conditions, targets, values, and limits. |
| **Reject Discount Codes** | Reject specific discount codes when matching conditions are met.               |

## Top-level controls

The form includes:

* **Use Custom Rule Builder** shortcut.
* **Discount ID (For your reference)** with placeholder `eg: GET 20% OFF`.
* **Select Discount Codes To Reject**.
* **When To Reject Discount Codes**.
* **Active Dates**.

### Status mode

The top-right status dropdown controls who can use or see the discount.

| Status       | Meaning                                                                                |
| ------------ | -------------------------------------------------------------------------------------- |
| **Live**     | The discount is active for customers.                                                  |
| **Testing**  | The discount is visible to the merchant for testing, but it is not live for customers. |
| **Deactive** | The discount is turned off.                                                            |

## Select discount codes to reject

The **Select Discount Codes To Reject** section controls which codes AIOD should reject.

Controls:

* **Add Code** text input with placeholder `Enter discount code`.
* **Add Code** button.

The **Add Code** button was disabled in the observed empty state. Enter a code first, then add it to the rejection list.

Use this section for the exact discount codes the merchant wants to block.

## When to reject discount codes

The **When To Reject Discount Codes** section controls when AIOD rejects the selected codes. The default is **Always**.

Click the condition button to choose a trigger.

| Category           | Trigger                          | AIOD description                                                |
| ------------------ | -------------------------------- | --------------------------------------------------------------- |
| General            | **Always**                       | This discount is always applied.                                |
| Cart/Order Details | **Cart Subtotal Amount**         | Applied based on the subtotal value of products in the cart.    |
| Cart/Order Details | **Order Weight**                 | Applied based on the total weight of products in the cart.      |
| Cart/Order Details | **Cart Quantity**                | Applied based on the number of items in cart.                   |
| Product Details    | **Product**                      | Applied based on specific products added to the cart.           |
| Product Details    | **Collection**                   | Applied based on specific collection items added to the cart.   |
| Product Details    | **Variant**                      | Applied based on specific variants added to the cart.           |
| Product Details    | **Variant Whose Metafield**      | Applied based on all variants whose metafield matches the rule. |
| Product Details    | **Purchase Type**                | Applied based on subscription or one-time purchase items.       |
| Shipping Address   | **Country**                      | Applied based on the entered shipping destination country.      |
| Customer Details   | **Customer Tags**                | Applied based on specific tags assigned to the customer.        |
| Customer Details   | **Number of past orders**        | Applied based on number of past orders placed by customer.      |
| Customer Details   | **Customer Should Be Logged In** | Applied only if the customer is logged in.                      |
| Customer Details   | **Customer Email**               | Applied based on the customer's email.                          |

The condition picker is the same style used by **Custom Rule Builder**.

## Active dates

The **Active Dates** section controls when the rejection rule starts and ends.

Default fields:

* Start **Date**
* Start **Time**

Enable **Set end date** to reveal end date and time fields.

## Save

Click **Save** after adding the discount codes to reject, choosing the rejection condition, and setting active dates.

The form shows **Rule Size** and a Shopify limit note. In the observed form, the rule size was shown against a `10 KB` Shopify limit.
