Settlement items are the bridge between accounting records (ledger entries) and actual money movements. While ledger entries record what should happen financially, settlement items track what actually happened—when money moved, how it moved, and to where.Documentation Index
Fetch the complete documentation index at: https://docs.rinne.com.br/llms.txt
Use this file to discover all available pages before exploring further.
What are settlement items?
A settlement item is a clearing link that applies a portion (or all) of a ledger entry to a real settlement operation. Each settlement item represents an actual money movement:- PIX payment to a merchant’s bank account
- Internal transfer between accounts
- Invoice payment for monthly costs
- Boleto payment for settlements
Entity relationships
Core attributes
Each settlement item contains:- ledger_entry_id: Which ledger entry is being settled
- settled_amount: How much of the entry is being settled (in cents)
- settlement_date: When the money actually moved (date-only format: YYYY-MM-DD)
- method: How the money moved (PIX, internal transfer, etc.)
- status: Current state of the settlement
- operation_id: External reference (transaction ID, transfer ID, etc.)
- affiliation_bank_account_id: Destination bank account (if applicable)
Settlement methods
Rinne supports multiple settlement methods:PIX
Instant payments to merchant bank accounts (D+0)
Internal transfer
Transfers between Rinne accounts (organization fees)
Invoice
Monthly invoices for platform/provider costs
Boleto
Bank slip payments for settlements
Settlement status lifecycle
Settlement items follow a state machine with strict transition rules:Valid transitions
- PENDING → PROCESSING: Settlement initiated
- PENDING → PAID: Instant settlement (PIX)
- PENDING → FAILED: Settlement failed immediately
- PROCESSING → PAID: Settlement completed
- PROCESSING → FAILED: Settlement failed during processing
Terminal states
- PAID: Settlement completed successfully (no further transitions)
- FAILED: Settlement failed permanently (no further transitions)
PIX settlement flow
For PIX transactions, Rinne creates settlement items immediately after the transaction is approved:1. Transaction settlement
The main transaction amount is settled instantly:The
settlement_date field is returned in date-only format (YYYY-MM-DD) without time information, representing the calendar day when the settlement occurred.2. Organization fee settlement
Organization fees are settled via internal transfer:PAID.
3. Platform and provider costs
Platform and provider costs remain outstanding for monthly invoice settlement:Ledger entry updates
When settlement items are created or updated, the corresponding ledger entries are automatically updated:Outstanding amount calculation
Settlement status
Example progression
Initial state (after ledger entry creation):Partial settlements
Settlement items support partial settlements, where a ledger entry is settled in multiple operations:Refund settlements
Refund settlements follow the same pattern as transaction settlements:Transaction refund
Organization fee refund
Idempotency
Settlement item creation is idempotent. If settlement items already exist for a ledger entry and operation ID, Rinne skips creation:Settlement invariants
Rinne enforces strict invariants for settlement items:Settlement bounds
Outstanding accuracy
Non-negative outstanding
Settlement status consistency
Complete settlement example
Here’s a complete example showing how a R$100 PIX transaction is settled:1. Ledger entries created
2. Settlement items created
3. Ledger entries updated
Key principles
Actual movements
Track real money movements, not just accounting
State machine
Strict status transitions prevent invalid states
Race-safe
Two-step creation prevents race conditions
Idempotent
Safe to retry settlement operations
Next steps
Ledger entries
Learn about the accounting foundation
Banking
Understand banking operations

