Skip to main content

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

ParameterTypeExampleRequiredDescription
tokenstring"abcdefghijklmnqrstuvwxyz"YesAPI token
formatint"json"NoResponse data format.
By default – json.
loyalty_idint1YesLoyalty program ID

Request example

{
"loyalty_id": 6,
"token": "abcdefghijklmnqrstuvwxyz"
}

Response example

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

Response parameters

ParameterTypeDescription
dataArrayPromo codes list
codestringPromo code
attachedstringAttachment date. No property if not attached
activatedstringActivation date. No property if not activated
expire_datestringPromo code expiry date. Optional parameter
expiredstringExpiry date in case a promo code is expired
errorintError code
error_textstringError text