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

## 说明

* 认证方式使用 GatePay 标准签名请求头。
* 这个机构专属接口需要携带 `X-GatePay-On-Behalf-Of`，表示本次划转记录查询对应的发起方账户 ID，可填写机构账户 ID 或子账户 ID。
* 当前版本中，该接口主要用于按 `merchantBatchNo` 查询历史划转记录、补查执行结果或对账核对，不再作为异步轮询接口使用。
* 通用签名规则请参见 [/api-reference/version/100/cn/common/securityAndSignature](/api-reference/version/100/cn/common/securityAndSignature)。


## OpenAPI

````yaml api-reference/version/100/cn/openapi/institutional-openapi.json GET /transfer/open/institution/v1/pay/transfer/detail
openapi: 3.1.0
info:
  title: GatePay 机构 API
  description: Gate Pay 机构 API 接口文档
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://openplatform.gateapi.io
security: []
paths:
  /transfer/open/institution/v1/pay/transfer/detail:
    get:
      summary: 划转记录查询
      description: 根据商户批次号查询历史划转记录，用于补查执行结果或对账核对。当前版本中不再用于异步轮询。
      parameters:
        - $ref: '#/components/parameters/X-GatePay-Certificate-ClientId'
        - $ref: '#/components/parameters/X-GatePay-Timestamp'
        - $ref: '#/components/parameters/X-GatePay-Nonce'
        - $ref: '#/components/parameters/X-GatePay-Signature'
        - $ref: '#/components/parameters/X-GatePay-On-Behalf-Of'
        - name: merchantBatchNo
          in: query
          required: true
          description: 由商户侧生成的唯一批次 ID
          schema:
            type: string
            example: '12345654545'
      responses:
        '200':
          description: 成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransferDetailResponseWrapper'
              examples:
                success:
                  summary: 成功响应
                  value:
                    status: SUCCESS
                    code: '000000'
                    errorMessage: ''
                    data:
                      merchantBatchNo: '1234565454511231'
                      status: PAID
                      fromAccountId: '2124267192'
                      toAccountId: '1979044675'
                      currency: USDT
                      amount: '1'
                      createTime: 1763455435851
components:
  parameters:
    X-GatePay-Certificate-ClientId:
      name: X-GatePay-Certificate-ClientId
      in: header
      required: true
      description: 商户在Gate商户后台注册应用时分配的clientId
      schema:
        type: string
        example: 4186d0c6-6a35-55a9-8dc6-5312769dbff8
    X-GatePay-Timestamp:
      name: X-GatePay-Timestamp
      in: header
      required: true
      description: 请求生成时的UTC时间戳，milliseconds。请注意，GatePay不处理收到请求时间与这个时间戳差距大于10秒钟的请求
      schema:
        type: string
        example: '1672905655498'
    X-GatePay-Nonce:
      name: X-GatePay-Nonce
      in: header
      required: true
      description: 随机字符串，字符符合HTTP Header头部的规范，建议长度在32个字符以内，字符串组成为数字和字母
      schema:
        type: string
        example: '9578'
    X-GatePay-Signature:
      name: X-GatePay-Signature
      in: header
      required: true
      description: 请求签名。GatePay通过此签名来确定此请求是否合法
      schema:
        type: string
    X-GatePay-On-Behalf-Of:
      name: X-GatePay-On-Behalf-Of
      in: header
      required: true
      schema:
        type: string
      description: 必填代理归属请求头。请填写本次交易的发起方账户 ID，可填写机构账户 ID 或子账户 ID。
  schemas:
    TransferDetailResponseWrapper:
      type: object
      properties:
        status:
          type: string
        code:
          type: string
        errorMessage:
          type: string
        data:
          $ref: '#/components/schemas/TransferDetailResponse'
    TransferDetailResponse:
      type: object
      properties:
        merchantBatchNo:
          type: string
          description: 批次 ID，与入参 merchantBatchNo 一致
        status:
          type: string
          description: 状态：ERROR 失败；EXPIRED 过期；PAID 成功；CANCELLED 关单
        toAccountId:
          type: string
          description: 收款账户 ID
        fromAccountId:
          type: string
          description: 出款账户 ID
        createTime:
          type: integer
          format: int64
          description: 订单创建时间，毫秒
        currency:
          type: string
          description: 币种
        amount:
          type: string
          description: 划转金额
      description: 历史记录查询结果。用于补查执行结果或对账核对。

````