POST /balance
Beexar → Operator
Terminal window
Beexar sends this request to fetch the current player balance. It is called when the game loads and may be called periodically during gameplay.
Request
Section titled “Request”POST {balance_url}
Headers
Section titled “Headers”| Header | Value |
|---|---|
Content-Type | application/json |
X-REQUEST-SIGN | HMAC-SHA256 signature of request body |
| Field | Type | Required | Description |
|---|---|---|---|
account_id | string | Yes | Player account identifier |
currency | string | Yes | Currency code — standard ("USD", "EUR") or custom ("CUSTOM_GOLD") |
game_id | string | Yes | Game identifier (slug) |
session_id | string | No | Session identifier (UUID) |
Example
Section titled “Example”{ "account_id": "player_123", "currency": "USD", "game_id": "slots", "session_id": "7b115688-3849-490a-95bd-7c281d81c64c"}Response
Section titled “Response”Success (200 OK)
Section titled “Success (200 OK)”| Field | Type | Required | Description |
|---|---|---|---|
balance | string | Yes | Current player balance as decimal string |
{ "balance": "500.00"}Error Responses
Section titled “Error Responses”| HTTP Status | Twirp Code | api_code | Description |
|---|---|---|---|
| 400 | invalid_argument | 101 | Player not found or disabled |
| 400 | invalid_argument | 403 | Invalid or missing signature |
| 500 | internal | 500 | Internal server error |
{ "code": "invalid_argument", "msg": "Player not found", "meta": { "api_code": "101", "api_message": "Player not found" }}curl Example
Section titled “curl Example”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" }'Behavioral Rules
Section titled “Behavioral Rules”- Return the real-time balance — do not cache
- The
game_idfield 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