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

# Manage Coupon Codes

You must generate the coupon codes prior to activating the Campaign. Coupon codes are generated to a tab separated file that can viewed with an app such as Notepad or Excel. For more details, see [Coupon Codes Format](#section_q2p_k3y_p4b). Once generated, store the coupon codes safely.

When a campaign is created and saved, it's in a pending state and the following options become available:

* **Generate Codes**: generates the defined quantity of coupon codes as a downloadable .tsv (Tab-Separated Values) file.
* **Download Codes**: downloads the TSV file containing the previously generated coupon codes.
* **Cancel Codes**: cancels all the previously generated coupon codes before the campaign is activated.
* **Replace Codes** cancels any previously generated coupon codes and replaces them with newly generated coupon codes.

Once a campaign is activated, you can generate additional coupons using the **Generate More Codes** option. Any coupon codes generated using this option is reflected in the **Quantity** count on the [Coupon Codes](#section_std_hvk_w5b) pane.

## Generate Coupon Codes

To generate coupon codes, do the following:

1. Create and save a coupon Campaign. The Campaign is saved as pending and is not yet active.

2. Generate the coupon codes, by clicking the **Generate Codes** button in the **Actions** panel.

   A progress bar displays the coupon codes generation progress. Once coupon code generation is complete, a .tsv (Tab-Separated Values) file is downloaded and can be viewed with an app such as Notepad or Excel. For more details, refer to [Coupon Codes Format](#section_q2p_k3y_p4b) .

3. Store the coupon codes file safely.

4. If you have generated coupon codes but need to download the .tsv file again, click **Download Codes** in the **Actions** panel.

5. If you want to replace the coupon codes, click **Replace Codes** in the **Actions** panel and a new .tsv file is created and downloaded.

6. To cancel the generated coupon codes, click **Cancel Codes** in the **Actions** panel

7. Remember to activate the campaign when you are ready.

   **Note:** For information on how to generate more coupon codes after the campaign has been activated, see [Generate More Coupon Codes](#section_std_hvk_w5b).

## Coupon Codes Format

The resulting coupons.tsv (tab-separated values) file can be viewed with an app such as Notepad or Excel. See the following example

```

1 jw:CUEXP5SC6UV4XSM6 jw5232018 54fd61e2fa419d1351417458b3262fad2c779d28 0
2 jw:YSA6MEWCUNK36NCN jw5232018 54fd61e2fa419d1351417458b3262fad2c779d28 0
3 jw:3FGCH4EJ5NUHFS8H jw5232018 54fd61e2fa419d1351417458b3262fad2c779d28 0
4 jw:4DBRWVG7N49PABRX jw5232018 54fd61e2fa419d1351417458b3262fad2c779d28 0
```

The following table breaks out the tab-separated code values as they appear, from left to right, in the file.

| Coupon Code Sequence | Coupon Code | Campaign ID/VID | Campaign Coupon Index Number |
| - | - | - | - |
| 1 | `jw:CUEXP5SC6UV4XSM6` | `jw5232018` | `0` |
| 2 | `jw:YSA6MEWCUNK36NCN` | `jw5232018` | `0` |
| 3 | `jw:3FGCH4EJ5NUHFS8H` | `jw5232018` | `0` |
| 4 | `jw:4DBRWVG7N49PABRX` | `jw5232018` | `0` |

where:

* Coupon Code Sequence—the numbering of the coupons to show how many coupons were generated.
* Coupon Code—The prefix and separator you defined appended with randomly generated 16-character alphanumeric strings. These are the codes of each individual coupon. This is what the customer enters to redeem the code.
* Campaign ID—merchant campaign identifier of the related Campaign.
* Campaign VID—Vindicia ID of the related Campaign.
* Campaign Coupon Index Number—sequence id, for use with future functionality, 0 for current campaigns

## Generate More Coupon Codes

Up to 3000 additional coupon codes can be generated after a campaign has been activated if the **On Demand Code Allowed** toggle on the **Campaign Details** pane is enabled.

To generate additional coupon codes in an active Campaign, do the following:

1. In the Campaign page, select **Generate More Codes** in the **Actions** panel.
2. Enter the quantity of codes you would like to create (up to 3,000) in the **Additional Quantity** field.
3. Click **Submit**.
4. The additional coupon codes are generated and downloaded as a.tsv file and the **Quantity** count in the Coupon Codes pane is updated to reflect the total number of codes generated including the new codes.

**Parent topic:**[Campaigns](../topics/campaignAbout)

**Parent topic:**[Working with Campaigns](../topics/campaignWorking)


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