Why mock Open Finance instead of using the official sandbox
Open Finance Brasil is the Central Bank-regulated standard for sharing financial data between institutions, with the user's explicit consent. Integrating for real requires credentialing in the participant directory, mTLS certificates and a full OAuth 2.0 flow — a process that takes weeks, not something you want to wait for just to build your app's consent screen.
This guide shows the general endpoint pattern of Open Finance Brasil (public, documented at openfinancebrasil.org.br) — not any specific institution's API, since each participant implements the standard with its own URLs and credentialing.
1. Consent flow
// Mock Rule: POST /open-banking/consents/v2/consents → 201
{
"data": {
"consentId": "urn:examplebank:C1DD33123",
"status": "AWAITING_AUTHORISATION",
"statusUpdateDateTime": "{{now}}",
"permissions": ["ACCOUNTS_READ", "ACCOUNTS_BALANCES_READ", "ACCOUNTS_TRANSACTIONS_READ"]
}
}
2. Accounts and balances
// Mock Rule: GET /open-banking/accounts/v2/accounts → 200
{
"data": [
{ "accountId": "{{uuid}}", "brandName": "Example Bank", "type": "CONTA_DEPOSITO_A_VISTA", "accountSubType": "INDIVIDUAL" }
]
}
3. Transactions
// Mock Rule: GET /open-banking/accounts/v2/accounts/:accountId/transactions → 200
{
"data": [
{ "transactionId": "{{uuid}}", "amount": "{{faker.price}}", "transactionName": "{{faker.company}}", "type": "DEBITO" }
]
}
Combine with Faker BR to generate plausible CPF/CNPJ, names and amounts in account data, without using anyone's real data.