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

# Buy X Get Y

> Create BOGO, mix-and-match, and fixed-price bundle offers on Shopify through an AI agent connected to AIOD.

An AI agent connected to AIOD can set up buy-X-get-Y promotions: BOGO, buy-one-get-one-half-price, mix-and-match, and bundles sold at one flat combined price.

## Just ask

<CodeGroup>
  ```text You theme={null}
  Buy one t-shirt, get one 50% off.
  ```

  ```text You theme={null}
  Buy 2 pairs of socks, get the third free.
  ```

  ```text You theme={null}
  Buy any hoodie, get 20% off any beanie.
  ```

  ```text You theme={null}
  Any 3 items from the Sale collection for $99.
  ```

  ```text You theme={null}
  Mix and match: buy 2 from Outerwear, get 1 from Accessories free.
  ```
</CodeGroup>

## Which template gets used

| Template           | When                                                                                                                                                                               |
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `bxgy`             | The shopper adds both the qualifying item and the reward item themselves, and the reward is a price cut on a line already in the cart — percentage off, amount off, or fully free. |
| `bxgy_fixed_price` | A set of items sold together at one flat combined price, like "any 3 for \$99".                                                                                                    |

Merchant-facing settings: [Buy X Get Y (Discount)](/docs/templates/buy-x-get-y-discount) and [Buy X @ Fixed Price (Discount)](/docs/templates/buy-x-fixed-price-discount).

<Note>
  If the reward item is **added by the app** or picked from a gift picker rather than by the shopper, it's a gift, not a BOGO. See [Free gifts](/docs/mcp-server/use-cases/free-gifts). AIOD has a [Buy X Get Y (Gift)](/docs/templates/buy-x-get-y-gift) form in the app for exactly that.
</Note>

## What the agent does

1. Reads the `bxgy` or `bxgy_fixed_price` contract.
2. Confirms the shopper adds every line. If not, it switches to a gift template before writing anything.
3. Sets the buy side: which items qualify, and how many.
4. Sets the get side: which items get discounted, by how much, and how many units per qualification.
5. Drafts it and hands you a link.

## Worth knowing

* **The counting is the tricky part.** When the qualifying and rewarded items are the *same* thing — "buy 2 get 1 free on t-shirts" — the rule needs a quantity of **3**, not 2: two paid, plus the next one discounted. When they're different things, the quantity is just the buy-side count.
* **Repeating is a choice.** "Buy 2 get 1 free" can apply once per cart or once per group of three. If you don't say, a good agent will ask.
* **Nothing is auto-added.** Every line in a BOGO is one the shopper put there.
