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

# Unique coupons

> A one-time code per subscriber that expires in 48 hours. It cannot leak to coupon sites, and the deadline is real.

A normal discount code works for anyone who has it, for as long as it is
active. That is fine for a public sale, but a code you email to your list
ends up on coupon sites within days, and "48 hours only" is not true when the
code keeps working.

**Unique coupons** fix both. Turn a discount into a *unique per recipient*
discount and every subscriber gets their own code, like `VIP-7KQ2MX9D`:

* **One person.** The code only works with the email address it was sent to.
* **One use.** Once it is used it is gone, even for its owner.
* **A real deadline.** Each code expires a set time after it was issued (48
  hours by default).

<Note>
  Unique coupons are part of the **Growth** plan and above.
</Note>

## Set it up

<Steps>
  <Step title="Create the discount">
    Go to **Discounts → New discount**, set the value and the products as
    usual. The discount's own code (for example `VIP`) becomes the prefix of
    every one-time code. It no longer works at checkout on its own.
  </Step>

  <Step title="Turn on unique codes">
    Under **Unique codes**, switch on **One code per recipient** and choose how
    many hours each code lasts.
  </Step>

  <Step title="Put the merge tag in your email">
    Paste the merge tag shown on the discount into a post or an automation
    email:

    ```text theme={"system"}
    Your code: {{unique_coupon:6710b2c49e3f1a0012cd56ef}}
    ```

    When the email is sent, each recipient gets their own code in its place.
    `{{unique_coupon_url:<discountId>}}` gives a checkout link with the code
    and their email already filled in.
  </Step>
</Steps>

Test sends show a sample code (`VIP-SAMPLE00`) and issue nothing. Sending the
same post again to the same person reuses their code instead of issuing a
second one.

## What the buyer sees

At checkout the buyer types their code. If the code is tied to an email,
checkout asks for it and only accepts the address the code was sent to:

| Situation | Message |
| - | - |
| Another email | This code was sent to a different email address. Use the email it was sent to. |
| Already used | This code has already been used. |
| Past its deadline | This code has expired. |

The check happens on our servers when the checkout is created. The checkout
then holds the code for 30 minutes and the payment uses it up, so two people
(or two tabs) can never both pay with the same code: the second checkout is
told *This code is already being used in another checkout.* A declined or
abandoned checkout gives the code back.

## Issue codes in bulk

On the discount's **Unique codes** tab, **Generate codes** issues a batch:
paste a list of emails for codes bound to each address, or ask for a number
of unbound single-use codes (anyone can use one, once). **Export CSV**
downloads every code with its email, status and expiry, ready for another
email tool. The tab also shows how many codes were **issued**, **redeemed**
and **expired**.

## Limits

* One-time codes apply to one-time products (not subscription offers).
* If your plan no longer includes unique coupons, issued codes stop working
  at checkout and the merge tag is removed from new emails. Your discount and
  its history stay.

## From the API

Use `uniquePerRecipient` and `uniqueExpiryHours` on `POST /discounts`, and
`POST /discounts/{id}/unique-codes` to issue codes. See
[Unique coupons and personal deadlines](/api-reference/promotions).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.