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

# Layout templates

> Define fixed-width file layouts, such as CNAB layouts, as record types and byte ranges, then select them as the file format when you upload data.

The **Layout Templates** screen in the Matcher module of Lerian Console holds your fixed-width file layouts. In a fixed-width file, such as a CNAB file, each line is a record with a fixed length. Each field is a byte range in the record. A layout template tells Matcher where each field starts and how long it is.

## Accessing the Layout Templates page

***

Navigate to **Settings → Layout Templates**.

## Templates table

***

| Column | Description |
| - | - |
| **Format key** | The key of the template. It combines the region, the family, and the variant. Click it to open the template |
| **Variant key** | The variant of the template |
| **Record types** | The number of record types in the layout |
| **Created At** | The date and time of the template creation |

## Creating a template

***

Click **New template**. The **New layout template** page opens.

### Template fields

| Field | Description |
| - | - |
| **Region** | A two-letter region code, such as `BR`, or `XX` for no region |
| **Family** | The format family, such as `cnab240` or `cnab400` |
| **Variant** | A lowercase name for the bank or brand layout. Use letters, digits, `-`, and `_` |
| **Discriminator start byte** | The zero-based position of the bytes that identify the record type |
| **Discriminator length** | The number of bytes that identify the record type |
| **Required field names (optional)** | Field names that the layout must declare. Separate the names with commas |

### Record types

Each record type is a card. Click **Add record type** to add a card. Click **Remove** to delete a card.

| Field | Description |
| - | - |
| **Record-type value** | The value in the discriminator bytes that identifies this record type |
| **Record width (bytes)** | The fixed length of a record of this type |

Each record type has one or more fields. Click **Add a field** to add a field row:

| Field | Description |
| - | - |
| **Name** | The field name |
| **Start byte** | The zero-based position where the field starts |
| **Length** | The number of bytes in the field |
| **Kind** | `string`, `decimal (money)`, or `date`. A field named `amount` must use `decimal (money)` |

Matcher maps fields named `external_id`, `amount`, `currency`, `date`, and `description` to the transaction fields with the same names. It keeps all other fields as transaction metadata. If a layout has no `currency` field, Matcher uses `BRL`.

The form shows **Byte-layout problems** when two fields in a record type overlap. It also shows them when a field ends after the record width. Matcher does not save a layout with these problems.

Click **Submit template** to save. The template page opens.

## Using a template

***

To use a template, upload a file on **Operate → New Reconciliation**. In the **Format** select, choose the format key of the template. The select lists your templates in the **Layout Templates** group. For the upload steps, see [Uploading reconciliation data](/en/products/matcher/ui/uploading-reconciliation-data).

## Template details

***

Click a format key in the table to open the template. The page shows two cards:

* **Template identity**: the **Format key**, **Region**, **Family**, and **Variant**.
* **Registration**: the **Variant key**, the number of **Record types**, the **Discriminator** byte range, and the creation date.

The **Byte layout** section has one card for each record type. Each card shows the record width and a table of fields with **Name**, **Byte range**, **Length**, and **Kind**.

## Editing a template

***

Click **Edit** on the template page. The **Edit layout template** page opens with the current values. Click **Save changes** to replace the stored layout. This change does not create a copy. Matcher validates the full layout again before it saves the change.

## Duplicating a template

***

Click **Duplicate as new** on the template page. The **New layout template** page opens with the values of the template. Change the values, then click **Submit template** to save a separate template.

## Deleting a template

***

Click **Delete** on the template page. In the **Delete layout template?** dialog, click **Delete**. Matcher removes the template and frees its format key for a new template. You cannot undo this action.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.