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

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

    <ParamField path="title" type="string" required>
      **Title** — A descriptive name for this transaction route (max 50 characters).
    </ParamField>

    <ParamField path="description" type="string">
      **Description** — An optional description of the route's purpose (max 250 characters).
    </ParamField>
  </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:

    <ParamField path="description" type="string">
      **Description** — A description of this operation route's purpose.
    </ParamField>

    <ParamField path="operationType" type="enum" required>
      **Operation Type** — The accounting direction for this route:

      * `Source` — Identifies accounts where funds originate (debit side)
      * `Destination` — Identifies accounts where funds are sent (credit side)
      * `Bidirectional` — Applies to both sides of the transaction

      <Warning>The operation type cannot be changed after creation.</Warning>
    </ParamField>

    <ParamField path="account.ruleType" type="enum">
      **Validation Type** — How accounts are validated:

      * `Account Type` — Select one or more account types from the dropdown
      * `@Alias` — Enter a specific account alias (e.g., `@treasury_main`)

      <Note>If left empty, no account validation is applied — any account can be used in this operation route.</Note>
    </ParamField>

    <ParamField path="account.validIf" type="string | array">
      **Account Type or Alias** — Depends on the selected Validation Type:

      * If **Account Type**: Select one or more account types
      * If **Alias**: Enter the account alias to validate against

      <Note>If left empty, no account validation is applied — any account can be used in this operation route.</Note>
    </ParamField>
  </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>

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