Skip to content

POST /balance

Beexar → Operator

Beexar sends this request to fetch the current player balance. It is called when the game loads and may be called periodically during gameplay.


POST {balance_url}

HeaderValue
Content-Typeapplication/json
X-REQUEST-SIGNHMAC-SHA256 signature of request body
FieldTypeRequiredDescription
account_idstringYesPlayer account identifier
currencystringYesCurrency code — standard ("USD", "EUR") or custom ("CUSTOM_GOLD")
game_idstringYesGame identifier (slug)
session_idstringNoSession identifier (UUID)
{
"account_id": "player_123",
"currency": "USD",
"game_id": "slots",
"session_id": "7b115688-3849-490a-95bd-7c281d81c64c"
}

FieldTypeRequiredDescription
balancestringYesCurrent player balance as decimal string
{
"balance": "500.00"
}
HTTP StatusTwirp Codeapi_codeDescription
400invalid_argument101Player not found or disabled
400invalid_argument403Invalid or missing signature
500internal500Internal server error
{
"code": "invalid_argument",
"msg": "Player not found",
"meta": {
"api_code": "101",
"api_message": "Player not found"
}
}

Terminal window
curl -X POST https://casino.example.com/wallet/balance \
-H "Content-Type: application/json" \
-H "X-REQUEST-SIGN: abc123def456..." \
-d '{
"account_id": "player_123",
"currency": "USD",
"game_id": "slots"
}'

  • Return the real-time balance — do not cache
  • The game_id field provides game context for operators who maintain per-game balances
  • This request does not modify the player’s balance
  • If the player does not exist, return api_code 101