---
title: "Add discount codes"
method: POST
path: "/coupons/coupon-pool/{coupon-pool-id}/create"
tags: ["Offers"]
---

# Add discount codes

`POST /coupons/coupon-pool/{coupon-pool-id}/create`

Note: Once the offer(s) has been created, please reach out to an Attentive team member to enable this API feature for you

Make a call to this asynchronous endpoint to create new discount codes in an existing offer.
<h2>Validation rules</h2>
<ul>
<li>Maximum of 200,000 discount codes per request.</li>
<li><code>distributionStart</code> must be before <code>distributionStop</code>, in UTC ISO format (e.g., <code>2023-02-14T21:29:25Z</code>).</li>
<li>Date ranges must not overlap with ranges from previous uploads to the same offer. Uploading to an existing range is allowed.</li>
<li>All uploads in an offer must use the same distribution type. If previous uploads include expiration dates, new uploads must also include them, and vice versa.</li>
<li>The offer (coupon pool) must exist and belong to your account.</li>
</ul>
<h2>Sync behavior</h2>
Check the status on the offer to monitor progress. If it still says <strong>SYNCING</strong>, the uploads may not be ready yet.

## Path parameters

- `coupon-pool-id` integer, required

## Request body

- CreateCouponsDto
  - `codes` string[], required — List of the discount code values. Number of discount codes must be between 0 and 200,000.
  - `distributionStart` string — Timestamp at which point the discount codes become valid for distribution within Attentive messages. Must be in valid UTC ISO format e.g. 2023-03-04T21:29:25Z. If null, the discount codes never expire.
  - `distributionStop` string — Timestamp at which point the discount codes become invalid for distribution within Attentive messages. Must be in valid UTC ISO format.

## Response `202`

Accepted. Check the Attentive [Offers](https://ui.attentivemobile.com/offers) page to make sure that there are no errors and the remaining code count is accurate.

## Other responses

- `400` — Invalid parameter in request query or body
- `403` — Access Denied
- `404` — Bad Request. Invalid parameter in request query or body. The following scenarios will cause a 400 response: A) Including distributionStart and distributionStop dates that overlap with the distributionStart and distributionStop dates from a previous call, B) Including distributionStart and distributionStop dates in an offer that has a distribution window of “Never expire” or “Time to live”, C) Excluding distributionStart and distributionStop dates in an offer that has a distribution window of “Custom time period”, D) Including a distributionStart value that is after the distributionStop value
- `500` — Internal Server Error

---

[API](https://skmtc.net/attentive/apis/attentive-api-v2.md) · [All operations](https://skmtc.net/attentive/apis/attentive-api-v2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/attentive/attentive-api-v2/versions/be387e501197/schema)
