# Query account balance movements

> Query balance movement records for the caller merchant account or a specified sub-merchant account.

```yaml
openapi: 3.1.0
info:
  title: Query account balance movements
  version: 1.0.0
  description: Query balance movement records for the caller merchant account or a
    specified sub-merchant account.
paths:
  /api/v2/account/transactions/query:
    post:
      summary: Query account balance movements
      description: Query balance movement records for the caller merchant account or a
        specified sub-merchant account.
      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. If omitted, the query uses the merchant
                    account associated with the `apikey`. When provided, the
                    caller merchant from `apikey` must be the parent merchant.
                currency:
                  type: string
                  description: Optional transaction currency filter. Use a three-letter [ISO
                    4217](https://en.wikipedia.org/wiki/ISO_4217#List_of_ISO_4217_currency_codes)
                    currency code.
                balanceType:
                  type: string
                  description: Optional balance type filter.
                  enum:
                    - PAYMENT
                    - FUNDING
                    - PENDING_SETTLEMENT
                    - ON_HOLD
                    - RISK_DEPOSIT
                  x-enum-descriptions:
                    PAYMENT: Payment balance.
                    FUNDING: Funding balance.
                    PENDING_SETTLEMENT: Pending settlement balance.
                    ON_HOLD: On hold balance.
                    RISK_DEPOSIT: Risk deposit balance.
                acntTxnId:
                  type: string
                  description: Optional exact-match filter for the account transaction ID. Numeric
                    string is expected.
                beginTime:
                  type: string
                  description: Inclusive start of the query range, filtered by `balanceUpdDate`.
                  x-onerway-constraints:
                    - kind: rule
                      text: Use an ISO-8601 timestamp with timezone offset, for example
                        `2026-07-20T00:00:00+08:00`.
                endTime:
                  type: string
                  description: Inclusive end of the query range, filtered by `balanceUpdDate`.
                  x-onerway-constraints:
                    - kind: consistency
                      text: "`endTime` cannot be earlier than `beginTime`."
                    - kind: range
                      max: 31
                      unit: days
                      text: The query time range cannot exceed 31 days.
                businessType:
                  type: string
                  description: Optional business type filter.
                  enum:
                    - ACQUIRING
                    - PAYOUT
                  x-enum-descriptions:
                    ACQUIRING: Acquiring business balance movement.
                    PAYOUT: Payout business balance movement.
                current:
                  type: number
                  description: Current page number. `size` is controlled by the server; use
                    `current` to paginate.
              required:
                - requestId
                - beginTime
                - endTime
            examples:
              query-transactions-by-time-range:
                summary: Query USD transactions by time range
                value:
                  requestId: REQ-TRX-20260423-0001
                  currency: USD
                  beginTime: 2026-04-01T00:00:00+08:00
                  endTime: 2026-04-23T23:59:59+08:00
                  current: 1
      responses:
        "200":
          description: Paginated USD account transactions
          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:
                      total:
                        type: integer
                        description: Total number of matched records.
                      pages:
                        type: integer
                        description: Total page count.
                      current:
                        type: integer
                        description: Current page number.
                      list:
                        type: array
                        description: Balance movement records for the selected merchant account on the
                          current page.
                        items:
                          type: object
                          properties:
                            acntTxnId:
                              type: integer
                              description: Account transaction ID that identifies one balance movement record.
                            serviceId:
                              type: integer
                              description: Transaction order number associated with the balance change.
                            currency:
                              type: string
                              description: Transaction currency.
                            balanceType:
                              type: string
                              description: Balance type affected by the transaction.
                              enum:
                                - PAYMENT
                                - FUNDING
                                - PENDING_SETTLEMENT
                                - ON_HOLD
                                - RISK_DEPOSIT
                              x-enum-descriptions:
                                PAYMENT: Payment balance.
                                FUNDING: Funding balance.
                                PENDING_SETTLEMENT: Pending settlement balance.
                                ON_HOLD: On hold balance.
                                RISK_DEPOSIT: Risk deposit balance.
                            amount:
                              type: string
                              description: Signed balance movement amount. Positive values increase the
                                balance; negative values decrease the balance.
                            balanceUpdDate:
                              type: string
                              description: Balance update time in UTC ISO-8601 format.
                            businessType:
                              type: string
                              description: Business type that triggered this balance movement.
                              enum:
                                - ACQUIRING
                                - PAYOUT
                              x-enum-descriptions:
                                ACQUIRING: Acquiring business balance movement.
                                PAYOUT: Payout business balance movement.
                            externalOrderId:
                              type: string
                              description: External order id supplied by upstream business systems, when
                                available.
                            remark:
                              type: string
                              description: Human-readable remark for the transaction.
                    description: Paginated balance movement payload for the merchant account
                      selected by `apikey` and optional `onBehalfOf`.
                  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-transactions-by-time-range:
                  summary: Paginated USD account transactions
                  value:
                    respCode: "20000"
                    respMsg: Success
                    data:
                      total: 50
                      pages: 3
                      current: 1
                      list:
                        - acntTxnId: 10001
                          serviceId: 20001
                          currency: USD
                          balanceType: PAYMENT
                          amount: "-100.00"
                          balanceUpdDate: 2026-04-20T10:30:00Z
                          businessType: PAYOUT
                          externalOrderId: replace_with_external_order_id
                          remark: Payout to bank account
                        - acntTxnId: 10002
                          serviceId: 20002
                          currency: USD
                          balanceType: PAYMENT
                          amount: "500.00"
                          balanceUpdDate: 2026-04-19T08:15:00Z
                          businessType: ACQUIRING
                          externalOrderId: replace_with_external_order_id
                          remark: Payment received
      x-onerway-lifecycle:
        phase: active
        access:
          description:
            en: Access to the Account service APIs is enabled by Onerway approval.
            zh: 账户服务 API 的访问权限需经 Onerway 审批后开通。
```
