Rollback
curl --request POST \
--url https://103.77.224.40/credit/rollbackimport requests
url = "https://103.77.224.40/credit/rollback"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://103.77.224.40/credit/rollback', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://103.77.224.40/credit/rollback",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://103.77.224.40/credit/rollback"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://103.77.224.40/credit/rollback")
.asString();require 'uri'
require 'net/http'
url = URI("https://103.77.224.40/credit/rollback")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyPOST /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",
"promotionExternalId": "promo-session-123",
"roundId": "nAanFguGKTnLMlaPtIb2MZgnpY-IzB6x94qd5refwyIjGZWJl0mHs00tM2mPHWpvLN7IE3KH6QOR",
"transactionId": "DER6i2rKbzn6S1qzb38fKBZZ3oehgO0Um7MyYhsFcXSW1kfxw-02_bS4WNzQb0hhBU2NqqkUch-y5KyKv2fdsf4",
"transactionTimestamp": 1632771475000,
"currency": "USD",
}
{
"balance": 100.00
}
{
"error_code": "INVALID_TRANSACTION"
}
Wallet API
Rollback
Reverses a previously credited amount from the player’s balance.
Rollback
curl --request POST \
--url https://103.77.224.40/credit/rollbackimport requests
url = "https://103.77.224.40/credit/rollback"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://103.77.224.40/credit/rollback', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://103.77.224.40/credit/rollback",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://103.77.224.40/credit/rollback"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://103.77.224.40/credit/rollback")
.asString();require 'uri'
require 'net/http'
url = URI("https://103.77.224.40/credit/rollback")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyPOST /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",
"promotionExternalId": "promo-session-123",
"roundId": "nAanFguGKTnLMlaPtIb2MZgnpY-IzB6x94qd5refwyIjGZWJl0mHs00tM2mPHWpvLN7IE3KH6QOR",
"transactionId": "DER6i2rKbzn6S1qzb38fKBZZ3oehgO0Um7MyYhsFcXSW1kfxw-02_bS4WNzQb0hhBU2NqqkUch-y5KyKv2fdsf4",
"transactionTimestamp": 1632771475000,
"currency": "USD",
}
{
"balance": 100.00
}
{
"error_code": "INVALID_TRANSACTION"
}
POST /credit/rollback
A repeated rollback of the same transaction must be rejected with
INVALID_TRANSACTION. RGS treats this response as “already rolled back” and stops retrying.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. |
Show Possible Error Codes
Show Possible Error Codes
| Error Code | Description |
|---|---|
| INVALID_PLAYER_ID | The provided player ID is invalid or does not exist in the system. |
| INVALID_SESSION | The provided session ID is invalid or does not exist in the system. |
| INVALID_PLAYER_CURRENCY | The player’s currency is invalid or mismatched. |
| INVALID_GAME | The specified game UUID is invalid or does not exist. |
| INVALID_TRANSACTION | The transaction for rollback is invalid or cannot be processed. |
| TECHNICAL_ERROR | An unexpected error occurred. |
| NOT_AUTHORIZED | The request is not authorized due to invalid X-Auth-Token header. |
Responsibility of the wallet platform
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.
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",
"promotionExternalId": "promo-session-123",
"roundId": "nAanFguGKTnLMlaPtIb2MZgnpY-IzB6x94qd5refwyIjGZWJl0mHs00tM2mPHWpvLN7IE3KH6QOR",
"transactionId": "DER6i2rKbzn6S1qzb38fKBZZ3oehgO0Um7MyYhsFcXSW1kfxw-02_bS4WNzQb0hhBU2NqqkUch-y5KyKv2fdsf4",
"transactionTimestamp": 1632771475000,
"currency": "USD",
}
{
"balance": 100.00
}
{
"error_code": "INVALID_TRANSACTION"
}