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
  • Import promo codes
Documentation for version v74

Import promo codes

Description​

Imports one or multiple promo codes into a loyalty program.

Request URL​

Method: POST

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

Request example​

ParameterTypeExampleRequiredDescription
tokenstring"abcdefghijklmnqrstuvwxyz"YesAPI token
formatstring"json"NoResponse data format.
By default – json
codesJSON array
["CODE-1", "CODE-2"]
YesPromo codes list
loyalty_idint1YesLoyalty program ID

Request example​

  • JSON
  • XML
{
"token": "abcdefghijklmnqrstuvwxyz",
"codes": [
"CODE-1",
"CODE-2"
],
"loyalty_id": 1
}
<xml>
<token>abcdefghijklmnqrstuvwxyz</token>
<codes>CODE-1</codes>
<codes>CODE-2</codes>
<loyalty_id>6</loyalty_id>
</xml>

Response example​

  • JSON
  • XML
{
"data": [
{
"code": "CODE-1",
"error": 0,
"error_text": ""
},
{
"code": "CODE-2",
"error": 0,
"error_text": ""
}
],
"discarded_by_limit": 0,
"duplicated": 0,
"error": 0,
"error_text": "Successful operation",
"inserted": 2
}
<xml>
<data>
<code>CODE-1</code>
<error>0</error>
<error_text/>
</data>
<data>
<code>CODE-2</code>
<error>0</error>
<error_text/>
</data>
<discarded_by_limit>0</discarded_by_limit>
<duplicated>0</duplicated>
<error>0</error>
<error_text>Successful operation</error_text>
<inserted>2</inserted>
</xml>

Response parameters​

ParameterTypeDescription
errorintError code
error_textstringError text
codestringPromo code
discarded_by_limitintImport error due to loyalty program limitations
duplicatedintImport error due to duplication
insertedintNumber of successfully imported promo codes
Last updated on Feb 26, 2024
Previous
Promo codes
Next
Get promo code information
  • Description
  • Request URL
  • Request example
  • Request example
  • Response example
  • Response parameters
© 2015 - 2025 Altcraft, LLC. All rights reserved.