GenerateCodes
Generates specified quantity of redemption codes for a personal ('single-use') code type.
Service | Operation |
---|---|
redemptionCode | GENERATE_CODES |
Method Parameters
Parameter | Description |
---|---|
codeType | The personal ('single-use') code type. Corresponds to the Campaign Name in the Design Portal. |
codeState | Optional. Initial state of the redemption code: 'Inactive' or 'Available'. Defaults to 'Inactive'. |
quantity | The quantity of scan codes to be generated. |
customCodeInfo | Optional custom information, as JSON object. |
prefix | Prefix for all scan codes generate. Optional. |
algorithmName | Name of the algorithm to be used to generate the codes. Currently supporting 'StructuredGuid' and 'FiveByFive'. |
algorithmDetailsJson | Optional algorithm details, as JSON object. |
emailAddress | Email address to send to for background generated codes. Optional. |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
var codeType = "the-code-type";
var codeState = "Available";
var quantity = 100;
var customCodeInfo = {};
var prefix = "";
var algorithmName = "FiveByFive";
var algorithmDetailsJson = {
"includeCheck": false
};
var emailAddress = "name@domain";
var redemptionCodeProxy = bridge.getRedemptioncodeServiceProxy();
var postResult = redemptionCodeProxy.generateCodes(codeType, codeState, quantity, customCodeInfo, prefix, algorithmName, algorithmDetailsJson, emailAddress);
{
"service":"redemptionCode",
"operation":"GENERATE_CODES",
"data":{
"codeType":"the-code-type",
"codeState":"Available",
"quantity":100,
"customCodeInfo":{},
"prefix":"",
"algorithmName":"FiveByFive",
"algorithmDetailsJson":{
"includeCheck":false
},
"emailAddress":"name@domain"
}
}
JSON Response
{
"data": {
"message": "Generating 100 redemption codes using FiveByFive algorithm and options (includeCheck=false)"
},
"status": 200
}
Common Error Code
Status Codes
Code | Name | Description |
---|---|---|
40399 | REDEMPTION_CODE_TYPE_NOT_FOUND | The specified code type was not found |
40753 | REDEMPTION_CODE_TYPE_DISABLED | Invalid code. Redemption code type has been disabled |