docs
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/balances

Authentication

stringobrigatorio

Bearer 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
      }
    }
  ]
}
{
  "statusCode": 401,
  "code": "PUB_HTTP_ERROR",
  "message": "Token Bearer não fornecido",
  "userMessage": "Acesso não autorizado. Faça login novamente.",
  "errorId": "c0a8012e-7b1f-4c55-9d1e-2f9a8c3b4d5e"
}

Response Fields

dataarray

List of balances. Always contains a single item.

Total Balance Calculation

totalBalance = available + blocked

Comparison with the Standard API

Standard API (GET /api/balance)BACEN API (GET /api/accounts/balances)
grossBalanceavailable + blocked
blockedBalanceblocked
netBalanceavailable
consultedAteventDate

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 codeCauseSolution
401Missing Authorization headerInclude Authorization: Bearer <token>
401Invalid or expired tokenGenerate a new token at POST /api/auth/token

Next Steps

On this page