Check out API you can use to attach a promotional code to a profile in the Altcraft Marketing automation platform. 

Description

Attaches a promotion code to a profile.

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

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

Request URL

Method: POST

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

Request parameters

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

"profile_id"
"email"
"phone"
"custom"

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

ParameterTypeDescription
errorintError code
error_textstringError text