Payments & states
The database is authoritative for session state. UI events do not confirm received money.
Available flow
- Your backend creates a checkout session.
- The payer reviews amount, network, and personal details.
- The browser creates a sandbox operation with an idempotency key.
- The API returns
sandbox_pendingand an explicitly non-payable code. - Simulation finishes as
sandbox_completedand persists an event.
Each session has at most one payment. Changing an idempotency key cannot create a second payment.
Queries
GET /v1/payments requires payments:read. It returns up to 100 workspace payments, without documents, emails, or raw provider data.
GET /v1/metrics requires metrics:read. Financial totals count only live payments in completed state. Sandbox activity is counted separately and never contributes to settled volume.
Reserved live states
created, processing, paid, completed, expired, and failed belong to the operational plan. paid (Pix received) and completed (crypto settled) are not equivalent. The live state machine and reconciliation need provider validation before exposure.
Amounts
BRL is stored as integer cents. Digital assets will require integer units with asset-specific precision. Never maintain a financial balance from floating-point values or a UI quote.