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

{
"token": "abcdefghijklmnqrstuvwxyz",
"code": "CODE-1",
"loyalty_id": 5
}

Response example

{
"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"
}

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