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

# Create, edit, copy and archive

You can set up, edit, and manage discount codes in UniBee **Discount Code** tab. Discount codes can be used to offer promotional discounts to customers. It is a key tool for driving sales and customer engagement.

UniBee supports three types of discount codes:

* **Standard Discount Codes**: Individual codes with specific usage limits (created in admin portal)
* **Batch Discount Codes**: Generate thousands of unique codes from a single template
* **External Discount Codes**: Programmatically created via API (no admin portal setup needed)

> 💡 **Looking to create batch discount codes?** See the [Batch Discount Codes guide](./batch-discount-codes) for detailed instructions on creating and managing batch templates and generating multiple unique codes.

> 💡 **Need programmatic discount creation?** See the [External Discount Codes guide](./external-discount-codes) for API-based discount creation without admin portal configuration.

### Create a Discount code

To create a Discount Code, please navigate to the **Discount Code** tab and click the **Add a Code** button.

#### General configuration

1. Input the following details:
   * **Name**: Enter the name for the discount code.
   * **Code**: Provide a unique string that will be distributed to your audience.
   * **Quantity**: Specify how many times this code can be used. Set to **0** for unlimited usage.
2. Select the **Discount Type**:
   * Fixed Amount
   * Percentage
3. Define the code **Type**:
   * One-time
   * Recurring (For recurring, input the **Recurring Cycle** number, representing how many billing cycles the discount applies. **0** indicates no limit.)
4. Configure the **Code Apply Date Range** (Time zone: UTC+0).
5. In the **Apply to Which Plans** field, you may choose between apply the code to “All plans”, “Selected plans“ or “All plan except excluded plans” options. Click the 2nd or 3rd option and you can select the target plans.
6. On the right side of the tab, you can see a **Summary** of the discount code set up.
7. Click **Save** to save the discount code. The status will be set to **Editing**.
8. While the status is **Editing**, you can modify the discount code settings.
9. To activate the discount code, click the **Activate** button.

#### Advanced configuration

For additional customization, billing administrators can enable advanced settings:

1. Set the Discount Code Scope, choose one of the following options:
   * Apply for all: Available for all users.
   * Apply only for new users: Limited to users who successfully pay for a subscription plan for the first time.
   * Apply only for renewals: Restricted to subscription renewals.

2. Set the Applicable Subscription Limits, choose one of the following options:

   * Apply for all
   * Apply only for upgrades (same recurring cycle)
   * Apply only for switching to longer subscriptions

3. Restrict Reuse by the Same User:
   * By default, the Same user cannot use the same discount code again option is enabled. You can disable this setting if required.

4. Apply by Billing Period (New):
   * Choose billing-period rules to target or exclude specific plans.
   * Apply to Plans by Billing Period: Only plans matching the selected billing period(s) are eligible.
   * Apply to Plans except by Billing Period: All matching plans are eligible except the excluded ones.
   * Billing period rules can include combinations like 1 month, 3 months, or 1 year.
   * Exclusion takes precedence if a plan is both included and excluded.

By following these steps, you can create, configure, and activate a Discount Code tailored to your business needs.

### Edit a Discount Code

1. Click the **Edit** icon in the **Actions** column to open the code definition page.
2. Update the following settings as needed:
   * **Quantity**
   * **Code Apply Date Range**
   * **Apply to Which Plans**
3. Click **Save** to apply the changes.

### Clone a Discount Code

1. Click the **Copy** icon in the **Actions** column of the desired discount code.
2. All the settings of the new Discount Code will be the same as the copied code, including **Advanced configuration**.
3. On the new code definition page, modify any field in both **General configuration** and **Advanced configuration**.
4. Click **Save** to create the new discount code.

### Archive a Discount Code

1. Click the **Archive** icon in the **Actions** column of the discount code.
2. Confirm the action by clicking **OK** in the pop-up window that asks, "Are you sure to archive this coupon code?".
3. You will receive a notification: **"Discount code archived successfully."**
4. The discount code will be set to **Archived** status and appear at the end of the list in grey.
