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

# Inquiry and export

The Discount Code tab allows you to search, filter, and export data related to discount codes in your admin portal. Below is a detailed guide on how to utilize these features effectively.

## Searching for Discount Codes

You can search for a discount code by:

* **Code**: Input the code directly (fuzzy matching).
* **Code Name**: Use fuzzy matching to find codes based on similar or partial names.

### Searching Batch Discount Codes

For batch discount codes, you can search for:

* **Batch Template Name**: Search by the batch template name
* **Code Prefix**: Search by the code prefix used in the batch
* **Individual Codes**: Search for specific codes within a batch

## Filtering and Sorting Discount Codes

The discount codes can be filtered and sorted using the following criteria:

1. Status:

   * Editing
   * Active
   * Inactive
   * Expired
   * Archived

2. Discount Info:
   * Percentage
   * Fixed-amount

3. Code Type:
   * Standard Discount Codes
   * Batch Discount Codes (templates)

### Filtering Batch Discount Code Templates

When viewing batch templates, you can filter by:

* **Template Status**: Editing, Active, Inactive, Archived
* **Usage Statistics**: View templates by usage rate (high/low usage)
* **Batch Name**: Search by batch campaign name

### Filtering Individual Batch Codes

When viewing codes within a batch template, you can filter by:

* **Code Status**: Available or Redeemed
* **Code Search**: Search for specific codes by partial match
* **Usage Date Range**: Filter by when codes were used

## View Discount Code Integrated Data

1. Recurring Cycle
   * Displaying numbers alone is the one-time type.
   * A number marked with a cyclic flag indicates a recurring value. When the infinity symbol (♾️) is combined with a cyclic flag, it represents an Unlimited value.

2. Quantity
   * If there is a limit on the number of times \[total number (remaining available number/used number)], if there is no limit on the number of times used \[Unlimited]

### Batch Discount Code Statistics

For batch discount code templates, you'll see:

* **Target Quantity**: Total number of codes planned for generation
* **Generated Count**: Number of codes already created
* **Used Count**: Number of codes that have been redeemed
* **Available Count**: Number of unused codes remaining

## Exporting Discount Code Data

You can export data about discount codes and their usage details using the export feature. Follow these steps:

1. Click the **Export** button located at the top-right corner of the Discount Code list.

2. Select one of the following options:
   * **Export Selected Code Usage Details**: Exports usage details of the selected discount codes.
   * **Export Code List**: Exports a comprehensive list of all discount codes.

The exported data will be available for download in a convenient format, allowing you to analyze and share the information as needed.

### Exporting Batch Discount Code Data

For batch discount codes, you have additional export options:

#### Export Batch Template List

1. Filter or search for batch templates as needed
2. Click the **Export** button
3. Select **Export Template List**
4. The export includes:
   * Batch template information (name, code prefix)
   * Template status and configuration
   * Usage statistics (total, generated, used, available)
   * Discount rule details

#### Export Individual Batch Codes

1. Open a batch template detail page
2. Navigate to the **Codes** tab
3. Apply filters if needed (e.g., only redeemed codes)
4. Click the **Export** button
5. Select export format (Excel or CSV)
6. The export includes:
   * Individual code information
   * Usage status (available/redeemed)
   * User information (email) for redeemed codes
   * Usage date and time
   * Related invoice, subscription, and payment IDs
   * Batch template information
   * Discount rule details
   * Creation timestamps

**Export Processing:**

* Large exports are processed asynchronously
* You'll receive a notification when the export is ready
* Download the file from the **Tasks** section
* Exports are available in Excel (.xlsx) or CSV format

#### Export with Filters

You can export filtered subsets of codes:

* Export only redeemed codes
* Export only available codes
* Export codes used within a specific date range
* Export codes used by specific users (via search)

This allows you to create targeted reports for campaign analysis.
