# Redemption Code

The **Redemption Code** trigger allows you to run campaigns based on codes entered by members. Codes can be delivered in multiple formats (alphanumeric, QR, barcode) and redeemed via mobile apps, websites, or admin interfaces.

This campaign type requires:

* a **custom event schema** with a code attribute
* properly configured **code source (generated or imported)**

<figure><img src="https://2658975168-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcNVX03KZzmrGwJihLiEx%2Fuploads%2Fu1Im5ZiEWoa65fnt5KIw%2Fimage.png?alt=media&#x26;token=81e05047-9386-4b59-876b-667000bf99bf" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
The statuses of the codes will dynamically change each time the code is used.
{% endhint %}

***

### Code Sources

Redemption codes can be provided in two ways:

#### 1. Generated Codes (System-based)

The system automatically creates a pool of unique codes during campaign setup. Additional codes can be generated later on.

<figure><img src="https://2658975168-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcNVX03KZzmrGwJihLiEx%2Fuploads%2FQvxcG60063LmRgWEQ5L0%2Fimage.png?alt=media&#x26;token=6a1676e6-1dc0-4589-939d-289e7e9ac13e" alt=""><figcaption></figcaption></figure>

You can configure:

* number of codes
* code length
* prefix
* character set (numeric, alpha, alphanumeric)

This option is recommended when:

* you don’t need predefined codes
* codes are distributed dynamically (e.g. via API, app, email)

#### 2. Imported Codes (CSV upload)

You can upload your own predefined codes using a `.csv` file.

<figure><img src="https://2658975168-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcNVX03KZzmrGwJihLiEx%2Fuploads%2FyiomqOYYwbtPMQE9QHOw%2Fimage.png?alt=media&#x26;token=f1eba0fc-5a20-473d-8a94-1f74f95c2468" alt=""><figcaption></figcaption></figure>

This option is recommended when:

* codes are printed externally (e.g. on products, flyers)
* codes come from another system
* you need full control over the code list

{% hint style="info" %}
For more information on the sample import file for redemption codes upload, please refer to this section of the User Guide: [#redemption-codes](https://help.openloyalty.io/imports-exports/imports/sample-import-files#redemption-codes "mention")
{% endhint %}

#### Import Process (Asynchronous)

Code import is processed **asynchronously**.

What this means in practice:

* After uploading the CSV, codes are **not immediately available**
* Import is queued and processed in the background
* Progress and results can be monitored in 👉 **Imports / Exports section**

Until the import is completed, codes **cannot be used in campaigns**.

#### Using Imported vs Generated Codes

Once available, **both imported and generated codes behave identically**:

* they are stored in the same pool
* they follow the same lifecycle (e.g. usage status updates)
* they trigger campaigns in the same way
* they are validated against the same event attribute

There is **no difference at runtime** between:

* a system-generated code
* an imported code

***

### 🛠️ Step-by-Step Setup

{% stepper %}
{% step %}
**Create a Custom Event Schema**

{% hint style="warning" %}
It is a one-step activity. The same schema can be reused for multiple campaigns.
{% endhint %}

* Navigate to **Custom Events → Custom Event Schemas**
* Add a text-type attribute (e.g., `promo_code`) for your redemption codes.
* Save the schema status to **Active**

{% hint style="info" %}
For more information on how to create a custom event schema, please refer to this section of the User Guide: [custom-event-schemas](https://help.openloyalty.io/main-features/custom-events/custom-event-schemas "mention")
{% endhint %}
{% endstep %}

{% step %}
**Add Campaign**

* Go to **Campaigns** or **Referral Campaign → Add campaign**
* Under **Trigger**, select **Redemption Code**
  {% endstep %}

{% step %}
**Choose Code Source**

**Option A — Generate codes (system-generated)**

* **Quantity**: Number of initial codes to distribute (you can add more later)
* **Length**: Number of characters per code
* **Prefix**: Optional fixed text added before each code
* **Character set**: Choose numeric, alpha, or alphanumeric

<figure><img src="https://2658975168-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcNVX03KZzmrGwJihLiEx%2Fuploads%2FU0mtnZg32JIcOfkgPcGf%2Fimage.png?alt=media&#x26;token=679cdc3f-18f2-4701-bf21-42751edb5a8e" alt=""><figcaption></figcaption></figure>

**Option B — Import codes (CSV upload)**

* Select **Import**
* Finish campaign creation first
* Upload your `.csv` file in the **Redemption Codes** section

<figure><img src="https://2658975168-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcNVX03KZzmrGwJihLiEx%2Fuploads%2F8C1LNQyXvGozLf5nWyzX%2Fimage.png?alt=media&#x26;token=2134143a-22c3-459f-9f74-cca379c0c2d7" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**Set Basic Campaign Details**

* Name, Description, Translations
* Start/End Date, Display Order, Visibility (Everyone / Segment / Tier)
* **Campaign Status** – The campaign will start only if it is active
  {% endstep %}

{% step %}
**Add Rules**

* **Condition**: (optional) e.g., only trigger for members in a specific tier.
* **Effect**: e.g., "Add 100 fixed points", "Issue coupon".
  {% endstep %}

{% step %}
**Set Limits & Budget**

* Per-member frequency (e.g., once per month)
* Campaign-level spending caps (total units)
  {% endstep %}

{% step %}
**Summary**

* Review the campaign configuration and amend if needed
* Click on **Add Campaign**
  {% endstep %}
  {% endstepper %}

***

### 📋 Managing Codes

* **View or export codes**:\
  In the campaign list, click the **⋮ menu → Show**, then optionally **Export to CSV** to extract the generated codes and their statuses. Statuses include **used** and **unused**.&#x20;
* **Track code usage**:\
  Dashboard metrics show total codes redeemed versus remaining codes left&#x20;

<figure><img src="https://2658975168-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcNVX03KZzmrGwJihLiEx%2Fuploads%2FRGaBWJFtgp97yhT6h2K9%2Fimage.png?alt=media&#x26;token=8d1591a3-5167-408b-8a26-0cd394ae4068" alt=""><figcaption></figcaption></figure>

***

### ✅ Why Use Redemption Code Triggers

* **Offline-to-Online engagement**: Scanable codes from receipts, email, or in-store collateral.
* **Limit control**: Pre-generate and manage set code counts to control campaign scale.
* **Flexible targeting**: Conditions on the event attribute (`promo_code`) allow personalization (e.g., VIP-only codes).
* **Full autonomy**: Campaign logic is separate, ensuring your code campaigns don’t impact other campaign types.

***

### 🧠 Best Practices

* **Keep schemas simple**—only include attributes needed for matching or personalization.
* **Test thoroughly**: Generate a small set of codes, import them into your schema attribute, and test redemption scenarios.
* **Monitor redemption trends** via the overview to adjust issuance or messaging.
* **Rotate prefixes** for limited-time campaigns to avoid reuse or confusion.
