Accounting profiles and posting rules
An accounting profile binds a product version to the ledger. It defines the posting rules — the legs that fire for each kind of financial event — and the ledger organization and ledger the resulting transactions book into. You create a profile per product:
POST /api/v1/loan-products/{id}/accounting-profiles
Posting rules are validated when the profile is created, so a product cannot go live with legs that would not balance.
Posting intents and the relay
Lender does not call the ledger inline. When a financial event happens, it persists a durable posting intent in the same database transaction that changes domain state, then a relay posts the balanced transaction to Midaz asynchronously. This is what makes bookings reliable:
- No lost postings — the intent is committed with the state change, in a transactional outbox.
- Idempotent — each posting carries a deterministic key, so retries collapse to one ledger transaction.
- Fails closed — if routing cannot resolve a non-empty ledger target, the post is refused rather than written to the wrong place.
Accrual runs
Interest and other time-based amounts are recognized by an accrual run — a batch that computes what accrued over a period across the book and produces the postings for it.
Journal references
A journal reference ties a Lender financial event to the ledger transaction that recorded it, so you can trace a posting in both directions.
| Operation | Purpose |
|---|---|
GET /api/v1/journal-references | Look up a journal reference by correlation id. |
GET /api/v1/journal-references/{id} | Read a single journal reference. |
Next steps
Portfolio and delinquency
See the accounted book in aggregate.
Brazil regulatory pack
Layer CET, IOF, and PDD staging on top of the accounting model.

