Credit Debit
curl --request POST \
--url https://ss.game-services.work/credit-debit \
--header 'Authorization: Bearer <token>'import requests
url = "https://ss.game-services.work/credit-debit"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://ss.game-services.work/credit-debit', 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://ss.game-services.work/credit-debit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://ss.game-services.work/credit-debit"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://ss.game-services.work/credit-debit")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://ss.game-services.work/credit-debit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyPOST /credit-debit
Content-Type: application/json
{
"playerId": "123e4567-e89b-12d3-a456-426614174000",
"creditAmount": 20.00,
"debitAmount": 0.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",
"transactionType": "FREEBET_CREDIT_DEBIT_SPIN",
"transactionTimestamp": 1632771475000,
"roundStarted": true,
"roundFinished": false,
"currency": "USD",
}
{
"balance": 100.00
}
{
"error_code": "INVALID_TOKEN"
}
Wallet API
Credit Debit
Credits the creditAmount from the player’s balance and debits the debitAmount to the player’s balance.
Credit Debit
curl --request POST \
--url https://ss.game-services.work/credit-debit \
--header 'Authorization: Bearer <token>'import requests
url = "https://ss.game-services.work/credit-debit"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://ss.game-services.work/credit-debit', 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://ss.game-services.work/credit-debit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://ss.game-services.work/credit-debit"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://ss.game-services.work/credit-debit")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://ss.game-services.work/credit-debit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyPOST /credit-debit
Content-Type: application/json
{
"playerId": "123e4567-e89b-12d3-a456-426614174000",
"creditAmount": 20.00,
"debitAmount": 0.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",
"transactionType": "FREEBET_CREDIT_DEBIT_SPIN",
"transactionTimestamp": 1632771475000,
"roundStarted": true,
"roundFinished": false,
"currency": "USD",
}
{
"balance": 100.00
}
{
"error_code": "INVALID_TOKEN"
}
POST /credit-debit
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. |
| creditAmount | decimal | Amount to credit. |
| debitAmount | decimal | Amount to debit. |
| 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. |
| transactionType | string | Type of transaction, e.g., ‘CREDIT_DEBIT_SPIN’. |
| transactionTimestamp | integer | Timestamp of the transaction in milliseconds. |
| roundStarted | boolean | Flag indicating start of the round. |
| roundFinished | boolean | Flag indicating end of the round. |
| currency | string | Currency code of the player. |
Transaction Types: Enum representing the type of transaction.
CREDIT_DEBIT_SPIN: A regular spin-based transaction.CREDIT_DEBIT_PURCHASE: A transaction where the player directly purchases a bonus feature within the game.FREEBET_CREDIT_DEBIT_SPIN: A free bet spin transaction.
Response Parameters
| Name | Type | Description |
|---|---|---|
| balance | decimal | The updated balance of the player. |
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. |
| ROUND_ALREADY_STARTED | The bet has already been initiated and cannot be repeated. |
| INSUFFICIENT_FUNDS | The player does not have enough funds to complete the action. |
| BET_NOT_ALLOWED | Bet is not allowed for the specified conditions. |
| 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
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.
The wallet platform should ensure that creditAmount is not less than the player’s balance before transaction. INSUFFICIENT_FUNDS error should be returned otherwise.
In addition, it should persist roundId, playerId, transactionId and amount to ensure that future debit or rollback operations can be reliably processed, maintaining the integrity of the player’s balance throughout the game session.
POST /credit-debit
Content-Type: application/json
{
"playerId": "123e4567-e89b-12d3-a456-426614174000",
"creditAmount": 20.00,
"debitAmount": 0.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",
"transactionType": "FREEBET_CREDIT_DEBIT_SPIN",
"transactionTimestamp": 1632771475000,
"roundStarted": true,
"roundFinished": false,
"currency": "USD",
}
{
"balance": 100.00
}
{
"error_code": "INVALID_TOKEN"
}
⌘I