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

# 列出订单

> 按资产、状态、客户参考号或时间条件查询账户订单。使用 order_id 查询单笔订单详情。

<RequestExample>
  ```bash cURL
  curl --request GET \
    --url 'https://api-sandbox.uqpaytech.com/api/v1/stocks/order' \
    --header "Content-Type: application/json" \
    --header "x-auth-token: Bearer ${SANDBOX_TOKEN}"
  ```
</RequestExample>

<ResponseExample>
  ```json 200
  {
    "data": [
      {
        "transfer_quantity": null,
        "order_id": "53fe3d55-85ff-4804-b6f0-a25a32aa082f",
        "quote_id": "0576b03b-56dd-48b1-ba24-058ce90d0f53",
        "client_reference": "stocks-docs-20260921-buy-01",
        "asset_id": "7453f146-b267-11f1-b4f4-0abd773ba497",
        "symbol": "AAPLx",
        "side": "BUY",
        "status": "PENDING",
        "network": "Ethereum",
        "funding_currency": "USDC",
        "quoted_quantity": "0.00297066689243735",
        "executed_quantity": null,
        "executed_price": null,
        "cash_amount": null,
        "fees": null,
        "total_amount": null,
        "transaction_hash": "0x7e7b7f06c0a4adce2ec2bc01b455fd4e014b9f298e7e2598b02c93dffa86a96f",
        "failure_code": null,
        "failure_message": null,
        "created_at": "2026-09-21T01:33:08.629Z",
        "updated_at": "2026-09-21T01:36:07.196Z",
        "completed_at": null,
        "failed_at": null
      }
    ],
    "total_items": 1,
    "total_pages": 1
  }
  ```
</ResponseExample>


## OpenAPI

````yaml /zh/stocks/stocks.yaml get /order
openapi: 3.0.3
info:
  title: UQPAY Stocks API
  version: 1.0.0
  description: 浏览资产、获取报价、创建订单并查询订单及持仓。金额和数量使用十进制字符串。
  x-source-en-commit: 586409f
  x-source-en-path: stocks/stocks.yaml
servers:
  - url: https://api-sandbox.uqpaytech.com/api/v1/stocks
    description: Sandbox
security:
  - AuthToken: []
paths:
  /order:
    get:
      tags:
        - Stocks
      summary: 列出订单
      description: 按资产、状态、客户参考号或时间条件查询账户订单。使用 order_id 查询单笔订单详情。
      operationId: listStocksOrders
      parameters:
        - name: page_number
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 1000000
            default: 1
          description: 要查询的页码。
        - name: page_size
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 10
          description: 每页返回的最大条目数。
        - name: symbol
          in: query
          required: false
          schema:
            type: string
            maxLength: 32
          description: 按资产代码筛选。
        - name: asset_id
          in: query
          required: false
          schema:
            type: string
            format: uuid
          description: List assets 返回的资产标识。
        - name: client_reference
          in: query
          required: false
          schema:
            type: string
            minLength: 1
            maxLength: 100
          description: 按创建订单时提交的客户参考号筛选。
        - name: order_status
          in: query
          required: false
          schema:
            type: string
            enum:
              - PENDING
              - SUCCESS
              - FAILED
          description: 按公开订单处理状态筛选。
        - name: from
          in: query
          required: false
          schema:
            type: string
            format: date-time
          description: 创建时间范围的起点（包含）；同时提供时，from 必须早于 to。
        - name: to
          in: query
          required: false
          schema:
            type: string
            format: date-time
          description: 创建时间范围的终点（不包含）；同时提供时，from 必须早于 to。
      responses:
        '200':
          description: 成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderPage'
              examples:
                sandbox:
                  summary: Sandbox response
                  value:
                    data:
                      - transfer_quantity: null
                        order_id: 53fe3d55-85ff-4804-b6f0-a25a32aa082f
                        quote_id: 0576b03b-56dd-48b1-ba24-058ce90d0f53
                        client_reference: stocks-docs-20260921-buy-01
                        asset_id: 7453f146-b267-11f1-b4f4-0abd773ba497
                        symbol: AAPLx
                        side: BUY
                        status: PENDING
                        network: Ethereum
                        funding_currency: USDC
                        quoted_quantity: '0.00297066689243735'
                        executed_quantity: null
                        executed_price: null
                        cash_amount: null
                        fees: null
                        total_amount: null
                        transaction_hash: >-
                          0x7e7b7f06c0a4adce2ec2bc01b455fd4e014b9f298e7e2598b02c93dffa86a96f
                        failure_code: null
                        failure_message: null
                        created_at: '2026-09-21T01:33:08.629Z'
                        updated_at: '2026-09-21T01:36:07.196Z'
                        completed_at: null
                        failed_at: null
                    total_items: 1
                    total_pages: 1
        '400':
          description: 请求失败。读取错误响应中的 type、code 和 message。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: 请求失败。读取错误响应中的 type、code 和 message。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: 请求失败。读取错误响应中的 type、code 和 message。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: 请求失败。读取错误响应中的 type、code 和 message。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: 请求失败。读取错误响应中的 type、code 和 message。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: 请求失败。读取错误响应中的 type、code 和 message。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '502':
          description: 网关未能完成请求。写入操作应先核对结果，再使用同一幂等键重试。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: 请求失败。读取错误响应中的 type、code 和 message。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      x-codeSamples:
        - lang: cURL
          source: |-
            curl --request GET \
              --url 'https://api-sandbox.uqpaytech.com/api/v1/stocks/order' \
              --header "Content-Type: application/json" \
              --header "x-auth-token: Bearer ${SANDBOX_TOKEN}"
