/account/balance-partner Account Balance Query API
Background
The partner sends the primary merchant number in X-Merchant-Id. subMerchantNo is an optional parameter, and the endpoint always returns results as a list:
- When
subMerchantNois provided, only the account information of that sub-merchant is returned; the list contains a single record. - When
subMerchantNois omitted, the endpoint queries, with pagination, the account balances of all sub-merchants under the primary merchant; the returned list also includes the primary merchant's own account balance, and each record is identified by the merchant numbermerchantNo.
The endpoint is rate-limited to 60 QPS by default.
Endpoint
| Item | Value |
|---|---|
| Method | GET |
| Path | /account/balance-partner |
| Content-Type | application/json |
| Purpose | Query, with pagination, the account balances of the primary merchant and its sub-merchants, or query the account balance of a specified sub-merchant |
Access Requirements
Request Fields
For authentication headers, see Authentication; they are not listed in the table below.
| Field | Location | Type | Required | Description |
|---|---|---|---|---|
subMerchantNo | Query | string | No | Sub-merchant number to query, up to 64 characters; it must belong to the partner identified by X-Merchant-Id. When omitted, the endpoint queries, with pagination, the account balances of all sub-merchants under the primary merchant (including the primary merchant itself). |
limit | Query | int | No | Number of records per page; minimum 1, maximum 100, default 10. |
id | Query | string | No | Pagination cursor that marks the page position, up to 64 characters. To page, use the full URL provided in data. / data. of the response instead of constructing it yourself. |
direction | Query | string | No | Pagination direction: next (next page) or previous (previous page), default next. |
This endpoint has no request body. The (request-target) line in the canonical string must include the raw query string exactly as sent; Digest is still computed over an empty byte string.
Pagination Behavior
- Cursor-based pagination is more efficient and more consistent than offset-based pagination when the underlying data set changes.
- First request: omit the
idanddirectionparameters. - Next page: use the full URL provided by the
data.field in the response.next - Previous page: use the full URL provided by the
data.field in the response.previous
Request Example
Example 1: Query the balances of all sub-merchants with pagination (including the primary merchant itself, first page)
GET /account/balance-partner?limit=10 HTTP/1.1
Host: api.example.com
X-Merchant-Id: 92315566000120
X-Timestamp: 1787011200
X-Nonce: a9f3c1d47e8b9a2c4d1f9e8a7b6c5d4e
Digest: SHA-256=47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=
Authorization: Signature keyId="v1",alg="ES256",headers="(request-target) x-timestamp x-nonce digest",signature="<BASE64_SIGNATURE>"Example 2: Query the balance of a specified sub-merchant
GET /account/balance-partner?subMerchantNo=24922653000123 HTTP/1.1
Host: api.example.com
X-Merchant-Id: 92315566000120
X-Timestamp: 1787011200
X-Nonce: b8e2d0c39f7a8b1d3c2e1f0a9b8c7d6e
Digest: SHA-256=47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=
Authorization: Signature keyId="v1",alg="ES256",headers="(request-target) x-timestamp x-nonce digest",signature="<BASE64_SIGNATURE>"Example 3: Jump to the next page
GET /account/balance-partner?limit=10&id=24922653000123&direction=next HTTP/1.1
Host: api.example.com
X-Merchant-Id: 92315566000120
X-Timestamp: 1787011200
X-Nonce: c7d1e0f28a6b9c0d2e3f4a5b6c7d8e9f
Digest: SHA-256=47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=
Authorization: Signature keyId="v1",alg="ES256",headers="(request-target) x-timestamp x-nonce digest",signature="<BASE64_SIGNATURE>"Response Fields
The endpoint uses the standard status, msg, and data response structure. The account balance list and the pagination cursors are located in data.
Pagination Fields
| Field | Type | Always Returned | Description |
|---|---|---|---|
status | int | Yes | Response code |
msg | string | Yes | Corresponds to status |
data | object | On success | Pagination result; it may be omitted when the request fails at the signature verification or protocol parsing stage. |
data. | string | Yes | Full URL of the next page; null when there are no more pages, maximum length 512 characters. |
data. | string | Yes | Full URL of the previous page; null when on the first page, maximum length 512 characters. |
data. | array | Yes | List of account balances. |
data. | string | Yes | Usable balance in the currency's major unit, as a numeric string with two decimal places. |
data. | string | Yes | Balance pending settlement in the currency's major unit, as a numeric string with two decimal places. Note: the field is named frozen, but its meaning is the amount pending settlement, not frozen funds. |
data. | string | Yes | Bank account number. |
data. | string | Yes | Branch number, 4 digits. |
data. | string | Yes | Merchant number that the account belongs to, up to 64 characters; when subMerchantNo is omitted, the list contains the primary merchant's own number and the numbers of its sub-merchants. |
data. | string | Yes | Total balance in the currency's major unit, as a numeric string with two decimal places; totalBalance = balance + frozen + frozenBalance. |
data. | string | Yes | Frozen balance in the currency's major unit, as a numeric string with two decimal places; this is the truly frozen amount, unlike the pending-settlement amount named frozen. |
data. | string | Yes | Account state. See the enum below. |
data. | string | Yes | ISO 4217 three-letter account currency code, such as BRL. |
accountState Enum
| Value | Description |
|---|---|
na | Not activated. |
a | Active. |
fi | Collections prohibited. |
fo | Payouts prohibited. |
f | Frozen; both collections and payouts are prohibited. |
c | Closed. |
Response Example
{
"status": 200,
"msg": "sucesso",
"data": {
"next": "https://api.adopay.com.br/account/balance-partner?id=24922653000123&direction=next&limit=10",
"previous": null,
"results": [
{
"merchantNo": "92315566000120",
"balance": "15083884116.35",
"frozen": "100329.00",
"bankAccount": "401050",
"bankBranch": "0001",
"totalBalance": "15083984445.35",
"frozenBalance": "0.00",
"accountState": "a",
"currency": "BRL"
},
{
"merchantNo": "24922653000123",
"balance": "652.10",
"frozen": "150.00",
"bankAccount": "401050",
"bankBranch": "0001",
"totalBalance": "802.10",
"frozenBalance": "0.00",
"accountState": "a",
"currency": "BRL"
}
]
}
}