Skip to content
KOI Games Developer

Wallet callbacks

Balance

KOI calls your balance endpoint to read a player's balance. It moves no funds.

When KOI asks for a balance

  • You call Player balance.
  • Before accepting a bet, when the balance KOI last saw is lower than the stake.

Payload

Fields depend on the trigger. user_id and currency are always present.

FieldTypeDescription
user_idstringYour player ID.
currencystringCurrency code.
actionstringbalance, on requests started by Player balance.
providerstringkoi, on requests started by Player balance.
aggregatorstringYour KOI account ID, on requests started by Player balance.
session_tokenstringOn bet checks: the extra_data of the session. On Player balance: the value you sent.
koi_session_tokenstringOn bet checks: the KOI session token.
game, gameId, casinoIdstringForwarded from Player balance when you send them.
json
{
  "user_id": "player-123",
  "currency": "BRL",
  "session_token": "brand=acme;device=mobile",
  "koi_session_token": "b3e1f6d2c9a84f0e"
}

Response

200 OK

FieldTypeDescription
balancenumberCurrent available balance.
currencystringCurrency code.
clientIdstringOptional. Your identifier for the brand or client.
json
{ "balance": 95.0, "currency": "BRL", "clientId": "acme" }

Timeout

Balance checks before a bet wait 3 seconds. If your endpoint fails or answers a balance lower than the stake, the bet is refused before any register call.