1. By Game Code
[Game] FairPlay API
  • Getting Started
    • Introduction
    • Session and Token
    • Request and Response
    • Real-time Events (SSE)
    • Lotto Rules — หวยเฮงเฮง
    • Provably Fair
  • Player
    • Demo
      • Demo Login
    • Player Bet History
      GET
  • Common
    • Game
      • By Game Code
        • Provably Fair
          • Set Client Seed
          • Verify Result
          • Get Revealed Server Seed
        • Check Session
          GET
        • Get Balance
          GET
        • Get Provably-Fair State
          GET
      • Lobby Game List
        GET
  • Wallet
    • Wallet Status
      GET
  • Game
    • Lotto (หวยเฮงเฮง)
      • Lotto Rules
      • Rooms
        • By Room
          • Join Round
          • Place Multi-player Bet
          • Get Round Result
          • Room Event Stream
      • Tickets
        • Create Ticket
        • Inquiry My Tickets
        • Get Ticket
      • Round
        • Get My Bets
        • Get My Result
        • Get Round Provably Fair
      • Results
        • Inquiry Results
      • Get Rooms
      • Get Current Round
      • Get Pay Table
  • Appendix
    • Game List
    • Error Codes
    • Rate Limits
  • Language List
    GET
  • Ping
    GET
  • Schemas
    • DemoLoginRequest
    • DemoLoginResponse
    • DemoProfileResponse
    • ProfileResponse
    • GetHistoryResponse
    • BetRecord
    • GameInfo
    • Room
    • GetGameResponse
    • BetRequest
    • Bet
    • BetResponse
    • BetResult
    • GetProvablyFairResponse
    • SetClientSeedRequest
    • SetClientSeedResponse
    • RotateServerSeedResponse
    • VerifyResultRequest
    • VerifyResultResponse
    • GetServerSeedResponse
    • GetStatusResponse
    • JoinRoundResponse
    • PlaceMultiPlayerBetRequest
    • PlaceBetResponse
    • RoundResultResponse
    • SuccessResponse
    • ErrorResponse
  1. By Game Code

Get Balance

GET
/gapi/v1/c/g/{gameCode}/balance
Returns a fresh balance for the player in the given game. FE calls it to refresh the balance, e.g. after a bet or a settlement.
Auth: Player session — Authorization: Bearer {token}
Rate limit: 300 requests per 60 s per IP (GAME_BALANCE)
Games: THAI-HILO, LOTTO
Rules
Same response and same checks as GET /c/g/{gameCode}/check-session.
The balance is always read live, never from a cache: when it cannot be read the call answers an error rather than a last known value.
balance is a decimal string; a negative balance is returned as "0.00".
A game-launch token is bound to its game: another gameCode answers 403 99903. Demo tokens work with any game.
Blocked by both system-wide and this game's own maintenance (503 99915).
Has its own rate-limit bucket (GAME_BALANCE), so polling here does not use up the check-session limit.
For seamless-wallet players each call asks the operator's wallet live; allow a generous timeout.
Flow
1.
Validates the token and checks system and per-game maintenance.
2.
Resolves gameCode and rejects a game-launch token opened for a different game.
3.
Reads a fresh balance for the player's wallet type (demo, transfer or seamless).
4.
Returns a negative balance as "0.00" and returns the same fields as check-session.

Request

Path Params

Header Params

Responses

🟢200OK
application/json
Bodyapplication/json

🟠401Unauthorized
🟠403Forbidden
🟠404Not Found
🟠429Too Many Requests
🔴500Internal Server Error
🔴503Service Unavailable
Request Request Example
Shell
JavaScript
Java
Swift
curl --location 'https://dev-api.ambfairgame.com/gapi/v1/gapi/v1/c/g/THAI-HILO/balance' \
--header 'Authorization: Bearer 3f9a1c7e5b2d4f6081a3c5e7f9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b7' \
--header 'Accept-Language: th'
Response Response Example
200 - Demo player (THAI-HILO)
Demo session balance with trailing zeros trimmed.
{
    "code": "0",
    "description": "Success.",
    "traceID": "0f8e2c1a-6b3d-4e5f-9a7b-1c2d3e4f5a6b",
    "data": {
        "id": 9123456789,
        "playerName": "Demo Tester",
        "balance": "9950.5",
        "currency": "THB",
        "symbolCurrency": "฿",
        "isDemo": true,
        "gameCode": "THAI-HILO",
        "language": ""
    }
}
Modified at 2026-09-30 13:23:45
Previous
Check Session
Next
Get Provably-Fair State
Built with