---
updatedAt: 2026-11-06T11:26:16.000Z
agentTools:
  projectIndex: https://docs.esputnik.com/llms.txt
---

# Promo Code from Data Base

<HTMLBlock>{`
<p align="right" style="color: gray;">
  <a href="https://docs-ua.esputnik.com/docs/pidstanovka-promokodu-z-fajlu" style="color: gray; text-decoration: none;"><em>
    Read this article in Ukrainian ⮕
  </em></a>
</p>
`}</HTMLBlock>

Upload the promo code database, specify the variable in the message, and the system will automatically insert them. This works in both email and SMS.

<Callout icon="📘" theme="info">
  ###

  This type is suitable for both single and broadcast campaigns.
</Callout>

## Create and import a file with promo codes

The first step is to create a file with promo codes. Essentially, it’s a regular `CSV` file where you build a database of promo codes.

To see the file example, go to your profile → **Settings → Promo codes → File example**.

<Image src="https://files.readme.io/cb8401c1ea43d74c344dfcc3fef87c20bca9631f0fb3a86073be25b8623ea762-image.png" align="center" width="80% "  alt="Promo codes page with the File example tab highlighted showing a sample CSV table with code, expirationDate, discount, and type columns" />

It should include the following parameters:

* **code** - promo code;
* **expirationDate** - promo code expiration date in one of the formats: `yyyy-MM-dd`, `yyyy-MM-dd'T'HH:mm:ss`, `yyyy-MM-dd'T'HH:mm`, `yyyy.MM.dd`;
* **discount** - discount;
* **type** - promo code type (letters and numbers).

The type must be the same in every row of the file: when the **type** column holds different values, each type is loaded as a list of its own.

<Callout icon="📘" theme="info">
  ### Important

  If you need to use only promo codes without other parameters, upload a file only with a code column.
</Callout>

If you upload only promo codes, tick the corresponding checkbox.

<Image src="https://files.readme.io/ba8991bc85623aab1188ad86139a61991267418517bb31dfd63adf41f487f04b-image.png" align="center" width="80% "  alt="Promo codes Upload file tab with the file drop area and Add only promo codes checkbox highlighted" />

A file entitled **General** will be uploaded into the system. All promo codes uploaded in this way will be displayed in this file.

<Image src="https://files.readme.io/9151aef72ccf61f21b992bf42f92f9ee649ba92d7a5a053d471e301e9f2a19b6-image.png" align="center" width="80% "  alt="Active promo codes tab listing type1, type2, type3, and the general file, with the general row highlighted" />

After downloading the file with **Type, Discount** and **Expired** parameters, you will see **Active**, **Sent** and **Upload** history tabs.

* On the **Active** tab, you can track the number of current and expired promo codes at the selected date:

<Image src="https://files.readme.io/5f4e24be3191a2aa199152ceab39998c2eac181a1c7d56b1e806288920de9900-image.png" align="center" width="80% "  alt="Active promo codes tab highlighted showing the total active and expired counts for a promo code type" />

* On the **Sent** tab, you can select a specific period and see the number of sent promotional codes of various types.

<Callout icon="📘" theme="info">
  ### Note

  Data on sent promotional codes are collected from 18:20 2023-02-17.
</Callout>

<Image src="https://files.readme.io/43f43b9987a646b76e72a9465368fecd268c02cb0c28ea0d80aa2715a72e595c-image.png" align="center" width="80% "  alt="Sent promo codes tab highlighted showing sent code counts by type over a selected date range" />

* To delete the promo codes list, go to the **Upload history** tab, click **...** → **Delete**:

<Image src="https://files.readme.io/9a55fe4311758a71a77097e4a4b8e49e93cbfaa25a9c901f2336e52d1683f870-image.png" align="center" width="80% "  alt="Upload history tab highlighted with a list of uploaded files and the Delete option open in a context menu" />

The expiration date of codes already uploaded can't be edited. To change it, delete the list and upload the codes again with a new **expirationDate**. There is also no way to export promo codes from the account, so keep the source file.

Keep an eye on the balance of each type.

* If there aren't enough codes of the required type for all recipients, a bulk campaign with a promo code variable (`%PC_GENERAL%` or `%PC_TYPE_EXPIRATIONDATE_DISCOUNT%`) is paused with the **No promo codes** status, and no messages are sent. To resume it, upload a new file with promo codes of this type in the same format, then open the campaign and click **Start**.
* If the promo code variable is inserted directly into an email that a workflow sends and there are no codes of the required type, the email isn't sent: in the workflow launch history, the sending block fails with **General email error**.
* If the codes run out, the **Get promo code** block doesn't stop the workflow — the message reaches the recipient without a code: the `$!promocode` variable is empty.

To be warned in advance, set up [notifications about the remaining promo codes](https://docs.esputnik.com/docs/notifications-for-trigger-control).

<Callout icon="📘" theme="info">
  ### Note

  There's no self-serve way to export the list of currently loaded promo codes from these tabs. If you need a CSV of the loaded codes, contact support to request one.
</Callout>

## Create an email

### For promo codes only

Insert the variable `%PC_GENERAL%` where you want your promo code in the email. At the moment of the campaign launch, the system will automatically replace it with the first valid promo code in the list.

The promo code is not substituted in the message preview. To see the code, send a test message to your own address.

<Callout icon="📘" theme="info">
  ### Note

  By default, dynamic content copied into the message context is stored for **60 days**. For mandatory (service) messages, this term was extended to **1 year** in June 2025. For `%PC_GENERAL%` in a bulk campaign, the reference point is 60 days.

  After this period, the dynamic data is no longer displayed in an email that was already sent, and new opens and link clicks in that email are no longer counted.
</Callout>

<Image src="https://files.readme.io/1beaa3d-promocodes12.jpg" align="center" width="55% "  alt="Email preview showing the %PC_GENERAL% variable in a dashed placeholder box under Grab your code" />

### For promo codes with additional parameters

Insert the variable `%PC_TYPE_EXPIRATIONDATE_DISCOUNT%`, where you want your promo code in the email. It may look as follows: `%PC_NewYear_1_7%` where **NewYear** is a promo code type, **1** is the minimum number of days the promo code is valid, and **7** is the disсount.

<Callout icon="🚧" theme="warn">
  ### Important

  We recommend setting the minimum promo code validity period to **1 day**. Promo codes will continue to be sent as long as more than 1 day remains before the promo codes in the file expire.

  The second position in the variable is a filter, not a campaign setting. For example, `30` in `%PC_type1_30_5%` does not set the campaign duration — it excludes promo codes with fewer than 30 days of validity left.

  The variable also works with a single promo code type. To insert codes of another type, use a separate variable with that type in the first position.
</Callout>

<Image src="https://files.readme.io/61716a1-promocodes15.jpg" align="center" width="40% "  alt="Email preview showing the %PC_NewYear_1_7% variable in a dashed placeholder box under Grab your code" />

<br />