> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cog888.net/llms.txt
> Use this file to discover all available pages before exploring further.

# Query Bet Records

> Query bet records

<Accordion title="Possible Error Codes for this API">
  | Code | Description                |
  | ---- | -------------------------- |
  | 0    | Success                    |
  | 2    | Invalid parameter          |
  | 9    | Query date range too large |
  | 19   | Request limit reached      |
  | 20   | Secret key error           |
  | 23   | Invalid timestamp          |
  | 25   | Type parameter error       |
  | 26   | Page size parameter error  |
  | 27   | Page index parameter error |
  | 36   | Server error               |
  | 9999 | Unknown error              |
</Accordion>


## OpenAPI

````yaml en/transfer-openapi.json GET /api/v1/dt/bets
openapi: 3.1.0
info:
  title: Transfer Wallet API
  description: Game-API for vendors to obtain game-related data
  version: 1.0.0
servers:
  - url: https://api.example.com
    description: Production server
security: []
paths:
  /api/v1/dt/bets:
    get:
      tags:
        - Report API
      summary: Query Bet Records
      description: Query bet records
      operationId: queryBets
      parameters:
        - name: uuid
          in: query
          required: true
          schema:
            type: string
          description: Platform-defined unique request ID, length >= 32 and <= 128 bytes
        - name: platform_id
          in: query
          required: true
          schema:
            type: string
          description: Platform product ID
        - name: begintime
          in: query
          required: true
          schema:
            type: string
          description: >-
            Start timestamp (UNIX timestamp in seconds). Note: This is reckon
            time, if bet is recalculated or cancelled via backend, reckon time
            will also change
        - name: endtime
          in: query
          required: true
          schema:
            type: string
          description: >-
            End timestamp (UNIX timestamp in seconds). Maximum range from
            begintime is 7 days (168 hours)
        - name: pagesize
          in: query
          required: true
          schema:
            type: string
          description: Page size (must be between 100 and 10,000)
        - name: pageindex
          in: query
          required: true
          schema:
            type: string
          description: Page index (starting from 0)
        - name: username
          in: query
          required: false
          schema:
            type: string
          description: User account in game (optional)
        - name: type
          in: query
          required: false
          schema:
            type: string
          description: >-
            Query specific record type, 1 - Bet, 2 - Consumption; if type key is
            not present, query all types
        - name: key
          in: query
          required: true
          schema:
            type: string
          description: >-
            md5(begintime + endtime + pagesize + pageindex + type + username +
            platform secret key)
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                  msg:
                    type: string
                  error:
                    type: object
                    properties:
                      uuid:
                        type: string
                  pageindex:
                    type: integer
                    description: Page index
                  pagesize:
                    type: integer
                    description: Page size
                  pagetotal:
                    type: integer
                    description: Total pages
                  totalrecord:
                    type: integer
                    description: Total records
                  records:
                    type: array
                    items:
                      type: object
                      properties:
                        username:
                          type: string
                          description: Player account
                        type:
                          type: integer
                          description: 'Record type: 1 - Bet, 2 - Consumption'
                        table:
                          type: string
                          description: Table ID (type=1)
                        gametype:
                          type: string
                          description: Game type (type=1)
                        playtype:
                          type: integer
                          description: Bet play type or consumption type
                        gamecode:
                          type: string
                          description: Game round code (type=1)
                        ordernumber:
                          type: string
                          description: Order ID
                        betamount:
                          type: string
                          description: Bet amount (type=1)
                        betreward:
                          type: string
                          description: Payout (including principal) (type=1)
                        betincome:
                          type: string
                          description: Net win/loss (type=1)
                        betscore:
                          type: string
                          description: Valid bet amount (type=1)
                        status:
                          type: integer
                          description: Settlement status
                        createtime:
                          type: integer
                          description: Bet time
                        reckontime:
                          type: integer
                          description: Reckon time
                        consumption:
                          type: string
                          description: Total consumption (type=2)
                        rolling_unit:
                          type: integer
                          description: Rolling unit for this game room (type=2)
                        round_detail:
                          type: string
                          description: Round result details (type=2)
                        rolling_amount:
                          type: string
                          description: Rolling amount (type=1)
                        room_account:
                          type: string
                          description: Room account
                        room_name:
                          type: string
                          description: Room name
              example:
                code: 0
                msg: Success
                error:
                  uuid: 973ff058-54e9-4c8b-8c6c-6fecb76a13bb
                pageindex: 6
                pagesize: 300
                pagetotal: 50
                totalrecord: 15000
                records:
                  - consumption: '500'
                    createtime: 1763716819
                    ordernumber: TIPS251121172018lobby2-0000001
                    playtype: 9
                    type: 2
                    username: player001
                    room_account: 9D
                    room_name: 9d01
                  - betamount: '3000'
                    betincome: '3000'
                    betreward: '6000'
                    betscore: '3000'
                    createtime: 1763716799
                    gamecode: 9D1425B211DT
                    gametype: BAC
                    ordernumber: 9D14251121171959020000013
                    playtype: 2
                    reckontime: 1763716821
                    status: 1
                    table: 9D14
                    type: 1
                    username: player001
                    rolling_amount: '3000'
                    room_account: BYTRP
                    room_name: TRP01
        '400':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: 2
                  msg: >-
                    request hash signature(0FACF22B9E3DB5CDC670A0F7A65BB76A) is
                    error
                  uuid: 9e96610f-5388-42df-b3ed-ba1b3178c63b
components:
  schemas:
    Error:
      type: object
      properties:
        code:
          type: string
          description: Error code
        message:
          type: string
          description: Error message
        data:
          description: Data (usually null)
        status_code:
          type: integer
          description: HTTP status code
        service:
          type: string
          description: Service name

````