Skip to main content
The Accounting section is where you define optional rules for transactions. You do this through Accounting Routes. An Accounting Route is a reusable rule for one kind of transaction, such as a Pix transfer, a card purchase, or a fee charge. Each route answers three questions:
  • Which accounts can act on the source side?
  • Which accounts can act on the destination side?
  • Which debit and credit entries does the route post when the transaction runs?
Example. A Pix transfer route can require a customer account on the source side and a merchant account on the destination side. The route then defines direct debit-and-credit entries between them. When route validation is enabled, a Pix transaction that references the route validates the accounts and applies the configured rules. Accounting Routes provide optional route validation. Midaz enforces them only when the Ledger setting accounting.validateRoutes is enabled (default false). When enabled, transactions must reference valid routes and operations must match configured rules. Routes are easier to model when you already know which accounts represent customers, treasury, fees, settlement, revenue, and expenses.

How the pieces fit together


How accounts, account types, and accounting routes fit together so a transaction request is validated and posted as debit-and-credit entries

Choosing the operation type


Use Source for accounts where value originates.Example: a customer account can send funds in a payment flow.
Use Destination for accounts where value lands.Example: a merchant account can receive funds in a payment flow.
Use Bidirectional when the same account class can send and receive.Example: checking accounts can transfer value to other checking accounts.
A route must include a Source and a Destination operation route, or at least one Bidirectional operation route.

Choosing the validation rule


An Operation Route can optionally include an account rule—registered Account Types or an @Alias. Midaz enforces a present rule when route validation is enabled. Use Account Type validation for scalable flows. Use alias validation for fixed operational accounts, such as treasury, fee, settlement, or suspense accounts.

Common route patterns


Customer to merchant

Use separate Source and Destination routes when each side has a different role.

Peer-to-peer transfer

Use a Bidirectional route when the same account type can be both source and destination.

Fee collection

Use a Destination route with alias validation when fees must always land in one operational account.

Accounting scenarios


Do not enable route validation in Ledger settings until the required routes exist. If you enable it without matching routes, transactions fail validation.

Available pages


Setting up accounting in the Console

A step-by-step, Console-first guide to building your accounting model — from chart of accounts to a working Pix payment, no API calls required.

Manage Accounting Routes

Configure accounting routes with operation rules and accounting scenarios in a unified wizard.