> ## 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.

# Conditional discounts

> Create Shopify discounts gated by customer, country, date, or cart contents — and exclude products and collections — through an AI agent connected to AIOD.

An AI agent connected to AIOD can build promotions that only apply when something is true: about the cart, the customer, the destination, or the date. It can also exclude products and collections, schedule promotions, and block specific discount codes.

## Just ask

<CodeGroup>
  ```text You theme={null}
  10% off, but only for customers tagged VIP.
  ```

  ```text You theme={null}
  Free shipping over $75, Canada only.
  ```

  ```text You theme={null}
  20% off the Winter collection, excluding anything already on sale.
  ```

  ```text You theme={null}
  15% off for subscription orders only.
  ```

  ```text You theme={null}
  Run the Black Friday sale from November 27 to December 1.
  ```

  ```text You theme={null}
  Block the code WELCOME10 when the cart already has a bundle in it.
  ```
</CodeGroup>

## What a condition can check

| Kind                | Examples                                                   |
| ------------------- | ---------------------------------------------------------- |
| Cart value and size | Cart subtotal, cart quantity, item subtotal, item quantity |
| Catalog             | Specific products, variants, or collections in the cart    |
| Customer            | Customer tags and customer segments                        |
| Geography           | Market and location                                        |
| Purchase type       | One-time versus subscription                               |
| Schedule            | Start and end dates                                        |

Conditions combine with AND and OR, so several can apply at once.

## Which template gets used

| Template            | When                                                                                         |
| ------------------- | -------------------------------------------------------------------------------------------- |
| `custom_discount`   | The general-purpose builder — any real eligibility rule, or several targets in one discount. |
| `combined_discount` | Several tiers, each with its own condition and its own reward kind.                          |
| `custom_shipping`   | The reward is shipping, gated by cart, customer, or destination.                             |
| `reject_codes`      | Blocking named discount codes when conditions are met. It gives no reward of its own.        |

Merchant-facing settings: [Custom Rule Builder](/docs/templates/custom-rule-builder), [Combined Multi Discounts](/docs/templates/combined-multi-discounts), [Shipping Discount](/docs/templates/shipping-discount), [Reject Discount Codes](/docs/templates/reject-discount-codes).

## Two kinds of exclusion

These sound the same and aren't:

* **Excluding items from the reward** — those items don't get discounted.
* **Excluding items from the condition** — those items don't count toward the threshold that unlocks the discount.

"Spend $100 excluding sale items, get 10% off" is the second one: sale items must not count toward the $100. A good agent will check which you meant if it's ambiguous.

## Customer-specific offers

Customer tags and segments are just conditions, so a VIP-only or wholesale-only discount is an ordinary conditional discount. Nothing special is needed.

## Scheduled promotions

Dates are part of the discount, so a seasonal sale can be built now and dated for later. It still has to be switched on by a person before real shoppers see it.

## What the agent does

1. Reads the template contracts **and** the condition syntax — the contracts alone don't cover how conditions are written.
2. Separates the gate from the target: the condition decides *whether* the discount applies, the reward decides *what* gets discounted.
3. Keeps the reward type consistent — one rule can't mix product, order, and shipping rewards. Several reward kinds in one offer means `combined_discount`.
4. Drafts it. Conditions are cart-simulated, so a rule that would never fire gets caught before you see it.

## Worth knowing

* **Conditions are simulated, not just validated.** AIOD runs the merged rule against a test cart, which catches shapes that pass a schema check but wouldn't actually work.
* **One rule, one discount type.** All product-level, all order-level, or all shipping.
* **`reject_codes` gives nothing.** It only blocks the codes you name, when your conditions are met.
