Skip to main content
Every financial event in a credit journey ends up in the . Lender’s accounting layer is how it gets there: a product declares its posting rules once, and from then on disbursements, repayments, accruals, and reversals all book automatically and traceably.

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.
The full path is described in Lender in the platform.

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.
1

Start a run

POST /api/v1/accrual-runs queues an accrual run.
2

Retry if needed

POST /api/v1/accrual-runs/{id}/retry re-queues the items of a run that did not complete, without re-accruing what already succeeded.

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.
OperationPurpose
GET /api/v1/journal-referencesLook up a journal reference by correlation id.
GET /api/v1/journal-references/{id}Read a single journal reference.
Reconcile Lender against the ledger by correlation id: a journal reference points at the exact Midaz transaction a repayment or accrual produced.

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.