> ## 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 /payment/open/institution/v1/pay/address/transactiondetail` 接口。完整的请求参数、响应结构与示例由上方关联的 OpenAPI 定义渲染。

查询地址直付单在链上的交易详情，包含有效期内直付记录和有效期外的支付记录两部分

## 说明

* 认证方式使用 GatePay 标准签名请求头。
* 本页展示同一接口的机构路径版本。
* 除创建子账户、查询子账户详情、分页查询子账户外，机构侧请求需携带 `X-GatePay-On-Behalf-Of`。
* 通用签名规则请参见 [/api-reference/version/100/cn/common/securityAndSignature](/api-reference/version/100/cn/common/securityAndSignature)。


## OpenAPI

````yaml api-reference/version/100/cn/openapi/institution/address-payment-openapi.json GET /payment/open/institution/v1/pay/address/transactiondetail
openapi: 3.0.1
info:
  title: GatePay 地址支付 API
  version: 1.0.0
  description: GatePay 地址支付接口（中文描述）
servers:
  - url: https://openplatform.gateapi.io
security: []
paths:
  /payment/open/institution/v1/pay/address/transactiondetail:
    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: prepayId
          in: query
          required: true
          description: 地址支付预支付单id
          schema:
            type: string
        - $ref: '#/components/parameters/X-GatePay-On-Behalf-Of'
      responses:
        '200':
          description: 成功响应
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionDetailResponse'
              example:
                status: SUCCESS
                code: '000000'
                errorMessage: ''
                data:
                  prepayId: '40100646616043520'
                  merchantId: 10002
                  merchantTradeNo: '9384029384092499'
                  transactionId: '1671522905110477'
                  goodsName: ''
                  currency: BTC
                  orderAmount: '212.999'
                  payCurrency: BTC
                  payAmount: '212.999'
                  status: EXPIRED
                  utcCreateTime: '2022-12-20 07:45:39'
                  utcExpireTime: '2022-12-20 07:55:00'
                  utcUpdateTime: '2022-12-20 07:46:00'
                  transactTime: 1671522905110
                  order_name: MiniApp-Payment-1#9384029384092499
                  channelId: '123456'
                  transactionDetail:
                    inTerm:
                      done:
                        amount: '100'
                        txList:
                          - chain: BTC
                            address: 12eBREQqZFFDqgDfXkuBdzW2KBwhU8amPn
                            fromAddress: PAzupoupdSYaYoajDcABEUzigBRzewvzN
                            fullCurrType: BTC
                            amount: '100'
                            txId: dosajdajdiojawojdoiwajdojaefhs
                            utcCreateTime: '2022-12-19 11:49:00'
                            utcUpdateTime: '2022-12-19 11:50:00'
                            utcConfirmingTime: '2022-12-19 11:51:00'
                            complianceStatus: ACCEPTED
                            utcDoneTime: '2022-12-19 11:52:00'
                      wait:
                        amount: '99'
                        txList:
                          - chain: BTC
                            address: 12eBREQqZFFDqgDfXkuBdzW2KBwhU8amPn
                            fromAddress: PAzupoupdSYaYoajDcABEUzigBRzewvzN
                            fullCurrType: BTC
                            amount: '99'
                            txId: dosajdajdiojawojdoiwajdojaikjs
                            utcCreateTime: '2022-12-19 11:49:30'
                            utcUpdateTime: '2022-12-19 11:50:00'
                            utcConfirmingTime: '2022-12-19 11:51:30'
                            complianceStatus: PEND
                    outOfTerm:
                      done:
                        amount: '98'
                        txList:
                          - chain: BTC
                            address: 12eBREQqZFFDqgDfXkuBdzW2KBwhU8amPn
                            fromAddress: PAzupoupdSYaYoajDcABEUzigBRzewvzN
                            fullCurrType: BTC
                            amount: '98'
                            txId: dosajdajdoakawojdoiwajdojaikjs
                            utcCreateTime: '2022-12-19 11:55:00'
                            utcUpdateTime: '2022-12-19 11:56:00'
                            utcConfirmingTime: '2022-12-19 11:57:00'
                            complianceStatus: ACCEPTED
                            utcDoneTime: '2022-12-19 11:58:00'
                      wait:
                        amount: '193'
                        txList:
                          - chain: BTC
                            address: 12eBREQqZFFDqgDfXkuBdzW2KBwhU8amPn
                            fromAddress: PAzupoupdSYaYoajDcABEUzigBRzewvzN
                            fullCurrType: BTC
                            amount: '97'
                            txId: dosajdajdiojawolakiwajdojaikjs
                            utcCreateTime: '2022-12-19 11:55:30'
                            utcUpdateTime: '2022-12-19 11:56:00'
                            complianceStatus: REJECTED
                          - chain: BTC
                            address: 12eBREQqZFFDqgDfXkuBdzW2KBwhU8amPn
                            fromAddress: PAzupoupdSYaYoajDcABEUzigBRzewvzN
                            fullCurrType: BTC
                            amount: '96'
                            txId: dosajdajdiojawolakiwajdppaikjs
                            utcCreateTime: '2022-12-19 11:55:45'
                            utcUpdateTime: '2022-12-19 11:56:00'
                            utcConfirmingTime: '2022-12-19 11:57:30'
                            complianceStatus: PEND
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'
    X-GatePay-On-Behalf-Of:
      name: X-GatePay-On-Behalf-Of
      in: header
      required: true
      schema:
        type: string
      description: >-
        必填代理归属请求头。请填写本次请求的发起方账户 ID；在机构代理商户 API 中通常填写目标子账户 ID，在机构代扣与划转接口中可填写机构账户
        ID 或子账户 ID。
  schemas:
    TransactionDetailResponse:
      type: object
      description: 查询链上交易详情响应
      properties:
        prepayId:
          type: string
          description: 支付单ID
        merchantId:
          type: integer
          format: int64
          description: 商户在Gate的UID
        merchantTradeNo:
          type: string
          description: 商户系统交易号
        transactionId:
          type: string
          description: 交易流水号
        goodsName:
          type: string
          description: 商品名称
        currency:
          type: string
          description: 订单币种
        orderAmount:
          type: string
          description: 订单金额
        payCurrency:
          type: string
          description: 用户实际支付币种
        payAmount:
          type: string
          description: 用户实际支付金额
        status:
          type: string
          description: 订单状态
        utcCreateTime:
          type: string
          description: 订单创建时间（UTC）
        utcExpireTime:
          type: string
          description: 订单过期时间（UTC）
        utcUpdateTime:
          type: string
          description: 订单状态更新时间（UTC）
        transactTime:
          type: integer
          format: int64
          description: 订单在后台完成交易的UTC毫秒时间戳
        order_name:
          type: string
          description: 订单名称
        channelId:
          type: string
          description: 客户名称
        transactionDetail:
          $ref: '#/components/schemas/TransactionDetail'
    TransactionDetail:
      type: object
      description: 链上交易详情
      properties:
        inTerm:
          $ref: '#/components/schemas/TxDetail'
        outOfTerm:
          $ref: '#/components/schemas/TxDetail'
    TxDetail:
      type: object
      description: '`inTerm`有效期内的支付记录详情,`outOfTerm`有效期外的支付记录详情'
      properties:
        done:
          $ref: '#/components/schemas/TxDetailStateItem'
        wait:
          $ref: '#/components/schemas/TxDetailStateItem'
    TxDetailStateItem:
      type: object
      description: '`done`链上确认完毕的交易详情,`wait` 链上确认中的交易详情'
      properties:
        amount:
          type: string
          description: 总金额
        txList:
          description: 支付记录列表
          type: array
          items:
            $ref: '#/components/schemas/TxItem'
    TxItem:
      description: 支付记录列表
      type: object
      properties:
        chain:
          type: string
          description: 链名称
        address:
          type: string
          description: 地址
        fromAddress:
          type: string
          description: 付款方地址
        fullCurrType:
          type: string
          description: 含网络信息的链名称
        amount:
          type: string
          description: 金额
        txId:
          type: string
          description: 链上交易id
        utcCreateTime:
          type: string
          description: 创建时间（UTC）
        utcUpdateTime:
          type: string
          description: 更新时间（UTC）
        utcConfirmingTime:
          type: string
          description: 链上交易开始同步时间（UTC），格式如 `2023-01-07 14:04:02`
        complianceStatus:
          type: string
          description: 合规验证状态：`ACCEPTED` 通过、`PEND` 待处理、`REJECTED` 拒绝
        utcDoneTime:
          type: string
          description: 链上交易确认时间（UTC），格式如 `2023-01-07 14:04:02`

````