# Query account balance

> Query the account balance details for a single currency.

```yaml
openapi: 3.1.0
info:
  title: Query account balance
  version: 1.0.0
  description: Query the account balance details for a single currency.
paths:
  /api/v2/account/balance/query:
    post:
      summary: Query account balance
      description: Query the account balance details for a single currency.
      parameters:
        - name: apikey
          in: header
          required: true
          description: Account service API key request header assigned by Onerway. Use the
            value for the same environment as the request base URL.
          schema:
            type: string
            description: Account service API key request header assigned by Onerway. Use the
              value for the same environment as the request base URL.
        - name: x-timestamp
          in: header
          required: true
          description: Request timestamp. The gateway uses it to identify replay attempts.
          schema:
            type: string
            description: Request timestamp. The gateway uses it to identify replay attempts.
            x-onerway-constraints:
              - kind: rule
                text: The timestamp must be within 10 minutes of the server time. Both 10-digit
                  seconds and 13-digit milliseconds are accepted.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                requestId:
                  type: string
                  description: Request ID used for idempotency control and request tracing.
                onBehalfOf:
                  type: string
                  description: Sub-merchant number when a platform merchant queries on behalf of
                    its sub-merchant. The caller merchant from `apikey` must be
                    the parent merchant.
                currency:
                  type: string
                  description: Account currency to query. Use a three-letter [ISO
                    4217](https://en.wikipedia.org/wiki/ISO_4217#List_of_ISO_4217_currency_codes)
                    currency code.
              required:
                - requestId
                - currency
            examples:
              query-usd-balance:
                summary: Query the USD account balance
                value:
                  requestId: REQ-BAL-20260423-0001
                  currency: USD
      responses:
        "200":
          description: USD account balance
          content:
            application/json:
              schema:
                type: object
                properties:
                  respCode:
                    type: string
                    description: Standardized response code. `20000` indicates a successful
                      response.
                  respMsg:
                    type: string
                    description: Human-readable response message aligned with `respCode`.
                  data:
                    type: object
                    properties:
                      currency:
                        type: string
                        description: Balance currency. Read it as a three-letter [ISO
                          4217](https://en.wikipedia.org/wiki/ISO_4217#List_of_ISO_4217_currency_codes)
                          currency code.
                      paymentBalance:
                        type: string
                        description: Available Payment balance.
                      fundingBalance:
                        type: string
                        description: Funding balance.
                      pendingSettlementBalance:
                        type: string
                        description: Pending settlement balance.
                      onHoldBalance:
                        type: string
                        description: On-hold balance.
                      riskDepositAmount:
                        type: string
                        description: Risk deposit amount.
                      totalBalance:
                        type: string
                        description: Total balance for the currency.
                      status:
                        type: string
                        description: Account status returned by the account service.
                    description: Account balance details for the requested currency.
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        description: External business error code aligned with `respCode`.
                      declineCode:
                        type: string
                        description: Compatibility field that mirrors `code` for current account APIs.
                      message:
                        type: string
                        description: Human-readable error message.
                      type:
                        type: string
                        description: Standardized error category.
                      param:
                        type: string
                        description: Request parameter that caused the error, when applicable.
                      requestId:
                        type: string
                        description: Caller request id copied from body `requestId`.
                    description: Standardized error object. It is null for successful responses and
                      omitted from the JSON body.
              examples:
                query-usd-balance:
                  summary: USD account balance
                  value:
                    respCode: "20000"
                    respMsg: Success
                    data:
                      currency: USD
                      paymentBalance: "1500.00"
                      fundingBalance: "1000.00"
                      pendingSettlementBalance: "200.00"
                      onHoldBalance: "100.00"
                      riskDepositAmount: "200.00"
                      totalBalance: "3000.00"
                      status: Active
      x-onerway-lifecycle:
        phase: active
        access:
          description:
            en: Access to the Account service APIs is enabled by Onerway approval.
            zh: 账户服务 API 的访问权限需经 Onerway 审批后开通。
```
