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

Place Multi-player Bet

POST
/gapi/v1/g/lotto/rooms/{roomId}/bet
Places one or more bets in a Lotto room's open round with a single debit of the summed stake. The หวยเฮงเฮง client uses POST /gapi/v1/g/lotto/tickets/create instead.
Auth: Player session — Authorization: Bearer {token}
Rate limit: 300 requests per 60 s per IP (GAME_MULTI_PLAYER_BET)
Games: LOTTO
Rules
System maintenance and Lotto's own maintenance window both answer 503 99915.
Body key is roundID (capital ID), from Join Round or SSE round_started. It must be this room's and this currency's round, and still betting.
The bets array is all-or-nothing: every item is checked first, then the total is debited once. Duplicate areas are allowed and count separately; there is no item limit.
Items use type + number + amount (area is ignored). There is no chip rule; the round-wide total staked on one type + number by all players is capped by the room maximum (99965).
Send amount as a JSON number (a numeric string such as "100.50" is also accepted). The response's totalBet is a decimal string.
Betting closes on the round's status, not on endTime: a bet sent up to ~2 s after endTime can still be accepted. Close the betting UI locally at endTime.
No idempotency key: retrying after a timeout places and debits a second bet. The หวยเฮงเฮง client uses POST /gapi/v1/g/lotto/tickets/create instead, which is idempotent through requestId.
The response carries neither the new balance nor a bet id.
MULTI_CSEED: the bet may claim a free client-seed slot with the player's provably-fair client seed (seedContributed / slotIndex), broadcast as SSE seed_slot_updated. Provably-fair state is created (client seed "default") on the first bet.
Bets are never broadcast to the room.
If the round closes while the bet is being processed, the stake is refunded and the call answers 400 99942.
currency from the query is used as sent (not compared with the session) and is the currency the debit carries; omit it to use the session currency.
Flow
1.
Validate the path, the body (roundID and a non-empty bets) and the currency.
2.
Check the room, the game's availability and every item against the room's rules for the currency (THAI-HILO: payout areas, chips, minimum; LOTTO: bet type, number format, rate, minimum, per-number round cap).
3.
Check the round: it exists, belongs to this room and currency, and is still betting.
4.
Debit the summed stake once from the player's wallet (demo balance, operator wallet or in-game wallet).
5.
MULTI_CSEED: claim the first free client-seed slot and broadcast seed_slot_updated.
6.
Store the bets and re-check the round; if it closed meanwhile, refund and reject.
7.
THAI-HILO: broadcast bet_placed. Return the acceptance.

Request

Path Params

Query Params

Header Params

Body Params application/json

Examples

Responses

🟢200OK
application/json
Bodyapplication/json

🟠400Bad Request
🟠401Unauthorized
🟠404Not Found
🟠409Conflict
🟠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/bet?currency=THB&token=tok_synthetic_7f3a9c' \
--header 'Authorization: Bearer 3f9a1c7e5b2d4f6081a3c5e7f9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b7' \
--header 'Accept-Language: th' \
--header 'Content-Type: application/json' \
--data '{
    "roundID": "tbq1y2c9d04ab7e",
    "bets": [
        {
            "type": "3-BOTTOM",
            "number": "123",
            "amount": 10
        },
        {
            "type": "2-BOTTOM",
            "number": "07",
            "amount": 20
        }
    ]
}'
Response Response Example
200 - MULTI_CSEED slot claimed
THAI-HILO MULTI_CSEED room; the bet claimed slot 0.
{
    "code": "0",
    "description": "Success.",
    "traceID": "0f8e2c1a-6b3d-4e5f-9a7b-1c2d3e4f5a6b",
    "data": {
        "roundID": "tbq1x0a7c3e91f2",
        "accepted": true,
        "totalBet": "150",
        "seedContributed": true,
        "slotIndex": 0
    }
}
Modified at 2026-09-30 13:23:45
Previous
Join Round
Next
Get Round Result
Built with