Skip to main content
Rollback
curl --request POST \
  --url https://ss.game-services.work/rollback \
  --header 'Authorization: Bearer <token>'
POST /credit/rollback
Content-Type: application/json
{
    "playerId": "123e4567-e89b-12d3-a456-426614174000",
    "amount": 20.00,
    "gameUuid": "b23e45a7-9be8-d312-56a4-174000426614",
    "sessionId": "1c4f1d6d-5e37-4a8f-e642-def88a3b4749",
    "roundId": "nAanFguGKTnLMlaPtIb2MZgnpY-IzB6x94qd5refwyIjGZWJl0mHs00tM2mPHWpvLN7IE3KH6QOR",
    "transactionId": "DER6i2rKbzn6S1qzb38fKBZZ3oehgO0Um7MyYhsFcXSW1kfxw-02_bS4WNzQb0hhBU2NqqkUch-y5KyKv2fdsf4",
    "transactionTimestamp": 1632771475000,
    "currency": "USD",
}
POST /credit/rollback
This operation is idempotent.

Headers

NameTypeDescription
X-Auth-TokenstringCustom authentication header in the format X-Auth-Token: your_token_here. This token is required to authorize API requests.

Request Parameters

NameTypeDescription
playerIdstringUnique identifier of the player.
amountdecimalAmount to rollback.
gameUuidstringUnique identifier of the game.
sessionIdstringUnique identifier of the player session.
roundIdstringUnique identifier of the game round.
transactionIdstringUnique identifier of the game round transaction.
transactionTimestampintegerTimestamp of the transaction in milliseconds.
currencystringCurrency code of the player.

Response Parameters

NameTypeDescription
balancedecimalThe updated balance of the player after the rollback.

Error

If an error occurs while processing a request, the API must return a response with HTTP Status Code: 400 Bad Request
NameTypeDescription
error_codestringError code describing the specific issue.

Responsibility of the wallet platform
The wallet platform must verify that the incoming playerId, roundId, transactionId and amount correspond to the latest wager placed in the game round. It must also ensure that no debit has been issued for the game round. If any of these assertions fail, the rollback request must be refused. If the specified transaction is not found or has already been rolled back, the wallet platform must return an INVALID_TRANSACTION error code. This error response will be interpreted as a successful rollback, ensuring that the rollback will not be sent repeatedly. For all other errors, the RGS platform will attempt to send the rollback again.
POST /credit/rollback
Content-Type: application/json
{
    "playerId": "123e4567-e89b-12d3-a456-426614174000",
    "amount": 20.00,
    "gameUuid": "b23e45a7-9be8-d312-56a4-174000426614",
    "sessionId": "1c4f1d6d-5e37-4a8f-e642-def88a3b4749",
    "roundId": "nAanFguGKTnLMlaPtIb2MZgnpY-IzB6x94qd5refwyIjGZWJl0mHs00tM2mPHWpvLN7IE3KH6QOR",
    "transactionId": "DER6i2rKbzn6S1qzb38fKBZZ3oehgO0Um7MyYhsFcXSW1kfxw-02_bS4WNzQb0hhBU2NqqkUch-y5KyKv2fdsf4",
    "transactionTimestamp": 1632771475000,
    "currency": "USD",
}
I