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

# 查询账户余额

> 查询账户中各币种的余额。

## 概述

本页说明 `POST /payment/open/institution/v1/balance` 接口。完整的请求参数、响应结构与示例由上方关联的 OpenAPI 定义渲染。

## 说明

* 认证方式使用 GatePay 标准签名请求头。
* 这是机构子账户余额查询接口。
* 请求体使用 JSON 数组传入需要查询的币种列表，例如 `["USDT", "BTC"]`。
* 接口路径为 `/payment/open/institution/v1/balance`。
* 通用签名规则请参见 [/global/api-reference/version/100/cn/common/securityAndSignature](/global/api-reference/version/100/cn/common/securityAndSignature)。

## 机构说明

* 请求头必须携带 `X-GatePay-On-Behalf-Of`，用于指定要查询的机构子账户。


## OpenAPI

````yaml global/api-reference/version/100/cn/openapi/institution/common-openapi.json POST /payment/open/institution/v1/balance
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:
  /payment/open/institution/v1/balance:
    post:
      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'
        - $ref: '#/components/parameters/X-GatePay-On-Behalf-Of'
      requestBody:
        required: true
        description: 要查询的币种列表。
        content:
          application/json:
            schema:
              type: array
              items:
                type: string
              example:
                - USDT
                - BTC
            examples:
              currencies:
                summary: 查询指定币种余额
                value:
                  - USDT
                  - BTC
      responses:
        '200':
          description: 查询成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BalanceQueryResponse'
              examples:
                successResponse:
                  summary: 成功响应
                  value:
                    status: SUCCESS
                    code: '000000'
                    errorMessage: ''
                    data:
                      balanceList:
                        - currency: DOGE
                          available: '1843.32095'
                        - currency: FORG
                          available: '3.02'
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: 毫秒级时间戳，与服务端时间偏差不得超过30秒
      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:
    BalanceQueryResponse:
      type: object
      properties:
        status:
          type: string
          description: SUCCESS 或者 FAIL
          enum:
            - SUCCESS
            - FAIL
          example: SUCCESS
        code:
          type: string
          description: 出错代码
          example: '000000'
        errorMessage:
          type: string
          description: 错误信息
          example: ''
        data:
          type: object
          properties:
            balanceList:
              type: array
              description: 余额列表
              items:
                $ref: '#/components/schemas/BalanceItem'
    BalanceItem:
      type: object
      properties:
        currency:
          type: string
          description: 币种
          example: DOGE
        available:
          type: string
          description: 币种在商户现货账户中的余额
          example: '1843.32095'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.