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.

Validation rules

  • Maximum of 200,000 discount codes per request.
  • distributionStart must be before distributionStop, in UTC ISO format (e.g., 2023-02-14T21:29:25Z).
  • Date ranges must not overlap with ranges from previous uploads to the same offer. Uploading to an existing range is allowed.
  • 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.
  • The offer (coupon pool) must exist and belong to your account.

Sync behavior

Check the status on the offer to monitor progress. If it still says SYNCING, the uploads may not be ready yet.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Path Params
int64
required

The ID created under "Create an Offer"

Body Params
codes
array of strings
required

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

codes*
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.

string

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

Responses
202

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

Language
Credentials
OAuth2
LoadingLoading…
Response
Choose an example:
application/json