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

# Batches & bank file

> Run a period's disbursement: feed gross inputs, compute the split, review, approve, and export the bank file.

A **batch** is a period's disbursement run for one template. It moves through a
strict, audited lifecycle. Run batches under **Finance → Disbursement →
Batches**.

## Lifecycle

```
draft → computed → approved → exported
                 ↘ voided ↙
```

<Steps>
  <Step title="Create (draft)">
    Pick a template, a period, and a label. The batch scopes exactly one
    template — one currency, one config snapshot, one clean file.
  </Step>

  <Step title="Load inputs">
    Feed gross amounts, one per merchant (business/brand). Sources:

    <CardGroup cols={2}>
      <Card title="Manual" icon="table-cells">
        Pick a **business** and **brand** (searchable) and type the gross amount.
      </Card>

      <Card title="CSV upload" icon="file-csv">
        Columns `business_id, [brand_id], [merchant_name], gross_amount, currency`.
        Duplicate merchants are aggregated; bad rows are rejected with line numbers.
      </Card>
    </CardGroup>

    <Note>The **Settlements** source (pull gross from settlement data) is deferred — coming later.</Note>
  </Step>

  <Step title="Compute">
    The engine matches each input to an active instance (brand-exact, then
    business-level), runs the split, and writes one line per party. The config is
    frozen onto the batch at this moment.
  </Step>

  <Step title="Review">
    The review table shows each line's merchant, party, gross, MDR, service
    charge, tax, net, and any [flags](/disbursement/concepts#line-flags), plus
    batch totals.
  </Step>

  <Step title="Approve">
    A second person (with `disburseit.finance.approve`, distinct from the
    creator) approves. Approval is **blocked while unresolved flags exist** unless
    explicitly acknowledged.
  </Step>

  <Step title="Export">
    Download the bank file for the approved batch. The first download stamps the
    batch **exported**; re-downloads are allowed.
  </Step>
</Steps>

## Replacing inputs

Replacing a computed batch's inputs resets it to **draft** and wipes its
computed lines — so you always review a fresh computation.

## Export formats

* **Generic CSV** — `bank_code, account_number, account_name, amount, currency,
  reference, merchant_name`. Excludes klikit-role lines, lines missing bank
  details, and negative nets (all surfaced as flags in review).
* **BCA** — a labelled **placeholder** (delegates to generic) until the real BCA
  batch spec is supplied. The UI badges it "not for bank submission".

## Rules

* An **exported** batch can never be voided (money may have moved; the record is
  permanent).
* Draft/computed batches can be voided by an operator; an approved batch can be
  voided only by an approver.
* The beneficiary bank details are snapshotted onto each line at compute, so a
  later bank edit can't redirect an approved batch.
