1. By Room
[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 Balance
        • Get Provably-Fair State
      • Lobby Game List
  • Wallet
    • Wallet Status
      GET
  • Game
    • Lotto (หวยเฮงเฮง)
      • Lotto Rules
      • Rooms
        • By Room
          • Join Round
            GET
          • Place Multi-player Bet
            POST
          • Get Round Result
            GET
          • Room Event Stream
            GET
      • 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
      • Get Current Round
        POST
      • Get Pay Table
        GET
  • 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 Room

Join Round

GET
/gapi/v1/g/lotto/rooms/{roomId}/round
Returns the room's open round for the caller's currency (id, status, betting close time, seed commitment) and the caller's own pending bets. Call it when entering a room, right after the event stream opens or reconnects, and whenever the client needs to resync.
Auth: Player session — Authorization: Bearer {token}
Rate limit: 300 requests per 60 s per IP (GAME_JOIN_ROUND)
Games: LOTTO
Rules
System maintenance and Lotto's own maintenance window both answer 503 99915.
status is waiting when no round is open for this room + currency (none opened yet, or a replacement round is about to open after a cancelled one). roundID and seedHash are then "" and endTime is absent. Retry later — Lotto sends no round_started.
Never returns settled or cancelled. Right after a round closes, the closing round (rolling) and the next one (betting) exist together and this call may answer either. On rolling, call again after a short delay.
endTime is RFC3339 UTC with whole seconds (e.g. 2026-09-30T11:45:30Z). No response carries server time, so the countdown runs on the client clock.
The key is roundID (capital ID). Send it back as roundID in the bet body, but as query roundId (lower-case d) on …/result.
MULTI_CSEED rooms include clientSeedSlots; keep them in sync with SSE seed_slot_updated by replacing the slot at its index.
pendingBets / pendingTotalBet restore the bet slip, but only ONE of the caller's accepted bet calls in this round is returned. A player who bet several times sees one call's items; settlement still counts every bet.
Amounts in pendingBets and pendingTotalBet are decimal strings.
The room is not checked here: an unknown roomId simply answers waiting.
The หวยเฮงเฮง screens use POST /gapi/v1/g/lotto/round for the number-entry header; this call is the shared-room view of the same round.
Flow
1.
Resolve {gameCode} and {roomId}; the currency is the currency query, else the session currency.
2.
THAI-HILO: load the room by number; it must exist and be active, and SINGLE-mode rooms are rejected.
3.
Find the open round (betting or rolling) for game + room + currency in the caller's demo or real set; none gives waiting.
4.
THAI-HILO: broadcast player_joined on the room's event stream.
5.
Read back the caller's pending bet for that round; if it cannot be read the fields are simply omitted.
6.
Return the round with endTime in UTC.

Request

Path Params

Query Params

Header Params

Responses

🟢200OK
application/json
Bodyapplication/json

🟠400Bad Request
🟠401Unauthorized
🟠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/g/lotto/rooms/1/round?currency=THB&token=tok_synthetic_7f3a9c' \
--header 'Authorization: Bearer 3f9a1c7e5b2d4f6081a3c5e7f9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b7' \
--header 'Accept-Language: th'
Response Response Example
200 - LOTTO, no bets yet
LOTTO room, round open, caller has not bet yet.
{
    "code": "0",
    "description": "Success.",
    "traceID": "0f8e2c1a-6b3d-4e5f-9a7b-1c2d3e4f5a6b",
    "data": {
        "roundID": "tbq1y2c9d04ab7e",
        "status": "betting",
        "endTime": "2026-09-30T12:00:00Z",
        "seedHash": "3c8e1f0a9d7b5c2e4f6a8b0d1c3e5f7a9b2d4c6e8f0a1b3c5d7e9f2a4b6c8d0e"
    }
}
Modified at 2026-09-30 13:23:45
Previous
Lotto Rules
Next
Place Multi-player Bet
Built with