Get Balance
curl --request GET \
--url https://ss.game-services.work/balance \
--header 'Authorization: Bearer <token>'import requests
url = "https://ss.game-services.work/balance"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://ss.game-services.work/balance', 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/balance",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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/balance"
req, _ := http.NewRequest("GET", 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.get("https://ss.game-services.work/balance")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://ss.game-services.work/balance")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyGET /balance?playerId=123e4567-e89b-12d3-a456-426614174000
&sessionId=abc123-session-id&promotionExternalId=promo-session-123¤cy=USD&gameUuid=game-uuid-456
{
"balance": 100.00
}
{
"error_code": "INVALID_SESSION"
}
Wallet API
Get Balance
Retrieves the current balance of a player based on their player ID.
Get Balance
curl --request GET \
--url https://ss.game-services.work/balance \
--header 'Authorization: Bearer <token>'import requests
url = "https://ss.game-services.work/balance"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://ss.game-services.work/balance', 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/balance",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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/balance"
req, _ := http.NewRequest("GET", 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.get("https://ss.game-services.work/balance")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://ss.game-services.work/balance")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyGET /balance?playerId=123e4567-e89b-12d3-a456-426614174000
&sessionId=abc123-session-id&promotionExternalId=promo-session-123¤cy=USD&gameUuid=game-uuid-456
{
"balance": 100.00
}
{
"error_code": "INVALID_SESSION"
}
GET /balance
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 whose balance is being retrieved. |
| gameUuid | string | Unique identifier of the game for which the request is being made. |
| sessionId | string | Unique identifier of the player’s session. |
| promotionExternalId | string | External identifier of the promotion session. This parameter must be sent for promo or free bet requests and omitted for regular game requests. |
| currency | string | The currency code for the transaction, typically in ISO 4217 format. |
Response Parameters
| Name | Type | Description |
|---|---|---|
| balance | decimal | The current 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_SESSION | The provided session ID is invalid or does not exist in the system. |
| 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, resolve the balance in the context of the promo or free bet session identified by this value.
GET /balance?playerId=123e4567-e89b-12d3-a456-426614174000
&sessionId=abc123-session-id&promotionExternalId=promo-session-123¤cy=USD&gameUuid=game-uuid-456
{
"balance": 100.00
}
{
"error_code": "INVALID_SESSION"
}
⌘I