1. Tickets
[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
          • Place Multi-player Bet
          • Get Round Result
          • Room Event Stream
      • Tickets
        • Create Ticket
          POST
        • Inquiry My Tickets
          POST
        • Get Ticket
          POST
      • 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. Tickets

Get Ticket

POST
/gapi/v1/g/lotto/tickets/get
Returns one of the caller's tickets with its lines, each line's rate and result, the drawn number and the ticket totals.
Auth: Player session — Authorization: Bearer {token}
Rate limit: 300 requests per 60 s per IP (LOTTO_TICKETS_GET)
Games: LOTTO
Rules
Lotto only: the route is under /g/lotto, so system maintenance and Lotto's own maintenance window both answer 503 99915.
Body key is betID (capital ID), unlike roomId / roundId elsewhere in LOTTO.
Only the caller's own tickets: another player's betID answers 404 99966 like an unknown one.
Top-level status is the ticket status, upper-case WAITING / SETTLED, not the lower-case round status of my-bets / my-result.
While WAITING: round.number, items[].winAmount, summary.totalReturn and summary.netWin are absent, items[].result is WAITING, and rate / isLucky show what the line will settle at (current lucky number).
When SETTLED: result is WON / LOST, winAmount is the gross win (0 when lost) and totalReturn = netWin + totalAmount.
Amounts are JSON numbers.
A ticket of a cancelled round stays WAITING (it was refunded).
room.name is "" if the room no longer exists; items can be [] for a settled ticket whose result is unavailable.
Validation failures answer 400 99911 with a description naming the field, e.g. betID is required.
Flow
1.
Accept LOTTO only; validate betID; check the session game.
2.
Find the ticket by betID among the caller's tickets (demo or real).
3.
Load the ticket's room name and round.
4.
Settled: derive the drawn number and fill each line from the caller's settled result.
5.
Waiting: check the game is available and fill each line's pending rate and lucky flag.

Request

Query Params

Header Params

Body Params application/json

Examples

Responses

🟢200OK
application/json
Bodyapplication/json

🟠400Bad Request
🟠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/g/lotto/tickets/get?token=8d0c6a4e2b9f4f1c9a7e3b5d1c2e4f60' \
--header 'Authorization: Bearer 3f9a1c7e5b2d4f6081a3c5e7f9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b7' \
--header 'Accept-Language: th' \
--header 'Content-Type: application/json' \
--data '{
    "betID": "2_1001_tm64903fa91c2e_9f1c0b7a4d2e6f8a1b3c5d7e9f0a2b4c"
}'
Response Response Example
200 - Settled ticket
Two of three lines won.
{
    "code": "0",
    "description": "Success.",
    "traceID": "0f8e2c1a-6b3d-4e5f-9a7b-1c2d3e4f5a6b",
    "data": {
        "betID": "2_1001_tm64903fa91c2e_9f1c0b7a4d2e6f8a1b3c5d7e9f0a2b4c",
        "status": "SETTLED",
        "room": {
            "roomId": 1,
            "name": "ห้องหวย 1"
        },
        "round": {
            "roundId": "tm64903fa91c2e",
            "number": "482917"
        },
        "createdAt": "2026-09-30T08:07:31.482Z",
        "items": [
            {
                "betType": "2-BOTTOM",
                "number": "17",
                "amount": 10,
                "rate": 360,
                "isLucky": true,
                "result": "WON",
                "winAmount": 3600
            },
            {
                "betType": "3-TOAD",
                "number": "358",
                "amount": 5,
                "rate": 150,
                "isLucky": false,
                "result": "LOST",
                "winAmount": 0
            },
            {
                "betType": "1-TOP",
                "number": "9",
                "amount": 20,
                "rate": 3,
                "isLucky": false,
                "result": "WON",
                "winAmount": 60
            }
        ],
        "summary": {
            "totalAmount": 35,
            "wonItems": 2,
            "totalItems": 3,
            "totalReturn": 3660,
            "netWin": 3625
        }
    }
}
Modified at 2026-09-30 13:23:45
Previous
Inquiry My Tickets
Next
Get My Bets
Built with