What are Accounting Entries
A rubric is a mapping that tells the engine which ledger accounts to debit and credit for a given transaction action. Rather than computing accounting classifications by hand for each movement, you register rubrics once and let Midaz resolve them automatically as transactions are processed. Each rubric carries:
code— a unique identifier (the chart of accounts code, e.g.,1.1.1.001).description— a human-readable label for the entry (e.g.,Customer checking — outbound).- A set of action mappings — one entry per action type, each with its own debit and/or credit rubric.
routeCode (and routeDescription) on the operation. This gives you a complete audit trail from transaction → operation → rubric, letting teams trace exactly which accounting rule was applied to each movement.
Rubrics are configured per action on each Operation Route. Source routes require the debit rubric, destination routes require the credit rubric, and bidirectional routes require both.
The 5 action types
Each action represents a distinct transactional event. A single rubric can map different debit/credit accounts for each action, so every stage of an operation lands on the right ledger entry.
| Action | Identifier | Description |
|---|---|---|
| Direct | direct | Immediate, single-step debit/credit between two accounts, with no intermediate stages (e.g., a fee or adjustment). |
| Hold | hold | Reserves funds by creating a pending movement (moves value from available to on_hold on the source account). |
| Commit | commit | Confirms a previously held amount, releasing the on_hold value to the destination account. |
| Cancel | cancel | Cancels/reverses a hold, returning the on_hold value to the available balance on the source account. |
| Revert | revert | Reverses a completed direct transaction by creating a counter-transaction that undoes the original. |
Configuring Accounting Entries
Rubrics are registered via the API as part of your Operation Routes — the
accountingEntries block on a route defines one entry per action, each with its debit and/or credit rubric:
Validation modes
How Midaz reacts when no matching rubric is found depends on the Ledger’s accounting settings. There are two distinct gates:
Default (graceful)
By default, if no rubric is registered for an action, the transaction proceeds normally. TherouteCode and routeDescription fields are simply left empty (nil) for that operation — no error is raised.
Strict (opt-in)
Setaccounting.validateRoutes to true in the Ledger Settings to enforce that all actions must have a registered rubric. Any operation whose action and direction has no registered mapping is rejected with error 0117 ErrAccountingRouteNotFound.
- routeCode — the
codeof the resolvedAccountingRubricfor that action and direction. - routeDescription — the description of the resolved accounting rubric, populated alongside
routeCode.

