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

# Context Sources

> Configure where transaction data comes from and how it connects to a reconciliation context for accurate matching.

Use the **Sources** section in the Matcher module to configure and manage data sources for reconciliation. Each source defines where transaction data comes from and how it connects to a reconciliation context. Sources are managed from within a context's detail page.

## Accessing the Sources section

***

<Steps>
  <Step>
    Navigate to **Reconciliation → Contexts** in the left sidebar.
  </Step>

  <Step>
    Select a context from the list to open its detail page.
  </Step>

  <Step>
    Scroll to the **Data Sources** section.
  </Step>
</Steps>

<Note>
  The global **Context Switcher** in the sidebar lets you change the active reconciliation context at any time.
</Note>

## Sources list

***

The table lists all data sources configured for the selected context. Each source shows its name, type, and available actions.

## Creating a source

***

<Steps>
  <Step>
    In the **Data Sources** section of the context detail page, click the **New Source** button.
  </Step>

  <Step>
    A side panel opens. Fill in the source details:

    | Field                      | Description                                                                                                                                                                       |
    | -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
    | **Source Name** (required) | A descriptive name for the source                                                                                                                                                 |
    | **Source Type** (required) | The source type: `LEDGER`, `BANK`, `GATEWAY`, or `CUSTOM`                                                                                                                         |
    | **Config (JSON)**          | Optional JSON object with source-specific connection settings (e.g., `{"accountId": "123", "region": "us-east-1"}`)                                                               |
    | **Mapping (JSON)**         | Optional JSON object that maps source data fields to standard reconciliation fields (e.g., `{"amount": "entry.amount", "currency": "entry.currency", "date": "entry.settledAt"}`) |

    <Note>
      Both the **Config** and **Mapping** fields must be valid JSON objects if provided.
    </Note>
  </Step>

  <Step>
    Click **Save Source** to create the source.
  </Step>
</Steps>

## Source types

***

| Type        | Description                               |
| ----------- | ----------------------------------------- |
| **LEDGER**  | Data from a Midaz ledger                  |
| **BANK**    | Data from a bank or financial institution |
| **GATEWAY** | Data from a payment gateway               |
| **CUSTOM**  | Data from a custom integration            |

## Editing a source

***

Click the edit icon next to a source to open the edit panel. Update the fields as needed and click **Update Source**.

## Deleting a source

***

Click the delete icon next to a source and confirm the deletion. Sources linked to active reconciliation runs cannot be deleted.
