# Create coupons and gift cards

> For the complete documentation index, see [llms.txt](https://docs.talon.one/llms.txt).

Creating coupons and gift cards is at the core of many promotional campaigns.

Use the Campaign Manager to generate the following types of codes:

- **[Random codes](#generate-random-codes):** Multiple coupon codes, each meant to be
  used by a single customer.
- **[Universal codes](#generate-a-universal-code):** A single coupon code meant to be
  used by multiple customers.
- **[Gift cards](#generate-a-gift-card):** Codes that customers can use to pay for their
  orders.
- **[Personal codes](#generate-a-personal-code):** A coupon code meant to be used by a
  specific customer.

:::note
To prevent coupon fraud, you can combine [profile, coupon, and unique identifier budgets](/docs/product/campaigns/settings/manage-campaign-budgets.md#budget-types) to limit how many coupons a single customer can redeem
and how much discount they can get on a single campaign.

See [our tutorial on custom identifiers](/docs/dev/tutorials/use-identifiers.md) in the Dev
docs for further information on creating and using identifiers to prevent multiple accounts.
:::

## Before you start

Ensure that you have:

- [Created a campaign](/docs/product/campaigns/create-and-manage-campaigns.md).
- [Enabled](/docs/product/campaigns/settings/manage-campaign-features.md) the coupons feature
  in your campaign.
- Configured your integration to [support coupons](/docs/dev/tutorials/create-custom-coupons.md).
- Checked your Application's [case sensitivity settings](/docs/product/applications/manage-general-settings.md#code-case-sensitivity) for coupons.

## Generate random codes

Random coupon codes are typically used when distributing unique coupon codes directly to customers,
and they are intended for single users. For example, you can use this option to create a
batch of individual codes where each code can be redeemed once.

:::important
We recommend avoiding special characters (such as %, $, &) in your coupon codes.
If you wish to use special characters, reach out to your developer team to ensure the coupon code is URL encoded when using the
[Create coupon reservation](https://docs.talon.one/integration-api#tag/Coupons/operation/createCouponReservation) endpoint.
:::

1. On the left-side menu of the campaign where you want to create coupon codes, click <Coupons className="icon"/> **Coupons**.
1. Click <Add className="icon"/> **Create Coupons** and ensure you are in the **Random Codes** tab.
1. In **Number of coupons**, set the number of coupons to generate.

   :::note
   The maximum amount of codes you can generate at a time is 5,000,000, and you can create
   up to 20,000 codes immediately. When creating more than 20,000 codes in a single request,
   you will receive an email notification after the coupon codes are generated. The asynchronous
   coupon generation takes up to one hour.
   :::

1. In **Per-coupon redemption limit**, set how many times the coupon can be redeemed by a
   single customer. You can also allow unlimited redemptions.
1. In **Schedule (optional)**, select the dates between which the coupon can be redeemed.
1. If there are any [coupon mandatory attributes](/docs/product/applications/use-attributes.md#make-attributes-mandatory)
   enabled for the Application, use **Mandatory attributes** to set the value for them.
1. (Optional) If there are any coupon mandatory attributes enabled for the Application, you
   can use **Custom Attributes** to add one or more [coupon attributes](/docs/product/account/dev-tools/manage-attributes.md)
   connected to this Application and set their value.

   :::note
   If there are no mandatory attributes enabled for the Application, you can add custom attributes
   in the section below.
   :::

1. (Optional) Use the **Advanced** section to set the format of the coupons:

   :::note
The format you set in this section overrides the [current settings][settings] for the given batch.
:::

[settings]: /docs/product/campaigns/coupons/coupon-page-overview#edit-coupon-format

   - In **Code length**, choose the length of your codes, between 4 and 20 characters. The
     default length is 8 characters.
   - In **Character set**, choose if you want your codes to contain letters only,
     numbers only, or both.
   - Click the **Segmented** checkbox if you want the codes to be segmented. If you select
     this option, use the **Segmentation character** drop-down menu to choose between hyphen
     and underscore.
   - In **Prefix**, set a prefix for your codes.
   - In **Suffix**, set a suffix for your codes.
   - Click the **Segment prefix/suffix** checkbox if you want the prefix and the suffix
     to be separated from the rest of the code by a hyphen or an underscore.
   - In **Disallowed characters**, enter characters that you want to exclude from your
     codes. The characters disallowed by default are `1IO02ZS6G`.
   - In **Coupon reservation limit**, type how many times the coupons can be reserved
     or choose one or more of the following options:
      - **Allow unlimited reservations**: The coupon codes can be reserved as many times as
        required.
      - **Reservation mandatory**: The coupon code can be redeemed only if it has been
        reserved first.
1. Click **Create**.

A pop-up appears, indicating that a code batch has been created. It contains the **Batch ID**
that you can use to identify the coupon codes that you just generated.

:::tip
Before you close the pop-up, you can click **Create More Codes** or click **Export Codes**
to directly [export the coupon codes](/docs/product/campaigns/coupons/manage-coupons.md#export-coupon-codes).
:::

## Generate a universal code

Use this option to create one coupon code that can be used by all your customers.

1. On the left-side menu of the campaign where you want to create coupon codes, click <Coupons className="icon"/> **Coupons**.
1. Click <Add className="icon"/> **Create Coupons** and select the **Universal Code** tab.
1. In **Coupon code**, type the name of the coupon.
1. In **Coupon redemption limit**, set how many times the coupon can be redeemed. You can also
   allow unlimited redemptions.
1. In **Per-customer redemption limit**, set how many times the coupon can be redeemed by a single
   customer. You can also allow unlimited redemptions.
1. In **Schedule (optional)**, select the dates between which the coupon can be redeemed.
1. If there are any [coupon mandatory attributes](/docs/product/applications/use-attributes.md#make-attributes-mandatory)
   enabled for the Application, use **Mandatory attributes** to set the value for them.
1. (Optional) If there are any coupon mandatory attributes enabled for the Application, you
   can use **Custom Attributes** to add one or more [coupon attributes](/docs/product/account/dev-tools/manage-attributes.md)
   connected to this Application and set their value.

   :::note
   If there are no mandatory attributes enabled for the Application, you can add custom attributes
   in the **Advanced** section that appears at the bottom of the page.
   :::

1. Use the **Advanced** section to set the coupon reservation limit and visibility:
   - In **Coupon reservation limit**, type how many times the coupons can be reserved
     or choose one or more of the following options:
     - **Allow unlimited reservations**: The coupon code can be reserved as many times as needed.
     - **Reservation mandatory**: The coupon code can be redeemed only if it has been
        reserved first.
   - In **Coupon visibility**, select whether the coupon code is displayed to all customers.

     :::note
     When the **Coupon visibility** checkbox is selected, the [List customer data](/integration-api#tag/Customer-profiles/operation/getCustomerInventory)
     endpoint returns the coupon code for all customer profiles if the endpoint's `coupons`
     query parameter is set to `true`.
     :::

1. Click **Create**.

A pop-up appears, indicating that a code batch has been created. It contains the **Batch ID**
that you can use to identify the coupon code that you just generated.

:::tip
Before you close the pop-up, you can click **Create More Codes** or click **Export Codes**
to directly [export the coupon codes](/docs/product/campaigns/coupons/manage-coupons.md#export-coupon-codes).
:::

## Generate a gift card

Use this option to create gift cards that customers can use to pay for part or all of their
orders.

:::important
We recommend avoiding special characters (such as %, $, &) in your coupon codes.
If you wish to use special characters, reach out to your developer team to ensure the coupon code is URL encoded when using the
[Create coupon reservation](https://docs.talon.one/integration-api#tag/Coupons/operation/createCouponReservation) endpoint.
:::

You might also consider generating a loyalty card instead. See how they compare:

{
<details>
  <summary>Choosing between gift cards and loyalty cards</summary>
  
    The asterisk means the feature is possible with workarounds.
    
      
        
          Feature
          Loyalty cards
          Gift cards
        
        
          Enable/Disable
          Yes
          No
        
        
          PIN code on card
          Yes*
          Yes
        
        
          Attributes
          Yes
          Yes
        
        
          Top-up
          Yes
          Yes*
        
        
          Point/value addition history
          Yes
          No
        
        
          Tied to a customer
          Yes
          Yes
        
        
          Transaction cancellation
          Yes
          Yes*
        
        
          Refund
          Yes
          Yes*
        
        
          Card code generation
          Yes
          Yes*
        
        
          Notification on added balance
          Yes*
          Yes
        
        
          Transfer data to a new card
          Yes
          No
        
        
          Block card (when lost/stolen)
          Yes
          No
        
      
    
  
</details>
}

1. On the left-side menu of the campaign where you want to create coupon codes, click <Coupons className="icon"/> **Coupons**.
1. Click <Add className="icon"/> **Create Coupons** and select the **Gift Cards** tab.
1. In **Number of gift cards**, set the number of gift cards to generate.

   :::note
   The maximum amount of gift cards you can generate at a time is 5,000,000, and you can create
   up to 20,000 immediately. When creating more than 20,000 gift cards in a single request,
   you will receive an email notification after the gift cards are generated. The asynchronous
   gift card generation takes up to one hour.
   :::

1. In **Gift card value**, set the value of the gift card.

   :::note
   When the gift card is redeemed,
   any [campaign-level limit](/docs/product/campaigns/settings/manage-campaign-budgets.md#coupon-limits)
   that is reached first applies.
   :::

1. If there are any [coupon mandatory attributes](/docs/product/applications/use-attributes.md#make-attributes-mandatory)
   enabled for the Application, use **Mandatory attributes** to set the value for them.
1. (Optional) If there are any coupon mandatory attributes enabled for the Application, you
   can use **Custom Attributes** to add one or more [coupon attributes](/docs/product/account/dev-tools/manage-attributes.md)
   connected to this Application and set their value.

   :::note
   If there are no mandatory attributes enabled for the Application, you can add custom attributes
   in the section below.
   :::

1. (Optional) Use the **Advanced** section to set the format of the gift cards:

   :::note
The format you set in this section overrides the [current settings][settings] for the given batch.
:::

[settings]: /docs/product/campaigns/coupons/coupon-page-overview#edit-coupon-format

   - In **Code length**, choose the length of your codes, between 4 and 20 characters. The
     default length is 8 characters.
   - In **Character set**, choose if you want the codes to be composed by letters only,
     numbers only, or both.
   - Click the **Segmented** checkbox if you want the codes to be segmented. If you select
     this option, use the **Segmentation character** drop-down menu to choose between hyphen
     and underscore.
   - In **Prefix**, set a prefix for the codes.
   - In **Suffix**, set a suffix for the codes.
   - Click the **Segment prefix/suffix** checkbox if you want the prefix and the suffix
     to be separated from the rest of the code by a hyphen or an underscore.
1. Click **Create**.

A pop-up appears, indicating that a code batch has been created. It contains the **Batch ID**
that you can use to identify the gift cards that you just generated.

:::tip
Before you close the pop-up, you can click **Create More Codes** or click **Export Codes**
to directly [export the gift cards](/docs/product/campaigns/coupons/manage-coupons.md#export-coupon-codes).
:::

## Generate a personal code

These codes are intended for specific users. For example, you can use this option to
create a unique code for a certain [Customer integration ID](/docs/product/applications/display-customer-profiles.md#customer-profile-overview)
so only a user with this ID can redeem this coupon. Later you can edit the Integration ID
if this is a requirement.

<FeatureAccessInfoBox>
You can generate personal codes only if your [role](/docs/product/account/account-settings/manage-roles.md#create-a-role)
has the **Create and edit coupons** permission.
</FeatureAccessInfoBox>

:::important
We recommend avoiding special characters (such as %, $, &) in your coupon codes.
If you wish to use special characters, reach out to your developer team to ensure the coupon code is URL encoded when using the
[Create coupon reservation](https://docs.talon.one/integration-api#tag/Coupons/operation/createCouponReservation) endpoint.
:::

1. On the left-side menu of the campaign where you want to create coupon codes, click <Coupons className="icon"/> **Coupons**.
1. Click <Add className="icon"/> **Create Coupons** and select the **Personal Code** tab.
1. In **Customer Integration ID**, type [the ID of the user](/docs/product/applications/display-customer-profiles.md#customer-profile-overview)
   you want to create the coupon for.
1. In **Schedule (optional)**, select the dates between which the gift card can be redeemed.
1. If there are any [coupon mandatory attributes](/docs/product/applications/use-attributes.md#make-attributes-mandatory)
   enabled for the Application, use **Mandatory attributes** to set the value for them.
1. (Optional) If there are any coupon mandatory attributes enabled for the Application, you
   can use **Custom Attributes** to add one or more [coupon attributes](/docs/product/account/dev-tools/manage-attributes.md)
   connected to this Application and set their value.

   :::note
   If there are no mandatory attributes enabled for the Application, you can add custom attributes
   in the section below.
   :::

1. (Optional) Use the **Advanced settings** section to set the name of the coupon. Leave this
   field blank to have the code auto-generated.
1. Click **Create**.

A pop-up appears, indicating that a coupon batch has been created. It contains the **Batch ID**
that you can use to identify the coupon code that you just generated. The customer will not
be automatically notified.

:::tip
Before you close the pop-up, you can click **Create More Codes** or click **Export Codes**
to directly [export the coupon code](/docs/product/campaigns/coupons/manage-coupons.md#export-coupon-codes).
:::

## Create a code as an effect

You can also create a coupon code or a gift card [as an effect](/docs/product/rules/effects/use-effects.md#create-a-coupon-code)
in [your rules](/docs/product/rules/overview.md) and set all its values directly.

## Next steps

After you have generated codes, you can, for example, share them with your customers
via a rule, or [export them](/docs/product/campaigns/coupons/manage-coupons.md#export-coupon-codes).

## Related pages

- [Create campaign budgets](/docs/product/campaigns/settings/manage-campaign-budgets.md)
- [Manage coupons and gift cards](/docs/product/campaigns/coupons/manage-coupons.md)
- [Create a gift card campaign](/docs/product/tutorials/coupons/giftcard.md)
- [Create a community buying campaign](/docs/product/tutorials/coupons/community-buy.md)
- [Use custom identifiers to prevent fraud](/docs/dev/tutorials/use-identifiers.md)
