v1

latestOpenAPI 3.0.32026-07-24235275.4 KB
Offers

Add discount codes

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.
post/coupons/coupon-pool/{coupon-pool-id}/create

Path parameters

coupon-pool-idinteger required

The ID created under "Create an Offer"

Request body

codesstring[] required

List of the discount code values. Number of discount codes must be between 0 and 200,000.

distributionStartstring

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.

distributionStopstring

Timestamp at which point the discount codes become invalid for distribution within Attentive messages. Must be in valid UTC ISO format.

Example request

{
  "codes": [
    "code1",
    "code2",
    "code3",
    "code4",
    "code5"
  ],
  "distributionStart": "2023-02-14T21:29:25Z",
  "distributionStop": "2023-02-15T21:29:25Z"
}

Response

Accepted. Check the Attentive Offers page to make sure that there are no errors and the remaining code count is accurate.