> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lerian.studio/llms.txt
> Use this file to discover all available pages before exploring further.

# Managing Accounting Routes

> Manage Accounting Routes in the Console — create, edit, or delete Source, Destination, and Bidirectional operation routes and accounting scenarios.

Use the **Midaz Module** to manage **Accounting Routes**, the configuration for transaction routing in Midaz. A guided wizard walks you through three steps: define the transaction route, add the operation routes, and review the setup.

An Accounting Route defines the full routing logic for a transaction. It has three parts:

* The transaction-level metadata — the title and description.
* The operation routes — they set which accounts participate and in which direction.
* The accounting scenarios — they control how the ledger records entries for each transaction type.

<Card title="Accounting rules" icon="route" href="/en/midaz/console/mc-accounting">
  Start here if you need to decide whether to use Source, Destination, Bidirectional, Account Type validation, alias validation, Direct, Two-Step, or Reversal scenarios.
</Card>

For technical details on the underlying entities, refer to the [Accounting Routes entities](/en/midaz/transaction-routing-entities) page.

## Key concepts

***

### Operation route types

Each operation route within an Accounting Route has one of three types:

* **Source** — Defines validation rules for accounts where funds originate (debit side)
* **Destination** — Defines validation rules for accounts that receive funds (credit side)
* **Bidirectional** — Applies to both sides of the transaction as both source and destination

<Note>
  A valid Accounting Route requires at least one source and one destination operation route, or at least one bidirectional route.
</Note>

<Tip>
  A bidirectional route works as both source and destination. Midaz matches it on **both** sides when you create a transaction. It appears in both the source and the destination route lists, so a single route can cover both ends of a flow.
</Tip>

### Validation types

Each operation route validates accounts by one of two methods:

* **Account Type** — Validates against one or more account type categories (e.g., `checking`, `savings`). Use when any account of a certain type is valid.
* **@Alias** — Validates against a specific account alias (e.g., `@treasury_main`). Use when you need to target an exact account.

### Accounting scenarios

Accounting scenarios define how the ledger records debit and credit entries for each operation route. You can configure entries for five transaction types:

* **Direct Transaction** — Standard one-step transaction. Define the debit and credit account codes and descriptions for immediate settlement.
* **Two-Step Transaction** — Transactions that go through a hold-then-commit cycle. Configure entries for:
  * **Hold (Value Reserve)** — Entries recorded when the ledger reserves funds
  * **Commit (Reservation Confirmation)** — Entries recorded when you confirm the reservation
  * **Cancel (Reservation Cancellation)** — Entries recorded when you cancel the reservation
* **Reversal** — Entries recorded when you reverse a completed transaction
* **Overdraft** — Entries recorded when a debit exceeds the account's available funds and draws on an overdraft line. Available for Source and Bidirectional operation routes, and requires both debit and credit entries on every supported route type. When you enable it, Midaz also enables the Direct scenario.
* **Block/Unblock** — Entries recorded when you hold and release funds on the account's balance. The scenario tab label is **Block**. Available for all operation route types.

Each scenario entry includes an **Account Code** and a **Description** for both the debit and credit sides.

<Tip>
  The available entry sides depend on the operation route type and the scenario phase. The general rule is:

  * **Source** — Debit entries in Direct, Hold, Commit, and Cancel. Credit entries only in Hold and Cancel.
  * **Destination** — Credit entries only, in Direct and Commit. Hold and Cancel are not available.
  * **Bidirectional** — Both debit and credit entries in all phases, including Reversal.
  * **Block/Unblock** — Available for all route types. It holds and releases funds on the account's balance.
</Tip>

## Accessing the Accounting Routes page

***

<Info>
  The **Accounting Routes** menu appears only when you enable the **Validate Routes** setting for the current Ledger. To enable it, open the Ledger details, go to the **Settings** tab, and toggle the **Validate Routes** switch.
</Info>

<Warning>
  **Accounting Routes validation disabled** — If you open this page by URL while **Validate Routes** is off, a banner appears at the top of the screen. The Ledger does not yet process the accounting routes registered here. Entries follow these rules only after you enable **Validate Routes** in the Ledger settings. You can still view and edit routes, but they have no effect until you enable validation.
</Warning>

To open the **Accounting Routes** page, select **Accounting Routes** in the **Accounting** section of the left sidebar menu.

The **Accounting Routes** page displays your routes for the current Ledger as a **card-accordion list**. Each transaction route is a collapsible card. The card shows its title, transaction route ID, and an operation-count badge.

Expand a card to view its operation routes. Each one shows its ID, title, code, and operation type. The Console color-codes operation types: **source** in red, **destination** in green, and **bidirectional** in gray. A route with no operation routes appears as a static (non-expandable) card.

### Available actions

From the **Accounting Routes** page, you can:

<Columns cols={2}>
  <Card title="Create an Accounting Route" icon="plus" horizontal href="/en/midaz/console/creating-an-accounting-route">
    Define a new transaction route with operation routes and accounting scenarios.
  </Card>

  <Card title="Edit an Accounting Route" icon="pen" horizontal href="/en/midaz/console/editing-an-accounting-route">
    Modify an existing accounting route and its operation routes.
  </Card>
</Columns>

## Common use cases

***

<AccordionGroup>
  <Accordion title="Pix transfers">
    Create an Accounting Route with a bidirectional operation route that validates `checking` and `savings` account types. Enable Direct Transaction scenarios with the appropriate chart of accounts codes for Pix settlement entries.
  </Accordion>

  <Accordion title="Two-step payment authorization">
    Create an Accounting Route with separate source and destination routes. Enable Two-Step Transaction scenarios to record the hold (reservation), commit (confirmation), and optional cancel (cancellation) entries independently.
  </Accordion>

  <Accordion title="Treasury operations with reversal">
    Create an Accounting Route with a bidirectional operation route that uses alias validation (`@treasury_main`). Enable both Direct Transaction and Reversal scenarios to handle standard movements and their reversals. Reversal entries require a bidirectional route.
  </Accordion>
</AccordionGroup>

## Best practices

***

<Steps>
  <Step title="Use descriptive titles">
    Name your Accounting Routes clearly to indicate the type of transaction they handle (e.g., `Pix Transfer Route` instead of `Route 1`).
  </Step>

  <Step title="Choose the right operation type">
    Use **Bidirectional** when the same validation rules apply to both sides. Use separate **Source** and **Destination** routes when each side has different account requirements.
  </Step>

  <Step title="Configure accounting scenarios early">
    Define your chart of accounts entries during route creation. This ensures that transactions processed through the route produce correct accounting records from the start.
  </Step>

  <Step title="Review before confirming">
    The wizard includes a Review step. Use it to verify all operation routes, validation rules, and accounting entries before you create the route.
  </Step>
</Steps>
