Rollback
Wallet API
Rollback
Reverses a previously credited amount from the player’s balance.
Rollback
Documentation Index
Fetch the complete documentation index at: https://docs.game-services.work/llms.txt
Use this file to discover all available pages before exploring further.
POST /credit/rollback
This operation is idempotent.
Headers
| Name | Type | Description |
|---|---|---|
| X-Auth-Token | string | Custom authentication header in the format X-Auth-Token: your_token_here. This token is required to authorize API requests. |
Request Parameters
| Name | Type | Description |
|---|---|---|
| playerId | string | Unique identifier of the player. |
| amount | decimal | Amount to rollback. |
| gameUuid | string | Unique identifier of the game. |
| sessionId | string | Unique identifier of the player session. |
| promotionExternalId | string | External identifier of the promotion session. This field must be sent for promo or free bet requests and omitted for regular game requests. |
| roundId | string | Unique identifier of the game round. |
| transactionId | string | Unique identifier of the game round transaction. |
| transactionTimestamp | integer | Timestamp of the transaction in milliseconds. |
| currency | string | Currency code of the player. |
Response Parameters
| Name | Type | Description |
|---|---|---|
| balance | decimal | The 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| Name | Type | Description |
|---|---|---|
| error_code | string | Error code describing the specific issue. |
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 promotionExternalId is present, the wallet platform must validate that it belongs to the active promotion session for the player and use it as the promo wallet context.
A rollback happens if something goes wrong during action processing and the system needs to restore the previous state. However, there are two conditions:
- There haven’t been any winnings in this round yet.
- A jackpot hasn’t been won during the round.
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.