Skip to main content
Version: 6.0.0

RedeemCode

Redeem a code.

Note that if the optional codeType is not provided, the system assumes that codes <= 20 characters are shared ('multi-use') codes - while codes >= 25 characters are personal ('single-use') codes.

ServiceOperation
redemptionCodeREDEEM_CODE

Usage​

http://localhost:3000
string scanCode = "a scan code";
string codeType = "a code type";
string customRedemptionInfo = "{}";
SuccessCallback successCallback = (response, cbObject) =>
{
Debug.Log(string.Format("Success | {0}", response));
};
FailureCallback failureCallback = (status, code, error, cbObject) =>
{
Debug.Log(string.Format("Failed | {0} {1} {2}", status, code, error));
};

_bc.RedemptionCodeService.RedeemCode(scanCode, codeType, customRedemptionInfo, successCallback, failureCallback);
JSON Response
{
"data": {
"gameId": "23782",
"scanCode": "vfaok-yu7gy-y4ida-jhibz-rtikc",
"codeType": "ct",
"redemptionCodeId": "ea2db0da-ef7b-4390-b747-df2eafaba2a3",
"version": 2,
"codeState": "Redeemed",
"customCodeInfo": {},
"customRedemptionInfo": {},
"redeemedByProfileId": "c5ecdbda-5f91-41a9-96aa-174f412f7657",
"redeemedByProfileName": "",
"invalidationReason": null,
"createdAt": 1655757623392,
"activatedAt": 1655757623392,
"redeemedAt": 1655758430895,
"invalidatedAt": null,
"updatedAt": 1655757623392
},
"status": 200
}
Common Error Code

Status Codes​

CodeNameDescription
40395REDEMPTION_CODE_NOT_FOUNDThe specified code was not found
40398REDEMPTION_CODE_NOT_ACTIVEThe specified code is not active
40399REDEMPTION_CODE_TYPE_NOT_FOUNDThe specified code type was not found
40401REDEMPTION_CODE_REDEEMEDThe code has already been redeemed
40402REDEMPTION_CODE_REDEEMED_BY_SELFThe code has already been redeemed by the calling user
40403REDEMPTION_CODE_REDEEMED_BY_OTHERThe code has already been redeemed by another user

Method Parameters​

ParameterDescription
scanCodeThe code to redeem. Sometimes referred to as the Promo Code in the Design Portal.
codeTypeThe type of code. Corresponds to the Campaign Name in the Design Portal.
jsonCustomRedemptionInfoOptional - A JSON string containing custom redemption data