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

# Set Up a Discount Code

> A quick-start overview of UniBee discount codes: the available types, the create-to-activate workflow, and the key concepts to get right before you launch a campaign.

# Set Up a Discount Code

Discount codes let you offer promotional pricing — a percentage off or a fixed amount off — that customers redeem at checkout or that you apply programmatically via API. This page is a quick-start overview; each section links to a detailed guide.

> 💡 New to discount codes? Start with the conceptual [Discount Codes introduction](./discount-code-introduction) for duration models and campaign use cases.

## Choose a code type

UniBee supports three types of discount codes. Pick the one that matches how you plan to distribute and track the offer.

| Type         | Best for                                                                                                                      | How it's created                     | Detailed guide                                                   |
| :----------- | :---------------------------------------------------------------------------------------------------------------------------- | :----------------------------------- | :--------------------------------------------------------------- |
| **Standard** | General promotions, affiliate/KOL tracking, single-campaign offers. One code that many customers can use (subject to limits). | Admin portal                         | [Create, edit, copy and archive](./create-edit-copy-and-archive) |
| **Batch**    | Large campaigns needing many **unique, single-use** codes (email blasts, partner distribution, anti-sharing).                 | Admin portal (template + generation) | [Batch discount codes](./batch-discount-codes)                   |
| **External** | Programmatic / personalized discounts created on the fly through the API, without pre-creating a code.                        | API only                             | [External discount codes](./external-discount-codes)             |

## The create-to-activate workflow

Standard and batch codes follow the same lifecycle:

1. **Create** the code (or batch template) in the **Discount Code** tab. It starts in **Editing** status.
2. **Configure** the discount value, validity window, plan scope, and (optionally) advanced rules.
3. **Review** the right-side **Summary** to confirm the settings.
4. **Activate** the code. Only **Active** codes can be redeemed (and only an active batch template can generate child codes).

While a code is in **Editing**, you can freely change its settings. After activation, only a subset of fields remains editable. See [Create, edit, copy and archive](./create-edit-copy-and-archive#edit-a-discount-code) for the exact rules.

## Key concepts to get right

These three points are the most common sources of confusion — read them before launching a campaign.

### Advanced configuration is gated by a master switch

The **Enable advanced configuration** toggle is a master switch. Settings such as **applicable scope** (new users / renewals), **subscription limits**, and **"Same user cannot use the same discount code again"** only take effect when this switch is on. If it's off, those values may still show in the form and Summary but are **not enforced** at checkout.

See [Advanced configuration](./create-edit-copy-and-archive#advanced-configuration) for full details.

### Code type controls duration, not plan eligibility

The **One-time / Recurring** code type controls how long the discount lasts:

* **One-time** codes can be used on subscription actions and on one-time add-on purchases, but they discount only the invoice where they are applied.
* **Recurring** codes can be used on subscription actions and can continue discounting future subscription invoices, but they cannot be used for one-time add-on purchases.

Which plans are eligible is controlled separately by **Apply Discount Code To**.

### "Apply by billing period" matches on interval, not on plan type

When you scope a code with **Apply to Plans by Billing Period**, plans are matched purely by their interval (for example `1 month` or `1 year`). This does **not** check whether a plan is recurring or one-time. A one-time add-on (such as a minutes or top-up plan) that has `1 month` configured as its billing period **will** be matched by a `1 month` rule. To exclude such plans, use "Selected plans" / "All plans except selected plans", or add them to the exclude list.

### Fixed-amount currency must match the plan

For a fixed-amount discount, the discount currency must match the main plan's currency. Percentage discounts have no currency and scale with the order total.

## Manage and analyze

Once codes are live, you can track and report on them:

* [View the usage of a discount code](./view-the-usage-of-a-discount-code) — see who redeemed a code and the linked subscription, invoice, and payment.
* [Inquiry and export](./inquiry-and-export) — search, filter, and export code data and usage details.
