Get all promo codes
Description
Retrieves all promo codes from a loyalty program.
URL
Method: POST
https://example.com/api/v1.1/promocodes/export_all
Request parameters
Parameter | Type | Example | Required | Description |
---|---|---|---|---|
token | string | "abcdefghijklmnqrstuvwxyz" | Yes | API token |
format | int | "json" | No | Response data format. By default – json. |
loyalty_id | int | 1 | Yes | Loyalty program ID |
Request example
{
"loyalty_id": 1,
"token": "abcdefghijklmnqrstuvwxyz"
}
Response example
{
"data": [{
"activated": "2018-08-10T08:00:00Z",
"attached": "2018-08-10T08:00:00Z",
"code": "CODE-12345"
}],
"error": 0,
"error_text": "Successful operation"
}
Response parameters
Parameter | Type | Description |
---|---|---|
data | Array | Promo codes list |
code | string | Promo code |
attached | string | Attachment date. No property if not attached |
activated | string | Activation date. No property if not activated |
expire_date | string | Promo code expiry date. Optional parameter |
expired | string | Expiry date in case a promo code is expired |
error | int | Error code |
error_text | string | Error text |