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

# Automatic gifts: fixed or randomly selected rewards

> Choose gift variants and quantities, enable the theme app embed, and test eligibility, inventory, removal, and free checkout pricing.

Automatic gifts add a separate system gift line when an ordinary Online Store cart qualifies and remove it when eligibility is lost. Choose a fixed variant or randomly select one variant from several candidates.

## Configure a gift

**1. Add an automatic gift**

In the campaign editor, click **添加折扣 → 自动赠品** (Add discount → Automatic gift).

**2. Choose the selection mode**

Use **指定赠品** (Fixed gift) for one variant, or **随机抽选** (Random selection) for at least two candidates. Variants are equally likely; multiple variants from one product count as separate candidates.

**3. Set quantity and conditions**

**每单赠送数量** (Gift quantity per order) supports 1–10 units. Add product quantity, product amount, or cart subtotal conditions. System gifts, including gifts from other campaigns, do not count toward qualifying quantities or amounts.

**4. Enable the theme embed**

Click **一键配置嵌入应用** (Configure app embed), then click **保存** (Save) in the current theme editor opened in a new tab. Merely opening the editor does not enable it. Check the embed again after changing themes.

**5. Activate and test**

Save and activate the campaign. Test adding items, losing eligibility, refreshing, and ordinary checkout in your actual theme. The final system gift must be free.

## Cart behavior

* Manually purchased copies remain separate from system gifts.
* A selected random gift stays unchanged while available and eligible; refreshing does not redraw it.
* Losing eligibility removes the gift. Qualifying again triggers a new selection.
* Unavailable candidates are skipped. No gift is added if none are available.
* For temporary network failures, refresh and inspect the cart rather than assuming lost eligibility.

## Current limits

| Setting | Automatic gift campaigns |
| - | - |
| Discount method | Automatic only; no discount codes |
| Rule selection | Use multiple discounts; handled by the app |
| Markets | All markets only; selected markets are unsupported |
| Customer eligibility | All customers; narrow using login, tags, history conditions |
| Customer segments | Unsupported |
| Purchase type | Subscription-only campaigns unsupported; system gifts are nonsubscription items |

Each gift rule supports up to 50 candidate variants and a campaign up to 100. Random selection supports the normal shopping experience; it is not a tamper-resistant lottery or prize allocation system.

> [!WARNING]
>
> Buy now, express checkout, Shop Pay, headless storefronts, and third-party carts may bypass automatic gift handling and need separate integration checks. Test the actual theme and checkout.

See [usage limits](https://discount.xrtotech.com/en/settings/usage-limits.md) for once-per-customer settings; these do not guarantee protection against concurrent redemption. Follow the [gift-with-purchase scenario](https://discount.xrtotech.com/en/scenarios/gift-with-purchase.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.