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

# 查询交易手续费

> 根据商户订单号查询订单的手续费、支付明细及结算信息。

## 概述

本页说明 `GET /api/open/v1/pay/order/fee/query` 接口。完整的请求参数、响应结构与示例由上方关联的 OpenAPI 定义渲染。

## 说明

* 认证方式使用 GatePay 标准签名请求头。
* 本页展示普通商户接口。
* 通用签名规则请参见 [/api-reference/version/100/cn/common/securityAndSignature](/api-reference/version/100/cn/common/securityAndSignature)。


## OpenAPI

````yaml api-reference/version/100/cn/openapi/common-openapi.json GET /api/open/v1/pay/order/fee/query
openapi: 3.1.0
info:
  title: GatePay 通用 API
  description: GatePay 通用 API 接口文档，包含账户余额查询和交易手续费查询。
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://openplatform.gateapi.io
security: []
paths:
  /api/open/v1/pay/order/fee/query:
    get:
      summary: 查询交易手续费
      description: 根据商户订单号查询订单的手续费、支付明细及结算信息。
      parameters:
        - $ref: '#/components/parameters/X-GatePay-Certificate-ClientId'
        - $ref: '#/components/parameters/X-GatePay-Signature'
        - $ref: '#/components/parameters/X-GatePay-Timestamp'
        - $ref: '#/components/parameters/X-GatePay-Nonce'
        - name: merchantTradeNo
          in: query
          required: true
          description: 商户订单号
          schema:
            type: string
            example: M8017074206
      responses:
        '200':
          description: 查询成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FeeQueryResponse'
              examples:
                successResponse:
                  summary: 成功响应
                  value:
                    code: '000000'
                    data:
                      merchantTradeNo: M8017074206
                      orderCurrency: USDC
                      orderAmount: '110.33'
                      payAmount: '110.33'
                      totalFeeAmount: '5.11'
                      totalSettleAmount: '105.22'
                      payDetails:
                        - transactionId: '35717875766394895'
                          payType: GatePay
                          payTime: '1762858225978'
                          payAmount: '0.11'
                          payCurrency: USDC
                          feeAmount: '0.11'
                          settleAmount: '0'
                    status: SUCCESS
                    errorMessage: ''
components:
  parameters:
    X-GatePay-Certificate-ClientId:
      name: X-GatePay-Certificate-ClientId
      in: header
      required: true
      description: 商户客户端ID
      schema:
        type: string
        example: 4186d0c6-6a35-55a9-8dc6-5312769dbff8
    X-GatePay-Signature:
      name: X-GatePay-Signature
      in: header
      required: true
      description: 签名
      schema:
        type: string
        example: 672d5650dcc9bb22ebf25fa16c28d03c0e159d742a9176d4340a5da326d75dc8
    X-GatePay-Timestamp:
      name: X-GatePay-Timestamp
      in: header
      required: true
      description: 时间戳（毫秒）
      schema:
        type: string
        example: '1672905655498'
    X-GatePay-Nonce:
      name: X-GatePay-Nonce
      in: header
      required: true
      description: 随机数
      schema:
        type: string
        example: '9578'
  schemas:
    FeeQueryResponse:
      type: object
      properties:
        status:
          type: string
          description: SUCCESS 或者 FAIL
          example: SUCCESS
        code:
          type: string
          description: 出错代码。550139=订单不存在；550140=订单无支付流水；550141=费用正在计算中请稍后重试
          example: '000000'
        errorMessage:
          type: string
          description: 错误信息
          example: ''
        data:
          $ref: '#/components/schemas/FeeQueryData'
    FeeQueryData:
      type: object
      properties:
        merchantTradeNo:
          type: string
          description: 商户订单号
          example: M8017074206
        orderCurrency:
          type: string
          description: 订单币种
          example: USDC
        orderAmount:
          type: string
          description: 订单金额
          example: '110.33'
        payAmount:
          type: string
          description: 累计已支付金额
          example: '110.33'
        totalFeeAmount:
          type: string
          description: 累计已收取的手续费
          example: '5.11'
        totalSettleAmount:
          type: string
          description: 累计已结算金额
          example: '105.22'
        payDetails:
          type: array
          description: 支付明细列表
          items:
            $ref: '#/components/schemas/PayDetail'
    PayDetail:
      type: object
      properties:
        transactionId:
          type: string
          description: 支付流水号
          example: '35717875766394895'
        payType:
          type: string
          description: 支付类型
          example: GatePay
        payTime:
          type: string
          description: 支付时间
          example: '1762858225978'
        payAmount:
          type: string
          description: 支付金额
          example: '0.11'
        payCurrency:
          type: string
          description: 支付币种
          example: USDC
        feeAmount:
          type: string
          description: 手续费
          example: '0.11'
        settleAmount:
          type: string
          description: 结算金额
          example: '0'

````