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

# Creating an Accounting Route

> Build an Accounting Route through the guided wizard to define how Transactions and operations are routed.

Accounting Routes are created through a guided 3-step wizard that walks you through defining the transaction route, configuring operation routes with accounting scenarios, and reviewing the final configuration.

## Before you start

***

Create the Account Types and Accounts that the route will validate. If you are still deciding between Source, Destination, Bidirectional, Account Type validation, alias validation, Direct, Two-Step, or Reversal scenarios, read [Accounting rules](/en/lerian-console/midaz-console/mc-accounting) first.

<Warning>
  If **Validate Routes** is enabled for the Ledger, transactions must match an existing route. Do not enable route validation until the required Accounting Routes are ready.
</Warning>

## Step 1: Basic information

***

<Steps>
  <Step>
    From the **Accounting Routes** page, click **New Route**.
  </Step>

  <Step>
    The creation wizard opens on **Step 1 — Basic information**.
  </Step>

  <Step>
    Fill in the basic information:

    * **Title**: a descriptive name for this transaction route.
    * **Description**: an optional description of the route's purpose.
  </Step>

  <Step>
    Click **Next** to proceed to Step 2.
  </Step>
</Steps>

## Step 2: Operation Routes

***

In this step, you add and configure the operation routes that define how accounts are validated and how accounting entries are recorded.

<Steps>
  <Step>
    Click **Add Operation Route** to create your first operation route card.
  </Step>

  <Step>
    Configure the operation route:

    * **Description**: the purpose of this operation route.
    * **Operation Type**: `Source`, `Destination`, or `Bidirectional`.
    * **Validation Type**: `Account Type`, `@Alias`, or empty when no account validation is needed.
    * **Account Type or Alias**: the selected Account Type values or the specific account alias.
  </Step>

  <Step>
    *(Optional)* Configure **Accounting Scenarios** to define how entries are recorded. Toggle on the scenarios you need:

    <Tabs>
      <Tab title="Direct Transaction">
        Standard one-step transaction. Define the **Account Code** and **Description** for:

        * **Debit** — The account code debited on execution
        * **Credit** — The account code credited on execution

        <Tip>
          For Direct Transactions, which sides appear depends on the operation type. Source routes show debit only, destination routes show credit only, and bidirectional routes show both. Other scenarios may differ — see the Two-Step Transaction tab for details.
        </Tip>
      </Tab>

      <Tab title="Two-Step Transaction">
        Transactions with a hold-then-commit cycle. Configure entries for each phase:

        * **Hold (Value Reserve)** — Entries when funds are reserved
        * **Commit (Reservation Confirmation)** — Entries when the reservation is confirmed
        * **Cancel (Reservation Cancellation)** — Entries if the reservation is cancelled

        The available entry fields vary by operation type:

        * **Source** — Hold and Cancel show both debit and credit fields. Commit shows debit only.
        * **Destination** — Only the Commit phase is shown, with credit only. Hold and Cancel are not available.
        * **Bidirectional** — All phases show both debit and credit fields.
      </Tab>

      <Tab title="Reversal">
        Entries recorded when a completed transaction is reversed. Define the debit and credit account codes and descriptions for the reversal entries.

        <Note>
          The Reversal scenario is only available for **Bidirectional** operation routes.
        </Note>
      </Tab>
    </Tabs>
  </Step>

  <Step>
    *(Optional)* Click **Add Operation Route** again to add more operation routes to this Accounting Route.

    <Warning>
      You must add at least one source and one destination operation route, or at least one bidirectional route. The wizard will not proceed without a valid route configuration.
    </Warning>
  </Step>

  <Step>
    Click **Next** to proceed to Step 3.
  </Step>
</Steps>

## Step 3: Review

***

<Steps>
  <Step>
    Review the complete configuration:

    * Transaction route title and description
    * Each operation route with its type, validation rules, and accounting entries
    * Accounting scenarios with debit and credit entries per transaction type
  </Step>

  <Step>
    If anything needs to be adjusted, click **Previous** to go back.
  </Step>

  <Step>
    Click **Create Transaction Route** to create the Accounting Route.
  </Step>
</Steps>

## Field guide

***

### Basic information

| Field       | What to enter                                                         | Example                                            |
| ----------- | --------------------------------------------------------------------- | -------------------------------------------------- |
| Route Title | Required route name. Keep it short and specific to the business flow. | `Pix Transfer Route`                               |
| Description | Optional explanation of what the route validates or records.          | `Handles Pix transfers between customer accounts.` |

### Operation route

| Field                 | What to enter                                                                                                                                         | Example                               |
| --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------- |
| Description           | Purpose of this operation route card.                                                                                                                 | `Checking account validation for Pix` |
| Type                  | Accounting side this operation route applies to: `Source`, `Destination`, or `Bidirectional`. This cannot be changed after creation.                  | `Bidirectional`                       |
| Validation Type       | How accounts are validated. Use `Account Type` for account classes or `@Alias` for a specific account. Leave empty only when no validation is needed. | `Account Type`                        |
| Account Type or Alias | Account Types or aliases accepted by this operation route.                                                                                            | `customer`                            |
| Accounting Scenarios  | Transaction scenarios this route should record: Direct, Two-Step, or Reversal.                                                                        | `Direct Transaction`                  |
| Account Code          | Accounting code used in the debit or credit entry for the selected scenario.                                                                          | `1.1.1.001`                           |
| Entry Description     | Entry-level description shown in the scenario configuration.                                                                                          | `Customer checking - outbound`        |

## Quick example

***

<Accordion title="Pix Transfer with Direct and Two-Step scenarios">
  **Transaction Route**

  | Field       | Value                                                     |
  | ----------- | --------------------------------------------------------- |
  | Title       | `Pix Transfer Route`                                      |
  | Description | `Handles Pix instant transfers between checking accounts` |

  **Operation Route 1 — Bidirectional**

  | Field           | Value                                 |
  | --------------- | ------------------------------------- |
  | Description     | `Checking account validation for Pix` |
  | Operation Type  | `Bidirectional`                       |
  | Validation Type | `Account Type`                        |
  | Account Types   | `checking`                            |

  **Direct Transaction scenario**

  | Side   | Account Code | Description                    |
  | ------ | ------------ | ------------------------------ |
  | Debit  | `1.1.1.001`  | `Customer checking — outbound` |
  | Credit | `1.1.1.002`  | `Customer checking — inbound`  |

  **Two-Step Transaction — Hold**

  | Side   | Account Code | Description                   |
  | ------ | ------------ | ----------------------------- |
  | Debit  | `1.1.1.001`  | `Customer checking — reserve` |
  | Credit | `2.1.1.001`  | `Pending settlement — hold`   |

  **Two-Step Transaction — Commit**

  | Side   | Account Code | Description                    |
  | ------ | ------------ | ------------------------------ |
  | Debit  | `2.1.1.001`  | `Pending settlement — release` |
  | Credit | `1.1.1.002`  | `Customer checking — settled`  |
</Accordion>

## What to do next

***

After creating the route, create a transaction that matches the same account types, aliases, and scenario in [Creating a Transaction](/en/lerian-console/midaz-console/creating-a-transaction).

<CardGroup cols={2}>
  <Card title="Create Transaction Route" icon="code" href="/en/reference/midaz/create-transaction-route">
    Create the transaction-level route via API.
  </Card>

  <Card title="Create Operation Route" icon="code" href="/en/reference/midaz/create-an-operation-route">
    Create operation-level routing rules via API.
  </Card>
</CardGroup>
