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

# 玩家交易扣款

> 遊戲內玩家交易操作後的額度變化（由 vendor 實作）

單一請求只會有一種交易類型

因為一次 api call 有可能會下注多個玩法，單筆失敗則視為全部失敗，並不支援部份成功與失敗邏輯



## OpenAPI

````yaml /seamless-openapi.json POST /dt/callback/pay_credit
openapi: 3.1.0
info:
  title: 單一錢包 API
  description: 單一錢包（Seamless Wallet）API 文檔，包含 Game-API 和 Wallet-API
  version: 1.0.0
servers:
  - url: https://api.example.com
    description: API Server
security: []
tags:
  - name: Game-API User
    description: 遊戲 API - 用戶相關操作
  - name: Game-API Report
    description: 遊戲 API - 報表查詢
  - name: Game-API Internal
    description: 遊戲 API - 內部專用（隱藏）
  - name: Wallet-API
    description: 錢包 API - 由 vendor 實作
paths:
  /dt/callback/pay_credit:
    post:
      tags:
        - Wallet-API
      summary: 玩家交易扣款
      description: |-
        遊戲內玩家交易操作後的額度變化（由 vendor 實作）

        單一請求只會有一種交易類型

        因為一次 api call 有可能會下注多個玩法，單筆失敗則視為全部失敗，並不支援部份成功與失敗邏輯
      operationId: payCredit
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - platform_id
                - token
                - uuid
                - account
                - info
              properties:
                platform_id:
                  type: string
                  description: 平台方產品ID
                token:
                  type: string
                  description: 驗證碼，md5(platform_id + uuid + account + type + 平台密鑰)
                uuid:
                  type: string
                  description: 各平台自定義的唯一性請求序號
                account:
                  type: string
                  description: 玩家帳號
                info:
                  type: array
                  description: 交易資料
                  items:
                    type: object
                    properties:
                      type:
                        type: integer
                        description: 交易類型 (7. 投注 9. 小費 27. 送禮 28. 操盤扣玩家額度)
                      transaction_id:
                        type: string
                        description: 交易唯一序號 (長度 1~128 字元，僅允許 ASCII 32-126 可列印字元，禁止使用 ` 和 ~)
                      order_id:
                        type: string
                        description: 注單單號
                      proposal_id:
                        type: string
                        description: 玩家操作交易當下的提案號
                      target_wallet:
                        type: integer
                        description: 額度異動目標錢包 (0.一般錢包 1.傳統錢包)
                      credit:
                        type: number
                        description: 異動金額
                      ip:
                        type: string
                        description: 玩家下注時的ip位置
                      order_detail:
                        type: object
                        description: 注單詳情
                        properties:
                          play_type:
                            type: integer
                            description: 玩法
                          game_type:
                            type: string
                            description: 遊戲類型
                          gmcode:
                            type: string
                            description: 局號
                          table_id:
                            type: string
                            description: 桌台編號
                          room_account:
                            type: string
                            description: 本次操作所在的廳帳號
                          room_name:
                            type: string
                            description: 本次操作所在的廳名稱
                          in_proposal:
                            type: integer
                            description: 玩家當下是否在傳統開工中
                          amount:
                            type: number
                            description: 下注額度
                          create_time:
                            type: integer
                            description: 注單創建時間
                          update_time:
                            type: integer
                            description: 此操作修改注單狀態時間
                      rolling_unit:
                        type: number
                        description: 轉碼單位
                      ratio:
                        type: number
                        description: 變比
            example:
              platform_id: H88
              token: B6AC1083E0F2E47A3D81E1B6B3EA576B
              uuid: lobby1-82818443591811
              account: c001
              info:
                - type: 7
                  credit: -2000
                  transaction_id: 005-200926080808-0000005
                  order_id: A003220118145511020000006
                  target_wallet: 0
                  proposal_id: '954531'
                  ip: 127.0.0.1
                  order_detail:
                    room_account: 1444aad
                    room_name: TRP01
                    table_id: A003
                    gmcode: A003220118
                    in_proposal: 1
                    game_type: BAC
                    play_type: 1
                    amount: 2000
                    create_time: 1668580007
                    last_update_time: 1668580007
                  rolling_unit: 1000
                  ratio: 1
      responses:
        '200':
          description: 成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WalletApiPayCreditResponse'
              example:
                code: 0
                message: success
                uuid: lobby1-82818443591811
                timestamp: 1668580007001
                data:
                  account: c001
                  credit: 115
                  reserved: 100
                  balance: 215
                  platform_id: H88
components:
  schemas:
    WalletApiPayCreditResponse:
      $ref: '#/components/schemas/WalletApiResponseBase'
      description: pay-credit 回應
    WalletApiResponseBase:
      type: object
      description: 錢包 API 回應的基礎結構
      properties:
        code:
          type: integer
          description: 錯誤代碼
        message:
          type: string
          description: 錯誤訊息
        uuid:
          type: string
          description: 自定義的唯一性請求序號
        timestamp:
          type: integer
          description: UNIX time，毫秒
        data:
          type: object
          properties:
            account:
              type: string
              description: 玩家帳號
            credit:
              type: number
              description: 一般錢包額度
            reserved:
              type: number
              description: 專用錢包額度
            balance:
              type: number
              description: 玩家總額度
            platform_id:
              type: string
              description: 平台方產品ID

````