Skip to main content
Version: 5.7.0

ProcessAsynchronousResponse

Callback with asynchronous response for the redemption code service to process for an asynchronous redemption code.

ServiceOperation
redemptionCodePROCESS_ASYNCHRONOUS_RESPONSE

Method Parameters

ParameterDescription
scanCodeThe scan code being redeemed. Required.
redemptionCodeIdThe redemption code id of the redemption code being processed. Required.
codeTypeThe type of the scan code. Optional. Corresponds to the Campaign Name in the Design Portal.
attemptThe applicable attempt number associated with the redemption attempt being processed. Required.
asyncResponseRequired asynchronous response info, as JSON object, indicating status via success and complete flags, along with applicable, but optional, customRedemptionInfo (JSON object) and/or errorCode (Integer) and errorMsg (String). Note: A timeout exception is thrown if the max asynchronous processing time (configured for the associated redemption code type) has been exceeded and processing is still in progress (complete: false).

Usage

http://localhost:3000
// Cloud Code only. To view example, switch to the Cloud Code tab
JSON Response
{
"data": {
"gameId": "23713",
"scanCode": "fdjsl-zh5h2-mwdw1-no0ua-x40ci",
"codeType": "test22",
"redemptionCodeId": "b75e0c13-08d2-41d1-9cf6-ff4a72356d2f",
"version": 3,
"codeState": "InProgress",
"customCodeInfo": {
"factoryId": 22
},
"customRedemptionInfo": {
"transaction_id": "9d3936f686fccd646669f67f332440e54a48f5c05a562c89a6637dc1125654eb"
},
"redeemedByProfileId": null,
"redeemedByProfileName": null,
"invalidationReason": null,
"createdAt": 1655818588627,
"activatedAt": 1655818588627,
"redeemedAt": null,
"invalidatedAt": null,
"updatedAt": 1655818611860,
"currentAttempt": 0,
"status": {
"attempt": 0,
"attemptedAt": 1655818605849,
"attemptedBy": "c14caf2b-6c72-4c8e-9280-54356f7d56c2",
"scriptId": "2f944060-9eff-40c4-bdc3-ab7d00f83f35",
"scriptVersion": 38,
"attemptState": "IN_PROGRESS",
"response": {
"success": true,
"complete": false,
"customRedemptionInfo": {
"transaction_id": "9d3936f686fccd646669f67f332440e54a48f5c05a562c89a6637dc1125654eb"
},
"errorCode": null,
"errorMsg": null
}
}
},
"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
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
40757REDEMPTION_OF_CUSTOM_CODE_FAILEDMissing identity, required for get identity data
40758REDEMPTION_CODE_NOT_IN_PROGRESSThe code state is not in progress
40759REDEMPTION_CODE_ATTEMPT_ERRORThe attempt number input was not correct
40760REDEMPTION_CODE_ATTEMPT_MISMATCHThe applicable attempt number associated with the redemption attempt being processed doesn't match the code type
40761REDEMPTION_CODE_ASYNC_BAD_RESPONSEThe asynchronous response was not correct
40762REDEMPTION_CODE_BY_ID_NOT_FOUNDThe specified code was not found by redemptionCodeId
40767REDEMPTION_CODE_TYPE_NOT_ASYNCThe specified codeType was not asynchronous
40768REDEMPTION_CODE_ASYNC_PROCESSING_TIMEOUTThe specified timeout was hit