> ## 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.

# Troubleshooting Coupon Batches

> Fix common coupon batch problems: a batch stuck on Preparing Codes, an Error status, rejected codes, a disabled Create offer button, and a batch that cannot be deleted.

## The batch is still "Preparing Codes"

Creating codes in Shopify takes time, and large batches can take several minutes.
You can leave the page; the work continues, and you get an email when it finishes
if you left notifications on.

* If the percentage and count keep moving, nothing is wrong.
* If the page says "We are checking with Shopify and will continue automatically",
  Shopify is slow to respond or has asked us to wait. We retry on our own.
* If the page says "Shopify is taking longer than expected", we are still
  checking automatically. Give it more time before you contact support.
* A very large batch can be created in several runs. Between runs the batch
  pauses briefly and then continues.

## The batch shows "Error"

The batch page shows a message about what went wrong. These are the messages you
can fix yourself:

| Message | What to do |
| - | - |
| Codes can be added after the batch is ready for use. | Wait for the batch to be **Ready**, then add the codes again. |
| Shopify did not respond in time. Try again, or contact support if this continues. | Try again in a few minutes. |
| Codes can be at most 255 bytes. Shorten the prefix, suffix, or code length. (or "Code N is too long.") | Shorten the prefix, suffix, or code length. For a file, fix the long code it names. |
| No coupon codes were provided. Add at least one code. | Add at least one code. |
| Blank coupon codes on line(s) … | Remove the blank lines from the list and add the codes again. |
| Duplicate code(s) supplied: … | Remove the duplicates and add the codes again. |
| Too many codes. The CSV (or PASTE) limit is … | Split the codes across several adds. Paste allows 1,000 codes and CSV allows 100,000 codes. Generating allows 100,000 codes per add. |
| Import file exceeds the … limit. | Use a file of up to 15 MB, or split it. |
| The coupon-code file was not received (or could not be found). Upload it again. | Upload the file again. |
| Select at least one eligible customer, segment, or market in the batch settings. | Open the **Settings** tab and choose who is eligible. See [Eligibility](/coupons/settings#eligibility). |
| Added N of M codes before processing stopped. You can add the remaining codes again. | Add the remaining codes. Codes already added are kept. |
| Adding these codes didn't finish. Add them again. | Add the codes again. |
| Shopify did not accept any codes. Review the rejected codes in the batch timeline. | See [Rejected codes](#rejected-codes). |
| We could not finish processing this coupon batch. Contact support for help. | Use the support form shown with the message; it emails our team the details. |

## Rejected codes

Shopify can refuse a code, for example one that already exists in your store. When
that happens the batch keeps the codes Shopify accepted, and the **Timeline** entry
for that add shows how many were refused.

1. Open the batch and look at the **Timeline** on the **Settings** tab.
2. Select the "Rejected N codes" link in the entry for the add. A window lists
   the codes Shopify refused.
3. Fix or replace them, and [add them again](/coupons/adding-codes).

## "Create offer" is greyed out

Hover over the button to see why. The reasons are:

| Reason | What to do |
| - | - |
| An offer can't be created because this batch has an error | Resolve the error first. |
| Codes are still being prepared | Wait until the batch is **Ready**. |
| This batch isn't synced with Shopify yet | Wait for syncing to finish. If it does not, contact support. |
| This batch is missing its Shopify discount | Contact support. |
| Save or discard your changes in Settings | Save or discard the unsaved changes on the **Settings** tab. |

The batch picker in an offer hides batches that are not ready for the same reasons.

## The batch cannot be deleted

"The batch cannot be deleted when linked to an offer." Open the **Linked Offers**
tab. Remove the batch from those offers, or delete the offers, then delete the
batch. If you delete the last offer there, you can delete the batch at the same
time.

## A customer's code does not work

1. Check the batch is **Ready** or **In Use**, and that the code is in the **Codes
   in Batch** tab.
2. Check an offer on the batch is active and its own dates cover today. Each offer
   applies only within its own dates. See [dates](/coupons/using-with-offers#dates).
3. Check the batch's [eligibility](/coupons/settings#eligibility) allows the
   customer, and that the cart meets the offer's conditions.
4. If the batch is limited to once per customer, the customer may have used the
   code already.
5. Test the offer with the code. See [Testing offers](/offers/testing).

## Contact support

If a message says "Contact support for help", use the support form shown with it.
It emails us the details of what you were doing, but not the codes themselves.


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