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.
| Field | Type | Description |
|---|---|---|
user_id | string | Your player ID. |
currency | string | Currency code. |
action | string | balance, on requests started by Player balance. |
provider | string | koi, on requests started by Player balance. |
aggregator | string | Your KOI account ID, on requests started by Player balance. |
session_token | string | On bet checks: the extra_data of the session. On Player balance: the value you sent. |
koi_session_token | string | On bet checks: the KOI session token. |
game, gameId, casinoId | string | Forwarded from Player balance when you send them. |
{
"user_id": "player-123",
"currency": "BRL",
"session_token": "brand=acme;device=mobile",
"koi_session_token": "b3e1f6d2c9a84f0e"
}Response
200 OK
| Field | Type | Description |
|---|---|---|
balance | number | Current available balance. |
currency | string | Currency code. |
clientId | string | Optional. Your identifier for the brand or client. |
{ "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.