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

# Create and Manage Coupons

> Create and manage Coupons in ChatbotX: organize coupon topics, import codes, distribute coupons in Flows, and track their usage.

**Coupons** helps you store discount codes and assign a unique code to each customer. Use this feature for new customer offers, giveaways, or limited promotions.

Each group of codes is managed in a **Topic Coupon**.

## Understand Topic Coupons and Coupons

| Component        | Function                                             |
| ---------------- | ---------------------------------------------------- |
| **Topic Coupon** | Groups codes that belong to the same promotion.      |
| **Coupon**       | A specific code imported and assigned to a customer. |
| **Status**       | Shows whether a Coupon has been assigned.            |
| **Usage**        | Shows whether a Coupon has been used.                |

Create a Topic Coupon first, then import codes into that Topic. The **Set up Coupon** Action assigns a code from the Topic and saves it to the customer's information.

## Open Coupons and create a Topic Coupon

<Steps>
  <Step title="Open Tools">
    Select **Tools** from the left menu.
  </Step>

  <Step title="Select Coupons">
    Click the **Coupons** card to open the management page.

    <Frame>
      <img src="https://mintcdn.com/chatbotx/kLzzUd5lS5P09tks/images/coupon_tool_location.png?fit=max&auto=format&n=kLzzUd5lS5P09tks&q=85&s=eb5e7d9e87082ccd156a6b0414a8d509" alt="Open Coupons from the Tools page" width="3058" height="1886" data-path="images/coupon_tool_location.png" />
    </Frame>
  </Step>

  <Step title="Open Topic Coupon">
    Select the **Topic Coupon** tab. The **List Topic** page shows each Topic name, Coupon count, validity period, and Actions menu.

    <Frame>
      <img src="https://mintcdn.com/chatbotx/kLzzUd5lS5P09tks/images/topic_coupon_list.png?fit=max&auto=format&n=kLzzUd5lS5P09tks&q=85&s=edd5d21be0aca4190fb2ff6c9ab4db31" alt="View the Topic Coupon list and actions" width="2477" height="1001" data-path="images/topic_coupon_list.png" />
    </Frame>
  </Step>

  <Step title="Click Create New">
    Click **+ Create New** to open the Topic Coupon creation dialog.
  </Step>

  <Step title="Enter the Topic information">
    Enter a **Name**, select a **Validity period** if the promotion has an expiration date, and add a **Description** when needed.

    <Frame>
      <img src="https://mintcdn.com/chatbotx/kLzzUd5lS5P09tks/images/create_topic_coupon.png?fit=max&auto=format&n=kLzzUd5lS5P09tks&q=85&s=43478ec76ac0bbbc75a968d2d2fdccda" alt="Create a new Topic Coupon" width="2482" height="1873" data-path="images/create_topic_coupon.png" />
    </Frame>
  </Step>

  <Step title="Click Create">
    Click **Create** to save the Topic Coupon.
  </Step>
</Steps>

If you do not select a **Validity period**, the validity column displays **Unlimited**.

### Edit or archive a Topic Coupon

Open the three-dot menu in the **Actions** column to choose one of these options:

* **Edit**: Change the name, validity period, or description.
* **Archive**: Move the Topic Coupon to the Archive tab.

A Topic Coupon in **Archive** cannot assign Coupons. Open the **Archive** tab to manage, restore, or delete Topics you no longer use.

## Import and manage Coupons

### Prepare the import file

Download the template from the **Download import template** link in the **Import coupons** dialog. The CSV file uses one column named `coupon`:

```csv theme={null}
coupon
WELCOME10001
WELCOME10002
WELCOME10003
```

Each row contains one unique code. Check for duplicate codes and remove empty rows before importing the file.

### Import and download the Coupon list

<Steps>
  <Step title="Open the Coupon tab">
    On the **Coupons** page, select the **Coupon** tab.

    This page includes Topic, Status, and Usage filters, a **Search code** field, and the Coupon list.

    <Frame>
      <img src="https://mintcdn.com/chatbotx/ZE5hZwCgRQEpn81n/images/coupon_list_and_statuses.png?fit=max&auto=format&n=ZE5hZwCgRQEpn81n&q=85&s=7e0a55a0599ff71fef5f11ceb51b42c6" alt="View Coupon filters and status columns" width="2439" height="1622" data-path="images/coupon_list_and_statuses.png" />
    </Frame>
  </Step>

  <Step title="Click Import coupons">
    Click **Import coupons** to open the import dialog.
  </Step>

  <Step title="Select a Topic">
    In the **Topic** field, select the Topic Coupon that will receive the new codes.
  </Step>

  <Step title="Upload the CSV file">
    Select the prepared CSV file. The filename appears in the upload area after the system receives it.
  </Step>

  <Step title="Click Confirm">
    Click **Confirm** to import the codes into the selected Topic Coupon.
  </Step>
</Steps>

After the import, the Coupon table displays the **Topic**, **Code**, **Status**, **Usage**, and **Created At** columns.

Use the following tools together to find Coupons:

