> ## 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.

# 提现订单状态查询

> 根据批次 ID 和明细状态查询提现批次及子单详情。

## 概述

本页说明 `POST /withdraw/open/institution/v1/pay/payouts/detail` 接口。完整的请求参数、响应结构与示例由上方关联的 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/withdraw-openapi.json POST /payment/open/institution/v1/pay/withdraw/query
openapi: 3.1.0
info:
  title: GatePay 提现与钱包 API
  version: 1.0.0
  description: >-
    基于 GatePay 提现与钱包相关文档整理的 OpenAPI 3.1
    规范。涵盖批量提现下单、提现订单查询、币种链查询、账户总额查询以及提现手续费查询等接口。
servers:
  - url: https://openplatform.gateapi.io
    description: 生产环境
security: []
paths:
  /payment/open/institution/v1/pay/withdraw/query:
    post:
      tags:
        - withdraw
      summary: 提现订单状态查询
      description: 根据批次 ID 和明细状态查询提现批次及子单详情。
      operationId: queryWithdrawBatch
      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'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WithdrawQueryRequest'
            examples:
              default:
                summary: 默认示例
                value:
                  batch_id: '237394559478075555'
                  detail_status: ALL
      responses:
        '200':
          description: 提现订单详情
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WithdrawQueryResponse'
              examples:
                success:
                  summary: 提现订单查询成功
                  value:
                    status: SUCCESS
                    code: '000000'
                    errorMessage: ''
                    data:
                      batch_id: '237394559478075350'
                      merchant_id: 10002
                      client_id: mZ96D37oKk-HrWJc
                      status: FAIL
                      create_time: 1726055849126
                      channel_id: '123456'
                      withdraw_list:
                        - id: 35
                          batch_id: '237394559478075350'
                          merchant_id: 10002
                          suborder_id: '268830764354768896'
                          chain: ETH
                          address: '0x1234567890abcdef'
                          currency: USDT
                          amount: '1'
                          fee: '0'
                          tx_id: ''
                          timestamp: 0
                          memo: Payment for services-1
                          status: FAIL
                          merchant_withdraw_id: M137394559478075550
                          err_msg: unexpected http code error
                          create_time: 1726055848856
                          update_time: 1726055856011
                          channel_id: '123456'
                          fee_type: 1
                          done_amount: '1'
                        - id: 36
                          batch_id: '237394559478075350'
                          merchant_id: 10002
                          suborder_id: '268830764354768897'
                          chain: ETH
                          address: 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa
                          currency: USDT
                          amount: '0.001'
                          fee: '0'
                          tx_id: ''
                          timestamp: 0
                          memo: Payment for services-1
                          status: FAIL
                          merchant_withdraw_id: M137394559478075551
                          err_msg: unexpected http code error
                          create_time: 1726055848856
                          update_time: 1726055856010
                          channel_id: '123456'
                          fee_type: 1
                          done_amount: '0.001'
components:
  parameters:
    X-GatePay-Certificate-ClientId:
      name: X-GatePay-Certificate-ClientId
      in: header
      required: true
      description: 商户客户端ID，在 GatePay 平台申请获得
      schema:
        type: string
        example: 4186d0c6-6a35-55a9-8dc6-5312769dbff8
    X-GatePay-Signature:
      name: X-GatePay-Signature
      in: header
      required: true
      description: HMAC-SHA256签名，用于验证请求合法性
      schema:
        type: string
        example: >-
          672d5650dcc9bb22ebf25fa16c28d03c0e159d742a9176d4340a5da326d75dc8a2ec24c97fa6fc5d1533dd6e968863747e1d86a45e562cbe899f9ed7e9ca7f77
    X-GatePay-Timestamp:
      name: X-GatePay-Timestamp
      in: header
      required: true
      description: 时间戳（毫秒），与服务器时间差不能超过5分钟
      schema:
        type: string
        example: '1672905655498'
    X-GatePay-Nonce:
      name: X-GatePay-Nonce
      in: header
      required: true
      description: 随机数，用于防止重放攻击
      schema:
        type: string
        example: '3525756760'
  schemas:
    WithdrawQueryRequest:
      type: object
      description: 提现订单查询请求体。
      properties:
        batch_id:
          type: string
          description: 由商户侧在 `/v1/pay/withdraw` 生成的唯一批次 ID。
        detail_status:
          type: string
          description: |-
            接口查询状态
            ALL 全部子订单
            INIT 新建子订单
            PENDING 待处理子订单
            PROCESSING 已提交提现请求，待确认子订单
            CHECK 审核中子订单
            FAIL 失败子订单
            DONE 提现成功子订单
      required:
        - batch_id
        - detail_status
    WithdrawQueryResponse:
      type: object
      description: 提现订单查询响应体。
      properties:
        status:
          type: string
          description: SUCCESS 或者 FAIL
        code:
          type: string
          description: 出错代码
        errorMessage:
          type: string
          description: 错误信息
        data:
          type: object
          description: 提现订单信息
          properties:
            batch_id:
              type: string
              description: 批次ID
            merchant_id:
              type: integer
              format: int64
              description: 商家ID
            client_id:
              type: string
              description: 创建订单的商户client_id
            status:
              type: string
              description: >-
                总单的状态：INIT-新建的订单状态，PROCESSING-下发订单处理中，PARTIAL-部分成功，FAIL-全部失败，SUCCESS-全部成功
            create_time:
              type: integer
              format: int64
              description: 总单创建时间
            channel_id:
              type: string
              description: 客户名称
            withdraw_list:
              type: array
              description: 子单信息
              items:
                $ref: '#/components/schemas/WithdrawSubOrder'
      required:
        - status
        - code
    WithdrawSubOrder:
      type: object
      description: 提现子订单详情。
      properties:
        id:
          type: integer
          format: int64
          description: 记录ID
        batch_id:
          type: string
          description: 商家批量提现ID
        merchant_id:
          type: integer
          format: int64
          description: 商家ID
        channel_id:
          type: string
          description: 客户名称
        suborder_id:
          type: string
          description: gatepay生成的子单ID
        chain:
          type: string
          description: gate_chain链名称
        address:
          type: string
          description: 提现地址
        currency:
          type: string
          description: 币种
        amount:
          type: string
          format: decimal
          description: 发起提现金额
        fee:
          type: string
          format: decimal
          description: 手续费
        tx_id:
          type: string
          description: 交易hash
        timestamp:
          type: integer
          format: int64
          description: 充提侧操作时间
        memo:
          type: string
          description: 转账memo等备注信息
        status:
          type: string
          description: >-
            状态：INIT-创建态，PENDING-创建态订单待处理，PROCESSING-订单处理中，CHECK-审核中，FAIL-钱包提现失败，DONE-提现成功
        merchant_withdraw_id:
          type: string
          description: 商家提现ID
        err_msg:
          type: string
          description: 发起提现失败原因
        create_time:
          type: integer
          format: int64
          description: 创建时间
        update_time:
          type: integer
          format: int64
          description: 更新时间
        fee_type:
          type: integer
          description: 0-金额为扣款金额，1-金额为到账金额
        done_amount:
          type: string
          format: decimal
          description: 到账金额。

````