Skip to main content

Import promo codes

Description

Imports one or multiple promo codes into a loyalty program.

Request URL

Method: POST

https://example.com/api/v1.1/promocodes/import

Request example

ParameterTypeExampleRequiredDescription
tokenstring"abcdefghijklmnqrstuvwxyz"YesAPI token
formatstring"json"NoResponse data format.
By default – json
codesJSON array
["CODE-1", "CODE-2"]
YesPromo codes list
loyalty_idint1YesLoyalty program ID

Request example

{
"codes": [
"CODE-1",
"CODE-2"
],
"loyalty_id": 1,
"token": "abcdefghijklmnqrstuvwxyz"
}

Response example

{
"data": [
{
"code": "CODE-1",
"error": 0,
"error_text": ""
},
{
"code": "CODE-2",
"error": 500,
"error_text": "Promocode duplicated"
}
],
"discarded_by_limit": 0,
"duplicated": 1,
"error": 0,
"error_text": "Successful operation",
"inserted": 1
}

Response parameters

ParameterTypeDescription
errorintError code
error_textstringError text
codestringPromo code
discarded_by_limitintImport error due to loyalty program limitations
duplicatedintImport error due to duplication
insertedintNumber of successfully imported promo codes