> ## 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.

# 查詢遊戲紀錄

> 查詢注單

<Accordion title="此 API 可能返回的錯誤代碼">
  | 代碼   | 說明            |
  | ---- | ------------- |
  | 0    | 成功            |
  | 2    | 無效參數          |
  | 9    | 查詢日期範圍過大      |
  | 19   | 請求次數已達上限      |
  | 20   | Secret key 錯誤 |
  | 23   | 非法時間戳記        |
  | 25   | 類型參數錯誤        |
  | 26   | 分頁大小參數錯誤      |
  | 27   | 分頁索引參數錯誤      |
  | 36   | 伺服器錯誤         |
  | 9999 | 未知錯誤          |
</Accordion>


## OpenAPI

````yaml /transfer-openapi.json GET /api/v1/dt/bets
openapi: 3.1.0
info:
  title: 轉帳錢包 API
  description: Game-API 用於 vendor 向遊戲取得遊戲相關數據
  version: 1.0.0
servers:
  - url: https://api.example.com
    description: Production server
security: []
paths:
  /api/v1/dt/bets:
    get:
      tags:
        - Report API
      summary: 查詢遊戲紀錄
      description: 查詢注單
      operationId: queryBets
      parameters:
        - name: uuid
          in: query
          required: true
          schema:
            type: string
          description: 各平台自定義的唯一性請求序號，長度 >= 32 且 <= 128 字節
        - name: platform_id
          in: query
          required: true
          schema:
            type: string
          description: 平台方的產品 ID
        - name: begintime
          in: query
          required: true
          schema:
            type: string
          description: 開始時間戳記 (UNIX timestamp 格式，以秒為單位)。注意：此為結算時間，如果注單有透過後台重算或取消，結算時間也會跟著異動
        - name: endtime
          in: query
          required: true
          schema:
            type: string
          description: 結束時間戳記 (UNIX timestamp 格式，以秒為單位)。與 begintime 的最大差距為 7 天 (168 小時)
        - name: pagesize
          in: query
          required: true
          schema:
            type: string
          description: 單頁筆數 (需介於 100 ~ 10,000 之間)
        - name: pageindex
          in: query
          required: true
          schema:
            type: string
          description: 查詢第幾頁 (從 0 開始遞增)
        - name: username
          in: query
          required: false
          schema:
            type: string
          description: 用戶在遊戲中的帳號（選填）
        - name: type
          in: query
          required: false
          schema:
            type: string
          description: 查詢特定類型的記錄，1 - 投注、2 - 消費；若參數中沒有 type 這個 key，則對全部類型進行查詢
        - name: key
          in: query
          required: true
          schema:
            type: string
          description: >-
            md5(begintime + endtime + pagesize + pageindex + type + username +
            平台密鑰)
      responses:
        '200':
          description: 成功
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                  msg:
                    type: string
                  error:
                    type: object
                    properties:
                      uuid:
                        type: string
                  pageindex:
                    type: integer
                    description: 分頁索引
                  pagesize:
                    type: integer
                    description: 單頁筆數
                  pagetotal:
                    type: integer
                    description: 總頁數
                  totalrecord:
                    type: integer
                    description: 總筆數
                  records:
                    type: array
                    items:
                      type: object
                      properties:
                        username:
                          type: string
                          description: 玩家帳號
                        type:
                          type: integer
                          description: 紀錄類型 1 - 投注、2 - 消費
                        table:
                          type: string
                          description: 桌號 (type=1)
                        gametype:
                          type: string
                          description: 遊戲類型 (type=1)
                        playtype:
                          type: integer
                          description: 投注玩法或消費類型
                        gamecode:
                          type: string
                          description: 局號 (type=1)
                        ordernumber:
                          type: string
                          description: 注單號
                        betamount:
                          type: string
                          description: 投注金額 (type=1)
                        betreward:
                          type: string
                          description: 派彩 (包含本金) (type=1)
                        betincome:
                          type: string
                          description: 淨輸贏 (type=1)
                        betscore:
                          type: string
                          description: 有效投注金額 (type=1)
                        status:
                          type: integer
                          description: 結算狀態
                        createtime:
                          type: integer
                          description: 投注時間
                        reckontime:
                          type: integer
                          description: 結算時間
                        consumption:
                          type: string
                          description: 消費總額 (type=2)
                        rolling_unit:
                          type: integer
                          description: 該遊戲廳轉碼單位 (type=2)
                        round_detail:
                          type: string
                          description: 局結果詳情 (type=2)
                        rolling_amount:
                          type: string
                          description: 轉碼值 (type=1)
                        room_account:
                          type: string
                          description: 廳帳號
                        room_name:
                          type: string
                          description: 廳名稱
              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: 錯誤
          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: 錯誤代碼
        message:
          type: string
          description: 錯誤訊息
        data:
          description: 資料（通常為 null）
        status_code:
          type: integer
          description: HTTP 狀態碼
        service:
          type: string
          description: 服務名稱

````