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
{
"code": "CODE-12345",
"loyalty_id": 1,
"token": "abcdefghijklmnqrstuvwxyz"
}
Response example
{
"data": {
"created": "2020-04-02T11:41:47Z",
"is_attached": true,
"is_activated": false,
"is_expired": false,
"attached": "2020-04-02T16:58:15Z",
"activated": "",
"expired": "",
"expire_date": "",
"loyalty_id": 1,
"code": "CODE-12345",
"database_id": 1,
"profile_id": "5c94fbc103e42237764042f8"
},
"error": 0,
"error_text": "Successful operation"
}
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 |