Get promo code information
Description
Retrieves a loyalty program promotional code information.
Request URL
Method: POST
https://example.com/api/v1.1/promocodes/get
Request parameters
| Parameter | Type | Example | Required | Description |
|---|---|---|---|---|
| token | string | "abcdefghijklmnqrstuvwxyz" | Yes | API token |
| format | int | "json" | No | Response data format By default – json |
| code | string | "CODE-12345" | Yes | Promo code |
| loyalty_id | int | "1" | Yes | Loyalty program ID |
Request example
- JSON
- XML
{
"token": "abcdefghijklmnqrstuvwxyz",
"code": "CODE-1",
"loyalty_id": 5
}
<xml>
<token>abcdefghijklmnqrstuvwxyz</token>
<code>CODE-1</code>
<loyalty_id>5</loyalty_id>
</xml>
Response example
- JSON
- XML
{
"data": {
"created": "2024-04-01T12:39:34Z",
"is_attached": false,
"is_activated": false,
"is_expired": false,
"attached": "",
"activated": "",
"expired": "",
"expire_date": "",
"loyalty_id": 5,
"code": "CODE-1"
},
"error": 0,
"error_text": "Successful operation"
}
<xml>
<data>
<activated/>
<attached/>
<code>CODE-1</code>
<created>2024-04-01T12:39:34Z</created>
<expire_date/>
<expired/>
<is_activated>false</is_activated>
<is_attached>false</is_attached>
<is_expired>false</is_expired>
<loyalty_id>5</loyalty_id>
</data>
<error>0</error>
<error_text>Successful operation</error_text>
</xml>
Response parameters
| Параметр | Тип | Описание |
|---|---|---|
| error | int | Error code |
| error_text | string | Error text |
| activated | datetime | Promo code activation time |
| attached | datetime | Promo code attach time |
| code | string | Promo code |
| created | datetime | Promo code creation time |
| expire_date | datetime | Promo code expire date |
| expired | datetime | Promo code expire date |
| is_activated | bool | Activation flag |
| is_attached | bool | Attached to a profile flag |
| is_expired | bool | Expired flag |
| loyalty_id | int | Loyalty program ID |
| database_id | int | Database ID, if promocode attached to profile |
| profile_id | string | Profile ID, if promocode attached to profile |