Page tree
Skip to end of metadata
Go to start of metadata


Attaches a promotion code to a profile.

If a "code" parameter is specified, it will be used for promo code matching.

  • If the code is already attached and its multiple usage is restricted, an error will occur.
  • If a code is found unattached - it will be attached.
  • If a code is not found - it will be imported and attached.

With no "code" parameter loyalty program ID will be used for matching.

  • If there are promo codes available in a loyalty program - one will be attached.

Request URL

Method: POST

Request parameters

tokenstring"abcdefghijklmnqrstuvwxyz"YesAPI token
codestring"CODE-12345"NoPromo code
db_idint1YesDatabase ID
emailstring""NoEmail address
formatstring"json"NoResponse data format.
By default – json
NoCustom database field for profile matching
NoCustom field value


NoProfiles matching mode
loyalty_idint1YesLoyalty program ID
phonestring"+79000000000"NoPhone number
profile_idstring"abcdefghijklmnqrstuvwxyz"NoProfile ID

Request example

    "code": "CODE-12345",
    "db_id": 1,
    "loyalty_id": 1,
    "profile_id": "abcdefghijklmnqrstuvwxyz",
    "token": "abcdefghijklmnqrstuvwxyz"

Response example

    "data": null,
    "error": 0,
    "error_text": "Successful operation"

Response parameters

errorintError code
error_textstringError text
  • No labels