* **All topics**: Filter by Topic Coupon.
* **All statuses**: Filter by assignment status.
* **All usage**: Filter by usage status.
* **Search code**: Find a specific code.

Click **Download Coupon List** to download the Coupon list with its current statuses.

<Frame>
  <img src="https://mintcdn.com/chatbotx/kLzzUd5lS5P09tks/images/import_and_download_coupon_list.png?fit=max&auto=format&n=kLzzUd5lS5P09tks&q=85&s=f99fdc28c26a47e7465911ff8b981cf1" alt="Import coupons and download the Coupon list" width="2489" height="1879" data-path="images/import_and_download_coupon_list.png" />
</Frame>

## Distribute Coupons in a Flow

### Add a Topic Coupon Action

<Steps>
  <Step title="Open Send Message">
    Create or open a **Send Message** block in Flow Builder.
  </Step>

  <Step title="Open Actions">
    Click **Create**, then select **Actions**.
  </Step>

  <Step title="Select Topic Coupon">
    Open the **Tools** group and select **Topic Coupon**.

    <Frame>
      <img src="https://mintcdn.com/chatbotx/ZE5hZwCgRQEpn81n/images/select_topic_coupon_action.png?fit=max&auto=format&n=ZE5hZwCgRQEpn81n&q=85&s=029993c1d2134ef89347796cb130d220" alt="Select the Topic Coupon action in Flow Builder" width="3055" height="1887" data-path="images/select_topic_coupon_action.png" />
    </Frame>
  </Step>

  <Step title="Select a Type">
    In the **Type** field, select **Set up Coupon** or **Mark Coupon used**.

    <Frame>
      <img src="https://mintcdn.com/chatbotx/ZE5hZwCgRQEpn81n/images/configure_topic_coupon_action.png?fit=max&auto=format&n=ZE5hZwCgRQEpn81n&q=85&s=ba5438c030826ff3f76983f78b12f10d" alt="Configure the Topic Coupon action" width="3054" height="1886" data-path="images/configure_topic_coupon_action.png" />
    </Frame>
  </Step>

  <Step title="Select a Topic">
    In the **Topic** field, select the Topic Coupon the Flow will use.
  </Step>

  <Step title="Click Continue">
    Click **Continue** to add the Action to the **Send Message** block. Click **Update** when you need to reopen its settings.
  </Step>
</Steps>

The Topic Coupon Action has two settings:

| Setting              | Function                                                  |
| -------------------- | --------------------------------------------------------- |
| **Set up Coupon**    | Assigns a Coupon from the selected Topic to the customer. |
| **Mark Coupon used** | Marks the customer's Coupon as used.                      |

### Check a Coupon with Condition

Use a **Condition** node to create Flow branches based on each customer's Coupon.

<Steps>
  <Step title="Open Add Condition">
    In the **Condition** node, click **Add Condition** to open the filter settings.
  </Step>

  <Step title="Select a Topic Coupon">
    Open the field list. In the **Topic coupon** group, select the Topic you want to check.

    <Frame>
      <img src="https://mintcdn.com/chatbotx/ZE5hZwCgRQEpn81n/images/topic_coupon_condition_field.png?fit=max&auto=format&n=ZE5hZwCgRQEpn81n&q=85&s=87eb26e53fad608f7123205c9db0bc13" alt="Select a Topic Coupon field in a Condition node" width="3054" height="1880" data-path="images/topic_coupon_condition_field.png" />
    </Frame>
  </Step>

  <Step title="Select an operator">
    Select **Has any value**, **Used**, or **Is** based on the condition you want to check.

    <Frame>
      <img src="https://mintcdn.com/chatbotx/ZE5hZwCgRQEpn81n/images/topic_coupon_condition_operators.png?fit=max&auto=format&n=ZE5hZwCgRQEpn81n&q=85&s=2204d8a1adefb4fd8bde8a3a25c53509" alt="Choose a Topic Coupon condition operator" width="2229" height="503" data-path="images/topic_coupon_condition_operators.png" />
    </Frame>
  </Step>

  <Step title="Select a comparison value">
    When you use **Is**, select the value to compare in the third field.

    <Frame>
      <img src="https://mintcdn.com/chatbotx/ZE5hZwCgRQEpn81n/images/topic_coupon_condition_value.png?fit=max&auto=format&n=ZE5hZwCgRQEpn81n&q=85&s=834b773363c6e1ae904284380fd47dfe" alt="Select a comparison value for a Topic Coupon condition" width="2408" height="790" data-path="images/topic_coupon_condition_value.png" />
    </Frame>
  </Step>

  <Step title="Click Save">
    Click **Save** to add the condition to the current Case.
  </Step>
</Steps>

| Operator          | Condition checked                                              |
| ----------------- | -------------------------------------------------------------- |
| **Has any value** | The customer has a Coupon from the selected Topic.             |
| **Used**          | The Coupon from the selected Topic has been marked as used.    |
| **Is**            | The Coupon matches the value selected in the comparison field. |

### Send a Coupon code in a message

