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

Check Session

GET
/gapi/v1/c/g/{gameCode}/check-session
Validates the session token for a game and returns the player's identity, current balance and currency. FE calls it once when the game loads.
Auth: Player session — Authorization: Bearer {token}
Rate limit: 300 requests per 60 s per IP (GAME_CHECK_SESSION)
Games: THAI-HILO, LOTTO
Rules
gameCode is case-insensitive; the response echoes it upper-cased.
A token from the operator's game-launch link is bound to one game: calling with another gameCode answers 403 99903. Demo tokens work with any game.
Blocked by both system-wide and this game's own maintenance (503 99915). Check Session and Get Balance are the /c/g calls that check the game's own maintenance; every /g/{game} route checks it too.
balance is a decimal string; a negative balance is returned as "0.00".
For seamless-wallet players every call asks the operator's wallet live (up to 3 retries, 10 s each), so allow a generous timeout (about 40 s worst case).
language is the language the operator passed at game launch ("" for demo); use it for the initial UI language. It does not follow Accept-Language.
Unknown gameCode answers 404 99948 here.
Same response as GET /c/g/{gameCode}/balance.
Flow
1.
Validates the token and checks system and per-game maintenance.
2.
Resolves gameCode (THAI-HILO or LOTTO).
3.
Rejects a game-launch token that was opened for a different game.
4.
Reads the balance for the player's wallet type: demo session balance, transfer wallet, or a live request to the operator's seamless wallet.
5.
Returns a negative balance as "0.00" and adds the currency symbol.
6.
Returns the player, balance and session details.

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/LOTTO/check-session' \
--header 'Authorization: Bearer 3f9a1c7e5b2d4f6081a3c5e7f9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b7' \
--header 'Accept-Language: th'
Response Response Example
200 - Real player (LOTTO)
Session opened from the operator's game-launch link.
{
    "code": "0",
    "description": "Success.",
    "traceID": "0f8e2c1a-6b3d-4e5f-9a7b-1c2d3e4f5a6b",
    "data": {
        "id": 1024,
        "playerName": "Player One",
        "balance": "1520.75",
        "currency": "THB",
        "symbolCurrency": "฿",
        "isDemo": false,
        "gameCode": "LOTTO",
        "language": "th"
    }
}
Modified at 2026-09-30 13:23:45
Previous
Get Revealed Server Seed
Next
Get Balance
Built with