Skip to main content

Detach promo code

Description

Detaches a promotion code from a profile.

Use one of these parameters for profile matching:

  • email
  • field_name, field_value
  • phone
  • profile_id

If no "code" parameter is specified or if a specified code is attached to multiple profiles — an error will be returned.

Request URL

method: POST

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

Request parameters

ParameterTypeExampleRequiredDescription
tokenstring"abcdefghijklmnqrstuvwxyz"YesAPI token
codestring"CODE-12345"NoPromotion code
db_idint1YesDatabase ID
emailstring"john@example.com"NoEmail address
formatstring"json"NoResponse data format.
By default – json
field_namestring
NoCustom profile matching field
field_valuestring
NoCustom field value
matchingstring"profile_id"
"email"
"phone"
"custom"
NoProfiles matching mode
loyalty_idint1YesLoyalty program ID

Request example

{
"token": "abcdefghijklmnqrstuvwxyz",
"code": "Code-1",
"db_id": 1,
"loyalty_id": 4,
"matching": "profile_id",
"profile_id": "abcdefghijklmnqrstuvwxyz"
}

Response example

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

Response parameters

ParameterTypeDescription
errorintError code
error_textstringError text