You can use the Offers API to add discount codes to an existing offer.
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.
offers:write
) Accepted. Check the Attentive Offers page to make sure that there are no errors and the remaining code count is accurate.
Invalid parameter in request query or body
Access Denied
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
Internal Server Error
{- "codes": [
- "code1",
- "code2",
- "code3",
- "code4",
- "code5"
], - "distributionStart": "2023-02-14T21:29:25Z",
- "distributionStop": "2023-02-15T21:29:25Z"
}
{- "error": {
- "id": 0,
- "message": "string"
}
}