components:
  schemas:
    OrderPage:
      type: object
      additionalProperties: false
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Order'
          description: 本页记录。空数组可能表示没有匹配记录或页码超出结果范围。
        total_pages:
          type: integer
          format: int64
          minimum: 0
          description: 按请求的每页条数计算的结果总页数。
          example: 1
        total_items:
          type: integer
          format: int64
          minimum: 0
          description: 所有页中符合筛选条件的记录总数。
          example: 1
      required:
        - data
        - total_pages
        - total_items
    Error:
      type: object
      additionalProperties: false
      required:
        - type
        - code
        - message
      properties:
        type:
          type: string
          description: 用于分类处理失败的错误类别。
          pattern: ^[a-z][a-z0-9]*(_[a-z0-9]+)*$
        code:
          type: string
          description: 可供程序处理的业务错误码。结合 HTTP 状态处理，不要依赖 message 文本匹配。
          pattern: ^[a-z][a-z0-9]*(_[a-z0-9]+)*$
        message:
          type: string
          description: 错误原因的可读说明。
    Order:
      type: object
      additionalProperties: false
      properties:
        order_id:
          type: string
          format: uuid
          description: 用于查询订单详情的订单标识。
          example: 53fe3d55-85ff-4804-b6f0-a25a32aa082f
        quote_id:
          type: string
          format: uuid
          description: 交易订单使用的报价标识；充值和提现记录为 null。
          nullable: true
          example: 0576b03b-56dd-48b1-ba24-058ce90d0f53
        client_reference:
          type: string
          nullable: true
          description: 用于查询订单的客户参考号，不能替代幂等键。
          example: stocks-docs-20260921-buy-01
        asset_id:
          type: string
          format: uuid
          description: 平台资产 UUID，列表与所有交易接口共用
          example: 7453f146-b267-11f1-b4f4-0abd773ba497
        symbol:
          type: string
          description: 资产代码。
          example: AAPLx
        side:
          type: string
          enum:
            - BUY
            - SELL
            - DEPOSIT
            - WITHDRAWAL
          description: 订单业务类型。交易订单来源于报价；充值和提现记录表示资产转入或转出。
          example: BUY
        status:
          type: string
          enum:
            - PENDING
            - SUCCESS
            - FAILED
          description: 订单处理状态。完成后再按结算数值进行对账。
          example: SUCCESS
        network:
          type: string
          nullable: true
          description: 执行或资产转移所用的区块链网络；不可用时为 null。
          example: Ethereum
        funding_currency:
          type: string
          description: 交易使用的资金币种；资产转移记录为 null。
          nullable: true
          example: USDC
        quoted_quantity:
          type: string
          pattern: ^-?[0-9]+(\.[0-9]+)?$
          nullable: true
          description: 所接受报价中的数量；报价未确定数量或记录属于资产转移时为 null。
          example: '0.00297066689243735'
        executed_quantity:
          type: string
          pattern: ^-?[0-9]+(\.[0-9]+)?$
          nullable: true
          description: 已完成交易的结算数量；结算前为 null。
          example: '0.00297066689243735'
        executed_price:
          type: string
          pattern: ^-?[0-9]+(\.[0-9]+)?$
          nullable: true
          description: 以 funding_currency 计价的每单位结算价格，不表示资产转移的成本基础。
          example: '336.624750000000055741'
        cash_amount:
          type: string
          pattern: ^-?[0-9]+(\.[0-9]+)?$
          nullable: true
          description: 以 funding_currency 计价、不含手续费的结算金额；结算前及资产转移记录为 null。
          example: '1'
        fees:
          type: array
          items:
            $ref: '#/components/schemas/Fee'
          nullable: true
          description: 已完成订单记录的费用；null 表示尚无已结算费用信息。
          example:
            - type: TRADING
              amount: '0.0005'
              currency: USDC
        total_amount:
          type: string
          pattern: ^-?[0-9]+(\.[0-9]+)?$
          nullable: true
          description: >-
            以 funding_currency 计价，买入时为含手续费的结算总支出，卖出时为扣除手续费后的结算收入；结算前及资产转移记录为
            null。
          example: '1.0005'
        transaction_hash:
          type: string
          nullable: true
          description: 可用时返回公开交易哈希；null 本身不表示订单失败。
          example: '0x7e7b7f06c0a4adce2ec2bc01b455fd4e014b9f298e7e2598b02c93dffa86a96f'
        failure_code:
          type: string
          nullable: true
          description: 失败订单的业务失败标识，与 HTTP 错误码分别处理。
        failure_message:
          type: string
          nullable: true
          description: 订单失败原因的可读说明；未报告失败时为 null。
        created_at:
          type: string
          format: date-time
          description: 订单创建时间。
          example: '2026-09-21T01:33:08.629Z'
        updated_at:
          type: string
          format: date-time
          description: 订单最近更新时间。
          example: '2026-09-21T01:50:53.855Z'
        completed_at:
          type: string
          format: date-time
          nullable: true
          description: 结算完成时间；订单完成前为 null。
          example: '2026-09-21T01:50:53.561Z'
        failed_at:
          type: string
          format: date-time
          nullable: true
          description: 终态失败时间；订单未失败时为 null。
        transfer_quantity:
          type: string
          pattern: ^-?[0-9]+(\.[0-9]+)?$
          nullable: true
          description: 充值或提现的资产数量；买入和卖出订单为 null。
      required:
        - order_id
        - quote_id
        - client_reference
        - asset_id
        - symbol
        - side
        - status
        - network
        - funding_currency
        - quoted_quantity
        - executed_quantity
        - executed_price
        - cash_amount
        - fees
        - total_amount
        - transaction_hash
        - failure_code
        - failure_message
        - created_at
        - updated_at
        - completed_at
        - failed_at
        - transfer_quantity
    Fee:
      type: object
      additionalProperties: false
      properties:
        type:
          type: string
          enum:
            - TRADING
            - DEPOSIT
            - WITHDRAWAL
          description: 费用类别。
          example: TRADING
        amount:
          type: string
          pattern: ^-?[0-9]+(\.[0-9]+)?$
          description: 费用金额
          example: '0.0005'
        currency:
          type: string
          description: 收取费用的币种。
          example: USDC
      required:
        - type
        - amount
        - currency
  securitySchemes:
    AuthToken:
      type: apiKey
      in: header
      name: x-auth-token
      description: 由 UQPAY 提供的登录 API Token。

````