AddCode
Add a redemption code for a personal ('single-use') code type. Optional parameters: codeState and customCodeInfo.
Service | Operation |
---|---|
redemptionCode | ADD_CODE |
Method Parameters
Parameter | Description |
---|---|
scanCode | A scan code (also referred to as a Promo Code). Warning: If the scanCode added is less than 25 characters, the optional codeType must be specified in order to redeem it. |
codeType | The personal ('single-use') code type. Corresponds to the Campaign Name in the Design Portal. |
codeState | Initial state of the redemption code. |
customCodeInfo | Optional custom information. |
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 scanCode = "a_scan_code";
var codeType = "the_code_type";
var codeState = "Available";
var customCodeInfo = {};
var redemptionCodeProxy = bridge.getRedemptioncodeServiceProxy();
var postResult = redemptionCodeProxy.addCode(scanCode, codeType, codeState, customCodeInfo);
{
"service":"redemptionCode",
"operation":"ADD_CODE",
"data":{
"scanCode":"a_scan_code",
"codeType":"the_code_type",
"codeState":"Available",
"customCodeInfo":{}
}
}
JSON Response
{
"data": {
"gameId": "23782",
"scanCode": "a-scan-code",
"codeType": "ct",
"redemptionCodeId": "7379b058-8669-4199-b4bb-712f1e77ea8e",
"version": 1,
"codeState": "Inactive",
"customCodeInfo": {},
"customRedemptionInfo": {},
"redeemedByProfileId": null,
"redeemedByProfileName": null,
"invalidationReason": null,
"createdAt": 1655483646387,
"activatedAt": 1655483646387,
"redeemedAt": null,
"invalidatedAt": null,
"updatedAt": 1655483646387
},
"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 |