# Coupons

> Give each email recipient their own single-use discount code, or one code for everyone, and see which codes were assigned and redeemed. Alpha: open to the Emailit team only.

A coupon puts a discount code into your emails with `{{coupon "key"}}`. A **unique codes** coupon hands each recipient their own code from a pool, so codes can't be shared. A **one code for everyone** coupon inserts the same code for all. Emailit hands out the codes; your shop checks them at checkout, so create the same codes in your shop.

> **Commerce is in alpha:** Commerce is open only to the Emailit team while we test it. See [Who can use Commerce](/docs/commerce/#who-can-use-commerce).

## Create a coupon

1. **Open Coupons.** On **Email Marketing → Commerce**, open the **Coupons** tab and select **Create coupon**.

2. **Fill in the coupon.**

   | Field | Notes |
   | --- | --- |
   | **Name** | For you, for example `Welcome 10%`. |
   | **Key** | What you write in content: `{{coupon "welcome10"}}`. Lowercase letters, digits, `-` and `_`, up to 64 characters. Content using an old key renders nothing, so keep it once the coupon is in use. |
   | **Type** | **Unique codes** or **One code for everyone**. |
   | **Code** | For one code for everyone, the code. |
   | **Fallback code** | For unique codes, optional: sent when the codes run out or the coupon has expired. Without one, the tag renders nothing in those cases. |
   | **Discount** | A label such as `10% off`, shown in the dashboard. |
   | **Expires** | Optional. After it, unique coupons only send the fallback code. |

3. **Add codes** to a unique coupon. Open it and select **Add codes**, then either:
   - **Upload codes** from your shop: one code per line, or a CSV with the codes in the first column, up to 10,000 at a time. Codes already in the pool are skipped.
   - **Generate codes**: Emailit creates random codes without look-alike characters (no 0, O, 1 or I), with an optional prefix. Then select **Export CSV** and create the same codes in your shop.

4. **Use it in content.** Put `{{coupon "welcome10"}}` in a campaign or automation email. See [Products, coupons and the cart](/docs/campaigns/products-and-coupons/#coupon-codes).

## How codes are handed out

- Each recipient gets one code per campaign or automation. If the same email is rendered again for them, for example the web version, they get the same code.
- Codes are assigned when the email is created, so a large campaign uses as many codes as it has recipients. Keep the pool bigger than your audience.
- Previews and test sends show a sample code such as `WELCOME10-PREVIEW` and don't use up codes.

## Track redemptions

When an [order](/docs/api-reference/orders/create/) lists a code in `coupon_codes`, Emailit marks it **Redeemed** with the order. A code used in your shop before Emailit handed it out is never sent. The coupon page shows how many codes are **Available**, **Assigned** and **Redeemed**, and lists the codes with who got them and when. **Export CSV** downloads the list.

Segments can find contacts who used a coupon with the `used_coupon` rule. See [Activity rules](/docs/api-reference/segments/create/#activity-rules).

## Use the API

| Endpoint | Use it to |
| --- | --- |
| [Create a coupon](/docs/api-reference/coupons/create/) | Create a unique or static coupon. |
| [Add coupon codes](/docs/api-reference/coupons/add-codes/) | Upload codes, or generate them with a count, prefix and length. |
| [List coupon codes](/docs/api-reference/coupons/list-codes/) | Read the pool, filtered by available, assigned or redeemed. |
| [List](/docs/api-reference/coupons/list/), [get](/docs/api-reference/coupons/get/), [update](/docs/api-reference/coupons/update/) and [delete](/docs/api-reference/coupons/delete/) | Manage coupons. |

## Related

  - [Products, coupons and the cart](/docs/campaigns/products-and-coupons/): Every commerce tag for email content.
  - [Commerce](/docs/commerce/): Connect your shop and see revenue from email.

---
Source: https://emailit.com/docs/commerce/coupons/
