Skip to main content

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

ParameterTypeExampleRequiredDescription
tokenstring"abcdefghijklmnqrstuvwxyz"YesAPI token
formatint"json"NoResponse data format
By default – json
codestring"CODE-12345"YesPromo code
loyalty_idint"1"YesLoyalty 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

ПараметрТипОписание
errorintError code
error_textstringError text
activateddatetimePromo code activation time
attacheddatetimePromo code attach time
codestringPromo code
createddatetimePromo code creation time
expire_datedatetimePromo code expire date
expireddatetimePromo code expire date
is_activatedboolActivation flag
is_attachedboolAttached to a profile flag
is_expiredboolExpired flag
loyalty_idintLoyalty program ID
database_idintDatabase ID, if promocode attached to profile
profile_idstringProfile ID, if promocode attached to profile