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
- JSON
- XML
{
"loyalty_id": 6,
"token": "abcdefghijklmnqrstuvwxyz"
}
<xml>
<loyalty_id>6</loyalty_id>
<token>abcdefghijklmnqrstuvwxyz</token>
</xml>
Response example
- JSON
- XML
{
"data": [
{
"code": "Code-1"
},
{
"code": "Code-2",
"attached": "2024-04-01T14:02:05Z",
"activated": "2024-04-01T14:04:12Z"
},
{
"code": "Code-3"
}
],
"error": 0,
"error_text": "Successful operation"
}
<xml>
<data>
<code>Code-1</code>
</data>
<data>
<activated>2024-04-01T14:04:12Z</activated>
<attached>2024-04-01T14:02:05Z</attached>
<code>Code-2</code>
</data>
<data>
<code>Code-3</code>
</data>
<error>0</error>
<error_text>Successful operation</error_text>
</xml>
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 |