Skip to main content
Version: 6.0.0

SysTestRedeemCode

Redeems a code on behalf of the calling player, same as RedeemCode, while allowing testers to optionally bypass certain redemption constraints. The calling player must have isTester=true on their profile.

tip

Despite the Sys naming convention, this is not callable via true server-to-server (app-secret) authentication - only from an authenticated player session (client SDK or Cloud Code running as the player). It also skips the failed-redemption retry-limit check that normally applies to RedeemCode.

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
redemptionCodeSYS_TEST_REDEEM_CODE

Method Parameters

ParameterDescription
scanCodeThe code to redeem. Sometimes referred to as the Promo Code in the Design Portal.
codeTypeOptional - The type of code. Corresponds to the Campaign Name in the Design Portal.
customRedemptionInfoOptional - A JSON string containing custom redemption data
optionsJsonOptional control flags for testers. ignoreDisabled (boolean, default false): allow redeeming a code whose code type is disabled. ignoreInactive (boolean, default false): allow redeeming a code still in the Inactive state. ignoreValidStart (boolean, default false): allow redeeming before the code type's validStart (the validEnd is always still respected).

Usage

http://localhost:3000
// Cloud Code only. To view example, switch to the Cloud Code tab
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
41061REDEMPTION_CODE_NOT_A_TESTERThe calling player is not flagged as a tester (isTester=true required to use this operation).
40395REDEMPTION_CODE_NOT_FOUNDThe specified code was not found
40398REDEMPTION_CODE_NOT_ACTIVEThe specified code is not active (unless ignoreInactive is set)
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
40753REDEMPTION_CODE_TYPE_DISABLEDThe code type is disabled (unless ignoreDisabled is set)