1. Provably Fair
[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
            POST
          • Verify Result
            POST
          • Get Revealed Server Seed
            GET
        • 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. Provably Fair

Verify Result

POST
/gapi/v1/c/g/{gameCode}/provably-fair/verify-result
Recomputes a result from a revealed server seed so the player can compare it with the recorded result and the earlier commitment. FE calls it from the provably-fair verify screen.
Auth: Player session — Authorization: Bearer {token}
Rate limit: 300 requests per 60 s per IP (GAME_VERIFY_RESULT)
Games: THAI-HILO, LOTTO
Rules
Pure recomputation: nothing is looked up or checked against the player's history. Compare serverSeedHash with the commitment shown before betting and gameResult with the recorded result.
serverSeed and clientSeed must both be non-empty, for both games.
THAI-HILO: send the revealed server seed (from rotate or server-seed), the bet's clientSeed and its nonce (default 0). gameResult is a bare array [d1, d2, d3], not the object the bet call returns.
THAI-HILO verification covers single-player bets only; multiplayer rounds use other formulas, and THAI-HILO MULTI round seeds cannot be verified here under either gameCode.
LOTTO: send the full revealed round seed "{brand}LOTTO{roomID}{unixNano}{6-digit result}_{64 hex}". clientSeed is ignored (send any non-empty string, e.g. "-") and so is nonce. gameResult is an object derived from the seed.
LOTTO accepts MULTI round seeds only: a bare-hex MULTI_CSEED seed, or a seed whose game part is not exactly "LOTTO", answers 400 99911.
LOTTO: a seed whose result part is not 6 digits answers 200 with empty strings and null runBot / runFront.
nonce must be a JSON number; a numeric string answers 400 99911.
Flow
1.
Validates the token, checks system maintenance and resolves gameCode.
2.
Rejects an empty serverSeed, then an empty clientSeed.
3.
THAI-HILO: computes the three dice from HMAC-SHA256(serverSeed text, clientSeed:nonce) and the SHA-256 of serverSeed.
4.
LOTTO: splits the seed into its six parts, checks the game part is LOTTO and derives the result from the embedded drawn number.
5.
Returns gameResult and serverSeedHash.

Request

Path Params

Header Params

Body Params application/json

Examples

Responses

🟢200OK
application/json
Bodyapplication/json

🟠400Bad Request
🟠401Unauthorized
🟠404Not Found
🟠429Too Many Requests
🔴500Internal Server Error
🔴503Service Unavailable
Request Request Example
Shell
JavaScript
Java
Swift
cURL
curl --location 'https://dev-api.ambfairgame.com/gapi/v1/gapi/v1/c/g/THAI-HILO/provably-fair/verify-result' \
--header 'Authorization: Bearer 3f9a1c7e5b2d4f6081a3c5e7f9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b7' \
--header 'Accept-Language: th' \
--header 'Content-Type: application/json' \
--data '{
    "serverSeed": "a3f1c9e27b4d8f60152e9c7a4b3d2f1e0c9b8a7f6e5d4c3b2a19087f6e5d4c3b",
    "clientSeed": "my-lucky-seed",
    "nonce": 3
}'
Response Response Example
200 - THAI-HILO
Dice recomputed from seed, client seed and nonce.
{
    "code": "0",
    "description": "Success.",
    "traceID": "0f8e2c1a-6b3d-4e5f-9a7b-1c2d3e4f5a6b",
    "data": {
        "gameResult": [
            6,
            3,
            4
        ],
        "serverSeedHash": "cecfc34e5de06b8028c4cadba0675e8afc6c4f4bf531327c5697c6f3cfa943c0"
    }
}
Modified at 2026-09-30 13:23:45
Previous
Set Client Seed
Next
Get Revealed Server Seed
Built with