Balance
GET{base}/balance{base} is your wallet base URL. It answers the
balance — money, and only money. Identity is a separate call:
Player profile.
Request
| Query | When |
|---|---|
playerId | Service-key calls only. Never alongside a player token. |
Every call also carries the signature headers; verifying them is optional.
Response fields
| Field | Required | Rule |
|---|---|---|
currency | yes | ISO 4217. Informational: we read the balances entry for the currency your /profile names for this player, so this field does not select. |
balances | yes | One entry per currency the player holds, and it must include the currency your /profile returns for them. Its balance must parse as a number, even at zero. An answer with no entry for that currency is read as the player no longer holding that money: we show no balance and re-read /profile on the next request — which is how a currency switch propagates. |
ok | no | Only false is read, and it rejects. |
Refusing a token
401 is the answer. 403 works too. Do not refuse with a 200.
GET {base}/balance[?playerId=10]
Authorization: Bearer <player token | your service key>
Accept: application/json
# Player token — the session is already authenticated by the profile call
curl -s "https://casino.example.com/api/sportsbook/balance" \
-H "Authorization: Bearer <the player's session token>" \
-H "Accept: application/json"
# Service key — there is no session, so playerId names the player
curl -s "https://casino.example.com/api/sportsbook/balance?playerId=10" \
-H "Authorization: Bearer <your service key>" \
-H "Accept: application/json"
Swap in {base}/balance and a token your site really issued — the command is
then byte for byte what our server sends you.
200The balance{
"currency": "USD",
"balances": [
{ "currency": "USD", "balance": 100.50 },
{ "currency": "EUR", "balance": 18.20 }
]
}
401Token refused401 Unauthorized
Next: Debit — the stake leaving the balance.