Endpoints
Check Balance
Overview
The GET /api/accounts/balances endpoint returns the authenticated account balance in the { data: [...] } format, compatible with integrations that follow the Central Bank standard.
Endpoint
GET https://api.fypay.me/api/accounts/balancesAuthentication
stringobrigatorioBearer token obtained from POST https://api.fypay.me/api/auth/token. This route does not use a client certificate.
Query parameters are accepted for compatibility but ignored: the response is always the current balance of the token's account.
Request
curl -X GET https://api.fypay.me/api/accounts/balances \
-H "Authorization: Bearer <token>"const response = await fetch('https://api.fypay.me/api/accounts/balances', {
method: 'GET',
headers: {
'Authorization': `Bearer ${token}`,
},
});
const balance = await response.json();import requests
response = requests.get(
'https://api.fypay.me/api/accounts/balances',
headers={
'Authorization': f'Bearer {token}',
}
)
balance = response.json()Response
{
"data": [
{
"eventDate": "2025-01-15T10:30:00.000Z",
"balanceAmount": {
"available": 48734.90,
"blocked": 1500.00,
"overdraft": 0
}
}
]
}Response Fields
dataarrayList of balances. Always contains a single item.
Total Balance Calculation
totalBalance = available + blockedComparison with the Standard API
Standard API (GET /api/balance) | BACEN API (GET /api/accounts/balances) |
|---|---|
grossBalance | available + blocked |
blockedBalance | blocked |
netBalance | available |
consultedAt | eventDate |
Equivalence Example
// Standard API
{
"grossBalance": 50234.90,
"blockedBalance": 1500.00,
"netBalance": 48734.90,
"consultedAt": "2025-01-15T10:30:00.000Z"
}
// BACEN API (equivalent)
{
"data": [{
"eventDate": "2025-01-15T10:30:00.000Z",
"balanceAmount": {
"available": 48734.90,
"blocked": 1500.00,
"overdraft": 0
}
}]
}Best Practices
Common Errors
| HTTP code | Cause | Solution |
|---|---|---|
| 401 | Missing Authorization header | Include Authorization: Bearer <token> |
| 401 | Invalid or expired token | Generate a new token at POST /api/auth/token |