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

# Creating Coupon Batches

> Create a coupon batch in Atom Commerce by generating unique codes or by pasting or uploading your own, and see what happens after you save.

Create a batch to get many unique discount codes in your Shopify store. New to
batches? Read the [overview](/coupons/overview) first.

## Create a batch

1. Open **Coupon Batches** in the main menu and select **Create Coupon Batch**.
2. Enter a **Name** for the batch, for example "Spring newsletter".
3. Choose where the codes come from, then fill in the settings for that choice
   (see below).
4. Review the [eligibility, combinations, and limits](/coupons/settings).
5. Choose whether to be notified when processing finishes. **Notify me when
   processing is done** is on by default, and we email you.
6. Select **Create batch**.

A **Batch summary** beside the form shows the name, the number of codes, the
total code length, and sample codes for generated batches.

## Choose where the codes come from

<Tabs>
  <Tab title="Generate codes">
    Atom Commerce creates unique codes from your settings.

    | Setting | What it does |
    | - | - |
    | **Number of coupons** | How many codes to create, up to 20 million. When your settings allow fewer, the field tells you the limit ("Up to 5,000 codes with these settings"). |
    | **Prefix** (optional) | Text at the start of every code, for example `SPRING-`. |
    | **Generated characters per code** | Length of the random part. The minimum is 6. |
    | **Suffix** (optional) | Text at the end of every code. |
    | **Character set** | Letters and numbers, letters only, or numbers only. |
    | **Exclude specific characters** | Characters that never appear in the random part. By default the vowels and look-alike characters such as `0`, `O`, `1`, `I`, and `L` are left out, so codes are easy to read and type. |

    A longer random part and a larger character set allow more codes. A batch can
    use up to 95% of the possible combinations, so the number you can create is a
    little lower than the raw total. If you ask for more than the settings allow,
    the form shows the limit, and you can lengthen the codes or widen the
    character set.

    <Note>
      Shopify limits a discount code to 255 bytes. The form checks the total
      length of the prefix, random part, and suffix, and shows an error if it is
      too long.
    </Note>
  </Tab>

  <Tab title="Manual">
    You provide the codes.

    * **Paste codes**: one code per line, up to 1,000 codes.
    * **Upload CSV**: one code per row, up to 100,000 codes, and a file of up to
      15 MB. A first row such as `code` is treated as a header and skipped. A
      file with more than one column is rejected.

    Every code must be unique and not blank. The form tells you what to fix.
    Shopify can still refuse a code, for example one that already exists in your
    store. Refused codes are listed on the batch page. See
    [Troubleshooting](/coupons/troubleshooting#rejected-codes).
  </Tab>
</Tabs>

## What happens after you save

A dialog confirms the batch settings are saved, then shows the batch as
**Preparing Codes** with a percentage and a count ("400 of 1,000 added"). Atom
Commerce is creating each code as a discount code in your Shopify store, so
customers can use it at checkout.

* Large batches can take several minutes.
* You can close the dialog. Preparing continues, and you can follow it on the
  batch page and in the batch list. If you left notifications on, we email you
  when it is done.
* When it finishes, the batch is **Ready**.

If Shopify is slow to respond, the batch keeps going and the page says so. If it
cannot finish, the batch shows **Error**. See [Troubleshooting](/coupons/troubleshooting).

## After you create a batch

* The code settings (prefix, suffix, length, character set, and so on) are fixed
  once the batch exists. To get codes with different settings, add codes with
  new settings or create another batch. See [Adding codes](/coupons/adding-codes).
* You can still rename the batch and change its
  [eligibility, combinations, and limits](/coupons/settings).
* Next, [use the batch in an offer](/coupons/using-with-offers).


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