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

# 查詢單個訂單詳情

> 根據訂單 ID 查詢訂單詳情

根據訂單 ID 或自定義訂單 ID 查詢訂單詳情。


## OpenAPI

````yaml openapi/perpdex-zh-TW.yaml GET /dex_futures/{settle}/orders/{order_id}
openapi: 3.0.3
info:
  title: DexBuilder PerpDEX API
  version: 1.0.0
  description: DexBuilder PerpDEX REST API。
servers:
  - url: https://api.dexbuilder.com/api/v1
    description: DexBuilder PerpDEX REST API
security:
  - DexBuilderKey: []
    DexBuilderTimestamp: []
    DexBuilderSignature: []
tags:
  - name: 行情
    description: 永續合約公開行情與市場資料
  - name: 風險資料
    description: 風險限額與市場強平資料
  - name: 帳戶
    description: 帳戶與費率
  - name: 持倉
    description: 持倉查詢與管理
  - name: 訂單
    description: 訂單、成交與批量交易
paths:
  /dex_futures/{settle}/orders/{order_id}:
    get:
      tags:
        - 訂單
      summary: 查詢單個訂單詳情
      description: 根據訂單 ID 或自定義訂單 ID 查詢訂單詳情。
      operationId: getPerpOrder
      parameters:
        - $ref: '#/components/parameters/Settle'
        - $ref: '#/components/parameters/OrderIdPath'
      responses:
        '200':
          description: 查詢成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DEXFuturesOrder'
components:
  parameters:
    Settle:
      name: settle
      in: path
      required: true
      description: 結算幣種
      schema:
        type: string
        enum:
          - usdt
      example: usdt
    OrderIdPath:
      name: order_id
      in: path
      required: true
      description: 訂單 ID 或自定義訂單 ID
      schema:
        type: string
      example: '12345'
  schemas:
    DEXFuturesOrder:
      allOf:
        - $ref: '#/components/schemas/DEXFuturesOrderRequest'
        - type: object
          properties:
            id:
              type: integer
              format: int64
              description: 訂單 ID
            user:
              type: integer
              format: int64
              description: 使用者 ID
            create_time:
              type: number
              format: double
              description: 建立時間
            update_time:
              type: number
              format: double
              description: 更新時間
            finish_time:
              type: number
              format: double
              description: 完成時間
            finish_as:
              type: string
              description: 訂單完成原因
            status:
              type: string
              description: 訂單狀態
              enum:
                - open
                - finished
            left:
              type: string
              description: 未成交數量
            fill_price:
              type: string
              description: 平均成交價
            is_close:
              type: boolean
              description: 是否平倉單
            is_reduce_only:
              type: boolean
              description: 是否只減倉
            is_liq:
              type: boolean
              description: 是否強平單
            tkfr:
              type: string
              description: Taker 費率
            mkfr:
              type: string
              description: Maker 費率
            stp_id:
              type: integer
              format: int64
              description: STP 組欄位
            amend_text:
              type: string
              description: 改單自定義資訊
          additionalProperties: true
    DEXFuturesOrderRequest:
      type: object
      required:
        - contract
        - size
        - price
      properties:
        contract:
          type: string
          description: 永續合約
          example: BTC_USDT
        size:
          type: string
          description: 合約張數；正數買入、負數賣出，平倉可為 0
        iceberg:
          type: string
          description: 冰山單顯示數量，0 表示非冰山單
        price:
          type: string
          description: 委託價格；price=0 且 tif=ioc 時為市價單
        close:
          type: boolean
          description: 是否平倉；為 true 時 size 需為 0
        reduce_only:
          type: boolean
          description: 是否只減倉
        tif:
          type: string
          description: 訂單有效方式
          enum:
            - gtc
            - ioc
            - poc
            - fok
        text:
          type: string
          description: 自定義訂單資訊
        auto_size:
          type: string
          description: 雙向持倉平倉方向
          enum:
            - close_long
            - close_short
        stp_act:
          type: string
          description: 自成交防護策略
          enum:
            - co
            - cn
            - cb
            - '-'
        bbo:
          type: string
          description: 對手價相關參數
        default_leverage:
          type: string
          description: 預設槓桿
        pid:
          type: integer
          format: int64
          description: Position ID
        order_value:
          type: string
          description: 訂單價值
        trade_value:
          type: string
          description: 成交價值
        market_order_slip_ratio:
          type: string
          description: 市價單自定義最大滑點比例
  securitySchemes:
    DexBuilderKey:
      type: apiKey
      in: header
      name: KEY
      description: DexBuilder API Key
    DexBuilderTimestamp:
      type: apiKey
      in: header
      name: Timestamp
      description: Unix 時間戳（秒），與目前時間差不得超過 60 秒
    DexBuilderSignature:
      type: apiKey
      in: header
      name: SIGN
      description: 使用 API Secret 對簽名字串執行 HMAC-SHA512 後的十六進制簽名

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.