direction field.
The model
Every payment order has:Direction defines the workflow
The two-step OUT flow is deliberate: outbound payments leave your balance, so a separate approval step lets you implement dual-control, fraud checks, or business-rule validation before money leaves the wallet.
Identifiers
Every payment order carries three identifiers:id
Server-assigned at creation:
ord_3KpFvBwYzNqMxA7eHbRdJ. Immutable. Use as your database key.idempotencyKey
Caller-supplied at creation. Bound to the
(wallet, idempotencyKey) tuple. Makes the create safe to retry.endToEndId
PIX-network-assigned end-to-end identifier. Populated after the provider returns it (typically on settlement).
endToEndId is what the PIX network uses. For your internal records, id is the BlooBank-side identifier and idempotencyKey is your client-side identifier.
A complete example — inbound (cash-in)
1
Generate an idempotencyKey for the invoice
Persist it locally before calling the API.
2
Create the payment order
201 Created with status: "PENDING" and the instrument populated (qrcode, copypaste, expiresAt).3
Render the QR code to your customer
The
instrument.qrcode and instrument.copypaste fields contain provider-rendered PIX payloads. Display them; the customer pays via their bank app.4
Wait for the webhook (or poll)
When the customer pays, the order transitions to
SUCCESS and a webhook fires. See Webhooks overview.5
Reconcile
The wallet balance reflects the inbound funds. The
endToEndId is now populated on the order.A complete example — outbound (cash-out)
1
Pre-flight balance check
GET /wallets/production-main/balance — verify available.value >= amount.2
Create the payment order
201 Created with status: "AWAITING_APPROVAL". No money has moved yet.3
Approve
200 OK with status: "PENDING". The order is now submitted to the PIX network. locked increases by the amount.4
Or cancel (alternative to approval)
200 OK with status: "CANCELED". The order never reaches the provider.5
Wait for completion via webhook
On settlement:
status: "SUCCESS", locked decreases, amount decreases (the funds left your wallet).Amounts
All amounts are integers in minor units:
See Amounts & currency.
Idempotency
For payment orders, always supply anidempotencyKey. Retrying without one creates a duplicate payment. The pattern:
- Persist the key in your local database before calling the API.
- Include it in the create body.
- On any network failure, retry with the same key.
- Use the API response to reconcile your local state.
Networks today
Future networks may be added (Tron, Solana, Bitcoin, Ethereum are reserved in the
ProviderNetwork enum). The direction + network + instrument.type triple determines which provider handles the order.
Next
Lifecycle
The state machine: AWAITING_APPROVAL → PENDING → PROCESSING → final.
Instrument types
The five PIX variants and when to use each.
Pix cash-in tutorial
End-to-end inbound flow.
Pix cash-out tutorial
End-to-end outbound flow with approval.