GenerateCodesInline
Generates specified quantity of redemption codes inline.
Service | Operation |
---|---|
redemptionCode | GENERATE_CODES_INLINE |
Method Parameters
Parameter | Description |
---|---|
codeType | The code type. |
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. |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
// S2S call: to view example, switch to the Cloud Code or Raw tab.
// S2S call: to view example, switch to the Cloud Code or Raw tab.
// S2S call: to view example, switch to the Cloud Code or Raw tab.
// S2S call: to view example, switch to the Cloud Code or Raw tab.
// S2S call: to view example, switch to the Cloud Code or Raw tab.
// S2S call: to view example, switch to the Cloud Code or Raw tab.
var codeType = "the-code-type";
var codeState = "Available";
var quantity = 10;
var customCodeInfo = {};
var prefix = "";
var algorithmName = "FiveByFive";
var algorithmDetailsJson = {
"includeCheck": false
};
var redemptionCodeProxy = bridge.getRedemptionCodeServiceProxy();
var postResult = redemptionCodeProxy.generateCodesInline(codeType, codeState, quantity, customCodeInfo, prefix, algorithmName, algorithmDetailsJson);
if (postResult.status == 200) {
// Success!
}
{
"service": "redemptionCode",
"operation": "GENERATE_CODES_INLINE",
"data":
{
"codeType": "the-code-type",
"codeState": "Available",
"quantity": 10,
"customCodeInfo": {},
"prefix": "",
"algorithmName": "FiveByFive",
"algorithmDetailsJson": {
"includeCheck": false
}
}
}
JSON Response
{
"data": {
"generatedScanCodes": [
"vfaok-yu7gy-y4ida-jhibz-rtikc",
"umy5u-ok0hj-afsc9-cz0tc-1jkvw",
"poclc-f5bo1-f1jfr-bh2tm-cvuuf",
"ckqzl-ogn2x-isdyr-utgr4-azx7f",
"iivv8-2fjbo-mnvl4-hwvwc-axurj",
"zdgsq-tsywh-hbhnf-bt90z-bwzqs",
"qji29-hjk0a-lrk4v-yvll7-gd3or",
"yi0uu-fsxkv-tdz3o-ebds7-qbyhk",
"sbozv-tcp5x-4nzlg-hykok-zmk66",
"zuzis-l1qva-qixmz-e3n5f-5qax6"
],
"message": "Generating 10 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 |
40660 | INVALID_PARAMETER_VALUE | Invalid quantity, cannot:exceed: 100 |
40753 | REDEMPTION_CODE_TYPE_DISABLED | Invalid code. Redemption code type has been disabled |