Skip to main content
Disbursement and interest accrual reach the , and so does a prepayment that settles a Brazilian loan account against a prepayment quote. Lender’s accounting layer is how they get there: a product declares its posting rules once, and from then on each of those events books 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:
  • The intent commits with the state change — both land in one database transaction, through 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


An accrual run recognizes interest and the other time-based amounts. One run takes each loan whose anniversary falls on the run’s business date, and produces the postings for it. POST /api/v1/accrual-runs starts a run. Lender selects the candidate loan accounts itself, recognizes interest per account, and writes one posting intent per recognition.
Recognition is idempotent per loan account, per accounting month, and per amount kind. A run started twice for the same month recognizes interest once.

Journal references


Each accrual run records a journal reference — the run’s own accounting identifier. The reference record also stores the correlation id that Lender derived for the run. The journal reference id identifies one run exactly; a read by correlation id returns the most recent run that shares that mode, business date, and product scope.

Next steps


Jurisdictions

See how the active jurisdiction shapes disclosures and endpoints.

Brazil regulatory pack

Layer CET, IOF, and PDD staging on top of the accounting model.