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

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