<Steps>
  <Step title="Add Send Text">
    Add or open **Send Text** content in the **Send Message** block.
  </Step>

  <Step title="Enter the message">
    Enter the fixed message content, such as `Your Coupon:`.
  </Step>

  <Step title="Insert the Coupon property">
    Click the `</>` icon in the editor. In the **Coupons** group, select the Topic Coupon you want to insert.

    <Frame>
      <img src="https://mintcdn.com/chatbotx/ZE5hZwCgRQEpn81n/images/insert_coupon_system_field.png?fit=max&auto=format&n=ZE5hZwCgRQEpn81n&q=85&s=c39b7502de98e451862b96091fc5147b" alt="Insert a Coupon property into a Send Text block" width="3056" height="1887" data-path="images/insert_coupon_system_field.png" />
    </Frame>
  </Step>
</Steps>

When the Flow runs, ChatbotX replaces this property with the Coupon code assigned to the customer in the selected Topic.

<Note>
  Run **Set up Coupon** before sending the Coupon field. This ensures the customer has a code that ChatbotX can insert into the message.
</Note>

## Track Coupons by customer

### Filter customers in Contacts

The Coupon filter helps you find customers who received a specific code or used a code from a Topic.

<Steps>
  <Step title="Open Contacts">
    Select **Contacts** from the left menu.
  </Step>

  <Step title="Add a filter condition">
    Open the filter panel and select **Add Condition**.
  </Step>

  <Step title="Select a Topic Coupon">
    In the first field, select the Topic Coupon you want to filter.
  </Step>

  <Step title="Select an operator">
    Select **Has any value**, **Used**, or **Is** based on the customer list you need.

    <Frame>
      <img src="https://mintcdn.com/chatbotx/ZE5hZwCgRQEpn81n/images/filter_contacts_by_coupon.png?fit=max&auto=format&n=ZE5hZwCgRQEpn81n&q=85&s=92ce3cc6b107b967279fdad502746d76" alt="Filter contacts by Topic Coupon status" width="3055" height="1883" data-path="images/filter_contacts_by_coupon.png" />
    </Frame>
  </Step>

  <Step title="Click Save">
    If you select **Is**, choose a comparison value. Then click **Save** to apply the filter.
  </Step>
</Steps>

The filter only changes the displayed list. Use the results to review or process the matching customer group.

### View Coupons in Inbox

<Steps>
  <Step title="Open Inbox">
    Select **Inbox** from the left menu.
  </Step>

  <Step title="Select a conversation">
    Select the customer you want to review from the conversation list.
  </Step>

  <Step title="Open Coupons">
    In the contact profile on the right, open **Coupons**.

    <Frame>
      <img src="https://mintcdn.com/chatbotx/ZE5hZwCgRQEpn81n/images/coupon_in_contact_profile.png?fit=max&auto=format&n=ZE5hZwCgRQEpn81n&q=85&s=7503594fdc24685556c4794a81269143" alt="View an assigned Coupon in the Inbox contact profile" width="3056" height="1884" data-path="images/coupon_in_contact_profile.png" />
    </Frame>
  </Step>
</Steps>

Each Coupon card displays the Topic name, assigned code, and usage status. **Not used yet** means the code has not been marked as used.

## Example: distribute a welcome Coupon to new customers

You have a Topic named `New Customer Welcome - 10% Off` with 30 imported codes from `WELCOME10001` to `WELCOME10030`.

The Flow starts with an offer message and a **Get Coupon** button. When a customer clicks the button, the Flow follows these steps:

<Steps>
  <Step title="Receive the Coupon request">
    The customer clicks **Get Coupon** in the offer message.
  </Step>

  <Step title="Check the customer's Coupon">
    The **Condition** node uses **Has any value** to check whether the customer already has a Coupon from the Topic.
  </Step>

  <Step title="Send the existing Coupon again">
    If the condition matches, the Flow sends the customer's saved Coupon code again.
  </Step>

  <Step title="Assign a new Coupon">
    If the condition does not match, the Flow runs **Set up Coupon** to assign a code from the Topic.
  </Step>

  <Step title="Send the assigned Coupon">
    The Flow sends a message containing the **Coupons > New Customer Welcome - 10% Off** property.
  </Step>
</Steps>

<Frame>
  <img src="https://mintcdn.com/chatbotx/ZE5hZwCgRQEpn81n/images/coupon_welcome_offer_flow_example.png?fit=max&auto=format&n=ZE5hZwCgRQEpn81n&q=85&s=5d60276bd234d74997a709335f5434c7" alt="Complete welcome Coupon flow with existing and new Coupon branches" width="3051" height="1883" data-path="images/coupon_welcome_offer_flow_example.png" />
</Frame>

This scenario checks for a Coupon before running **Set up Coupon**. The branch for customers who already have a code does not assign another Coupon.

<Warning>
  A Topic Coupon in Archive cannot assign new codes. Confirm that the Topic is active before using it in a Flow.
</Warning>

Check the number of available Coupons in the Topic before starting the campaign.

<Note>
  Prepare enough codes for the expected number of customers. Make sure the CSV file has no empty rows or duplicate codes.
</Note>
