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

# Limit an automatic discount to once per customer

> Use an AIOD customer-tag condition and Shopify Flow to make one automatic promotion available only once to each customer.

Shopify automatic discounts do not include a native per-customer redemption limit. In AIOD Discount & Gift, use a customer tag and Shopify Flow to make one automatic promotion available only once to each customer.

This setup has two parts:

1. AIOD applies the discount only when the customer does not have a promotion-specific tag.
2. Shopify Flow adds that tag after the customer places an order that used the promotion.

Once Shopify Flow adds the tag, AIOD no longer considers that customer eligible for the same promotion.

## Example: one-time 15% automatic discount

For a one-time 15% welcome promotion, give the AIOD discount a unique, stable title such as `AIOD Welcome 15`. Create a customer tag such as:

`AIOD_USED_WELCOME15`

Your eligibility logic is:

`Customer does not have AIOD_USED_WELCOME15` → apply 15% discount

The customer does not enter a discount code. AIOD applies the automatic discount when the customer is eligible. After the customer places a qualifying order, Shopify Flow matches the recorded discount title and adds `AIOD_USED_WELCOME15`. On the customer's next order, the AIOD condition fails and the discount does not apply.

## Step 1: Create the automatic discount in AIOD

1. In Shopify admin, open **Apps** > **AIOD Discount & Gift** > **Discount Templates**.
2. Choose the template that fits the promotion. Use **Advanced Rules** > **Custom Rule Builder** when you need a customer-tag condition. See [Custom Rule Builder](/docs/templates/custom-rule-builder) for its available conditions.
3. Configure the discount as an automatic discount, such as 15% off.
4. In the customer condition or eligibility area, add a **Customer Tags** condition.
5. Choose the negative tag operator, such as **does not match any of**.
6. Enter `AIOD_USED_WELCOME15`.
7. Save and activate the discount.

Replace `AIOD_USED_WELCOME15` with a unique tag for your promotion.

## Step 2: Create the Shopify Flow workflow

In Shopify Flow, create a workflow with this structure:

`Order created` → check whether the discount title is `AIOD Welcome 15` → add `AIOD_USED_WELCOME15` customer tag

1. Choose **Order created** as the trigger.
2. Add a condition that checks the order's recorded **discount title** for your promotion identifier. For this example, use `AIOD Welcome 15`.
3. Add the **Add customer tags** action.
4. Add the tag `AIOD_USED_WELCOME15`.
5. Turn on the workflow.

This workflow does not require a code-based discount. The discount title is how Shopify Flow recognizes that the automatic promotion was applied. Use a title that uniquely identifies the promotion. Do not use a generic title that could match another active discount.

For example, if the promotion is "Buy a printer, get Spectrajet Paper," give the automatic AIOD discount a stable, unique title such as `AIOD Printer + Spectrajet Paper`. Shopify Flow can then match that title and add the promotion tag after the order.

## What happens after setup

For a customer's first eligible order:

`No tag` → `AIOD discount applies` → `Order placed` → `Flow adds tag`

For future orders:

`Tag exists` → `AIOD condition fails` → `Discount does not apply`

## Important limitations

### The customer must be identifiable

This approach works best when Shopify can identify the customer, such as when the customer is logged in. A guest customer may not have a customer record available when AIOD evaluates the discount.

### Shopify Flow adds the tag after the order

Shopify Flow runs after the order is created. This is not a real-time usage counter. The customer becomes ineligible after the workflow adds the tag.

### Keep the discount title stable

Shopify Flow checks the discount title recorded on the order, not an internal AIOD discount ID. If you rename the AIOD discount, update the matching title in Shopify Flow before the renamed promotion goes live. Otherwise, Flow will not add the customer tag for orders using the new title.

### Use a unique tag for each promotion

Use a separate tag for every one-time promotion. For example:

* `AIOD_USED_WELCOME15`
* `AIOD_USED_VIP20`
* `AIOD_USED_FIRSTGIFT`

Separate tags prevent one promotion from making a customer ineligible for another promotion.

## First-order-only discounts

If the requirement is "apply this discount only to customers who have never ordered before," use a first-order customer condition when the selected AIOD template supports it. The tag-and-Flow workflow is for a specific promotion that each customer may redeem once.

Test the workflow with a test customer before making the discount **Live**. Confirm that the first order receives the discount, Shopify Flow adds the tag, and a later eligible cart no longer receives it.
