Link Search Menu Expand Document

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:

NameTypeDescription
apistringName of operation, “balance” in this case
dataobject 
data.gameSessionIdstringGame Session Id
data.currencystringName of users currency

Response:

NameTypeDescription
apistringName of operation, “balance” in this case
dataobject 
data.userNickstringUser’s nick
data.amountlongUser balance (Example: 10000 = 100.00EUR)
data.denominationintCurrency denomination. Basically for fiat it equals 2 (for example 1 USD = 100 cents)
data.currencystringBalance currency. Passed by the link to open the game. See section “Managing Games and Connections”, field accounts[].gameEmbedUrl.
data.userIdstringA unique user id
data.jpKeystringJackpot accumulation group id. Players with the same jpKey participate in a single pool of savings and jackpot winnings
data.freeGameslistInformation about available bonuses.
data.freeGames.bonusIdstringA bonus id
data.freeGames.gameslistList of available games
data.freeGames.games.idstringGame id
data.freeGames.games.initialintNumber of spins/bets at bonus init
data.freeGames.games.leftintNumber of spins/bets left
data.freeGames.games.betintBet amount
data.freeGames.games.linesintNumber 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
          }
        ]
      }
    ]
  }
}