Skip to main content
Altcraft Docs LogoAltcraft Docs Logo
User guideDeveloper guideAdmin guide
Company siteHelp center
English
  • Русский
  • English
v74
  • v74
  • v73
  • v72
Login
  • User API documentation
  • API interaction
  • Matching
  • Profiles
  • Databases
  • Resources
  • Segments
  • Suppression lists
  • Templates and fragments
  • Campaigns
  • Mailings
  • Automation scenarios
  • Loyalty Programs
  • Promo codes
    • Import promo codes
    • Get promo code information
    • Activate promo code
    • Update promo code
    • Attach promo code
    • Detach promo code
    • Get all promo codes
  • Goals
  • Application push notifications
  • Market
  • Analytic reports
  • SendersDev
  • External datatables queries
  • Objects
  • Miscellaneous
  • Importing the API collection in Postman
  • List of API endpoints
  • SDK
  • Promo codes
  • Detach promo code
Documentation for version v74

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​

  • JSON
  • XML
{
"token": "abcdefghijklmnqrstuvwxyz",
"code": "Code-1",
"db_id": 1,
"loyalty_id": 4,
"matching": "profile_id",
"profile_id": "abcdefghijklmnqrstuvwxyz"
}
<xml>
<token>abcdefghijklmnqrstuvwxyz</token>
<code>Code-1</code>
<db_id>1</db_id>
<loyalty_id>4</loyalty_id>
<matching>profile_id</matching>
<profile_id>abcdefghijklmnqrstuvwxyz</profile_id>
</xml>

Response example​

  • JSON
  • XML
{
"data": null,
"error": 0,
"error_text": "Successful operation"
}
<xml>
<data></data>
<error>0</error>
<error_text>Successful operation</error_text>
</xml>

Response parameters​

ParameterTypeDescription
errorintError code
error_textstringError text
Last updated on Feb 26, 2024
Previous
Attach promo code
Next
Get all promo codes
  • Description
  • Request URL
  • Request parameters
  • Request example
  • Response example
  • Response parameters
© 2015 - 2025 Altcraft, LLC. All rights reserved.