Prerequisites
Before initiating a transfer:
- The source account must be registered in the CRM
- The sender must have sufficient balance (amount + fee)
- The operation must occur on a business day, between 06:30 and 17:00 (Brasília)
Step 1: Initiate the transfer
The first step validates the data, calculates the fee, and creates a transfer intent valid for 24 hours. No funds are moved in this step. Endpoint:
POST /v1/transfers/initiate
What happens
- The client sends the transfer details (recipient, amount)
- The system validates business rules: operating hours, limits, and duplicates
- The fees service (
plugin-fees) calculates the transaction cost - A
PaymentInitiationentity is created with 24-hour expiration - The system returns the
initiationIdalong with calculated values
Headers
| Header | Required | Description |
|---|---|---|
X-Organization-Id | Yes | Organization UUID |
Authorization | Conditional | Bearer token (if authentication enabled) |
X-Idempotency-Key | No | Idempotency key (UUID v4 recommended) |
Request body
Recipient fields
| Field | Type | Required | Description |
|---|---|---|---|
ispb | String | Yes | Bank ISPB code (8 digits) |
branch | String | Yes | Branch (4 digits) |
account | String | Yes | Account number (1-20 digits) |
accountType | Enum | Yes | CHECKING, SAVINGS, SALARY, PAYMENT |
taxId | String | Yes | CPF (11 digits) or CNPJ (14 digits) |
name | String | Yes | Account holder name (1-200 characters) |
Response (200 OK)
Step 2: Confirm the transfer
After the user reviews the fee, confirm the transfer to start processing. Endpoint:
POST /v1/transfers/process
What happens
- The system validates the
initiationIdand checks if it hasn’t expired - Validates the sender’s balance and provisions the funds (amount + fee) in Midaz
- The
STR0008message is sent to JD Consultores system with digital signature - The transfer status changes to
PROCESSING - In the background, the worker awaits confirmation (
STR0008R2) from JD
Request body
Response (200 OK)
Timeline
The typical flow of a TED OUT transfer:
Error handling
4xx from JD (immediate rejection)
4xx from JD (immediate rejection)
- Immediate
CancelTransactionin Midaz (releases provision) - Status updated to
REJECTED - Webhook
transfer.failedsent - Automatic refund (amount + fee)
5xx/Timeout (transient error)
5xx/Timeout (transient error)
- Automatic retry: 5x (0s, 5s, 25s, 60s, 120s)
- Query
ConsultaNumCtrlIFto check status - If still uncertain after retries: fail-safe refund
Chargeback (STR0010R2)
Chargeback (STR0010R2)
- Return message received from destination bank
CancelTransactionorRevertTransactionin Midaz- Status:
REJECTED - Automatic refund with return code
Common error codes
| Code | HTTP | Description |
|---|---|---|
BTF-0001 | 400 | Invalid data (ISPB, negative amount) |
BTF-0010 | 403 | Outside BACEN operating hours |
BTF-0011 | 422 | Daily/monthly limit exceeded |
BTF-0012 | 409 | Duplicate transfer detected |
BTF-2001 | 422 | Insufficient balance |
BTF-1000 | 503 | JD SPB service unavailable |
Error response examples
Outside operating hours (403):Check status
Track the transfer progress: Endpoint:
GET /v1/transfers/{transferId}
Response
Cancel transfer
Transfers can be cancelled while in
CREATED or PENDING status.
Endpoint: POST /v1/transfers/{transferId}/cancel
Response (200 OK)
Common ISPB codes
Last verified: 2026-02-06. Values are subject to change.
| Bank | ISPB |
|---|---|
| Banco do Brasil | 00000000 |
| Bradesco | 60746948 |
| Itaú | 60701190 |
| Santander | 90400888 |
| Caixa Econômica | 00360305 |
| Nubank | 18236120 |
| Inter | 00416968 |

