# Query account transactions by transaction order number

> Query account balance movement records associated with one or more transaction order numbers.

```yaml
openapi: 3.1.0
info:
  title: Query account transactions by transaction order number
  version: 1.0.0
  description: Query account balance movement records associated with one or more
    transaction order numbers.
paths:
  /api/v2/account/transactions/service/query:
    post:
      summary: Query account transactions by transaction order number
      description: Query account balance movement records associated with one or more
        transaction order numbers.
      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.
                serviceIds:
                  type: array
                  description: Transaction order numbers used to locate associated balance change
                    records.
                  items:
                    type: integer
                  x-onerway-constraints:
                    - kind: range
                      min: 1
                      max: 100
                      unit: items
                      text: The list cannot be empty and can contain at most 100 transaction order
                        numbers.
              required:
                - requestId
                - serviceIds
            examples:
              query-transactions-by-service-ids:
                summary: Query transactions by transaction order numbers
                value:
                  requestId: REQ-TRX-20260423-0002
                  serviceIds:
                    - 20001
                    - 20002
                    - 20003
      responses:
        "200":
          description: Account transactions for transaction order numbers
          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:
                      list:
                        type: array
                        description: Account transaction records matching the requested `serviceIds[]`.
                        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.
                            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.
                            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: Account transactions payload matched by `serviceIds[]`.
                  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-service-ids:
                  summary: Account transactions for transaction order numbers
                  value:
                    respCode: "20000"
                    respMsg: Success
                    data:
                      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 审批后开通。
```
