Rollback
Rollback
This method either rolls back a wager or a wager that did not result in a result. For example, if a player places a wager and the Result request fails, you can send a Rollback request to roll back the original wager.
Responsibilities of the casino platform
The casino platform must confirm that the incoming accountid, roundid, and transactionid are identical to the latest wager in the game round and not included in a result that has been issued for the relevant game round.
The casino platform may, but is not required to, verify that the bet amount in the relevant wager request is identical to the rollback amount.
Info
**Note:** The rollback amount is not mandatory and can be null.
The casino platform must refuse the rollback if any of these assertions fail.
- Check if a request with the same transactionid has been performed before:
- If any of the essential fields transactionid, accountid, or betamount mismatch, the error Transaction parameter mismatch is returned
- If there are no mismatches, the original response with the status 200 Success - duplicate request is returned. The only values that may change are the balance related parameters, since the player’s balance may have changed
- A rollback can be issued by the game server later. Therefore, a rollback must be accepted even if the game session has expired. Groove provides the game session for you as information in this call
- The only expected return code for a valid rollback call is 0 success
- If no matching wager is found, the code 102 Wager not found is returned
- If the rollback is incorrect, code 110 Operation not allowed is returned
- Return code 1000 Not logged on is never a valid response to a rollback call. The casino platform must accept the rollback even if the session has expired
- All other return codes result in a resending of the rollback attempt
- The Casino must refund the player only if a successful wager was found. Do not refund the player in the case of a failed wager or any other error
Request Parameters
| Parameter | Data Type | Mandatory | Description |
|---|---|---|---|
accountid |
String(60) [0-9a-zA-Z] | Required | Account ID Example: 5179068 |
apiversion |
String | Required | The API version that will be used Example: 1.2 |
device |
String | Required | The device currently used by the player Valid values: desktop, mobile |
gameid |
String | Required | Groove game ID Note: Can contain letters and special characters Example: 80102, game_123, slot-abc |
gamesessionid |
String(64) | Required | The game session id from the start game Example: 11_99d71938-c2d9-4844-b950-d598c2es |
request |
String | Required | Request method name Example: rollback |
rollbackamount |
Decimal (32,10) | Optional | The betamount in the Wager request that you want to rollback Example: 0.10In some cases rollback amount can be 0, then rollback amount should be taken from original wager |
roundid |
String(255) | Optional | Each casino needs to handle the rollback by transactionId, although sometimes the roundId is sent as well Example: 802d1812c32686748f2afbcacfcc82114cf |
transactionid |
String(255) | Required | Transaction ID Example: 7617edd0924c11e7abb2865556898ad0 |
Request Example
/groove?request=rollback&gamesessionid=123_jdhdujdk&accountid=111&device=desktop&gameid=80102&apiversion=1.2&rollbackamount=10.0&roundid=nc8n4nd87&transactionid=trx_idResponse Parameters
| Parameter | Data Type | Mandatory | Description |
|---|---|---|---|
accounttransactionid |
String(50) | Required | The casino’s internal transaction ID Example: 7617edd0924c11e7abb2865556898ad0 |
apiversion |
String | Required | The version of the API being used Example: 1.2 |
balance |
Decimal (32,10) | Required | The total balance amount after the rollback Examples: 500, 140.25 |
bonus_balance |
Decimal (32,10) | Optional | The player’s bonus balance Example: 50.0 |
code |
Integer | Required | Response code Example: 200 |
game_mode |
Integer | Optional* | Combined real and bonus modes 1 = Real mode 2 = Bonus mode *Required for CMA-compliant games |
order |
String | Optional* | The type of order Valid values: cash_money, bonus_money*Required for CMA-compliant games |
real_balance |
Decimal (32,10) | Required | The player’s real balance Example: 100.0 |
status |
String | Required | The status of the response Example: Success |
Response Example
Success Response
{
"code": 200,
"status": "Success",
"accounttransactionid": "aaaaaaa",
"balance": 100,
"bonus_balance": 50,
"real_balance": 50,
"game_mode": 1,
"order": "cash_money, bonus_money",
"apiversion": "1.2"
}Error Codes
| Code | Status | Description |
|---|---|---|
| 1 | Technical error | Technical error |
| 102 | Wager not found | Reasons include: • A wager with the given transactionId is not found • The roundId in the rollback request is not the same as the roundId of a wager with the specified transactionId |
| 110 | Operation not allowed | Reasons include: • A win request was already received for the given wager |