Balance
Overview
This request allows you to retrieve the balance of a player’s account.
POST /open-api-games/v1/games-processor
sequenceDiagram
UserBrowser ->> ProviderCDN: open game at accounts[].gameEmbedUrl
ProviderCDN ->> ProviderGameServer: game initialization
ProviderGameServer ->> PlatformAPI: balance request {"api": "balance"}
PlatformAPI ->> ProviderGameServer: balance and configuration response
ProviderGameServer ->> ProviderCDN: game initialized
ProviderCDN ->> UserBrowser: final game init response
The request is needed when you first open the game. When the user opens the game, the platform redirects him to the link provided in the game description. After starting the client part of the game and requesting the balance, the server of the provider must make the first request for balance and settings, receive a response and transmit it to the game.
Parameters
Request:
| Name | Type | Description |
|---|---|---|
api | string | Name of operation, “balance” in this case |
data | object | |
data.gameSessionId | string | Game Session Id |
data.currency | string | Name of users currency |
Response:
| Name | Type | Description |
|---|---|---|
api | string | Name of operation, “balance” in this case |
data | object | |
data.userNick | string | User’s nick |
data.amount | long | User balance (Example: 10000 = 100.00EUR) |
data.denomination | int | Currency denomination. Basically for fiat it equals 2 (for example 1 USD = 100 cents) |
data.currency | string | Balance currency. Passed by the link to open the game. See section “Managing Games and Connections”, field accounts[].gameEmbedUrl. |
data.userId | string | A unique user id |
data.jpKey | string | Jackpot accumulation group id. Players with the same jpKey participate in a single pool of savings and jackpot winnings |
data.freeGames | list | Information about available bonuses. |
data.freeGames.bonusId | string | A bonus id |
data.freeGames.games | list | List of available games |
data.freeGames.games.id | string | Game id |
data.freeGames.games.initial | int | Number of spins/bets at bonus init |
data.freeGames.games.left | int | Number of spins/bets left |
data.freeGames.games.bet | int | Bet amount |
data.freeGames.games.lines | int | Number of lines |
Example
Request:
curl --location --request POST 'https://apiEndpoint/open-api-games/v1/games-processor' \
--header 'Content-Type: application/json' \
--data '{
"api": "balance",
"data": {
"gameSessionId": "16e2ea64-5725-40a4-99cc-c5c0deb8568d",
"currency": "BTC"
}
}'
Response:
{
"api": "balance",
"data": {
"userNick": "t*****[email protected]",
"amount": 10000,
"denomination": 8,
"currency": "BTC",
"userId": "4699292b-770f-4710-9496-ed9493aa0a6b123123",
"jpKey": "471513cc-99c0-446e-a5cc-8e94aaf4d639",
"freeGames": [
{
"bonusId": "887a1caa-e3d7-444e-99a3-d308040f2659",
"games": [
{
"id": "ib_al",
"initial": 20,
"left": 20,
"bet": 700,
"lines": 9
}
]
}
]
}
}