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

# Settlement templates

> Define a reusable split + fee configuration that can be instanced for many merchants.

A **settlement template** is a reusable, versioned configuration with two parts:
the **split rules** (who gets what) and the **fee configuration** (MDR, service
charge, tax). Create and manage templates under **Finance → Disbursement →
Templates** in the klikit dashboard.

## Create a template

The form has three sections, mirroring the money model in
[Concepts](/disbursement/concepts):

<Steps>
  <Step title="Basic information">
    Name, currency (ISO 4217 — carried through everywhere, never assumed), and an
    optional description.
  </Step>

  <Step title="Split rules">
    Add each party with a **role** (`merchant`, `klikit`, or `other`) and a
    **share** entered as a percent. The dashboard shows a running total and blocks
    save until it is exactly **100.00%**. There must be exactly one `merchant`
    and at most one `klikit`.
  </Step>

  <Step title="Fee configuration">
    MDR (%), service charge (percentage or fixed amount), fee bearer
    (merchant/klikit), and tax — rate, base (fees/gross), mode (include/exclude),
    and payer (merchant/klikit).
  </Step>
</Steps>

Percentages are stored as integer basis points and amounts as minor units — the
dashboard converts for display only.

## Preview the split

Before saving, enter a sample gross amount and **Preview** to see the exact
computed breakdown (MDR, service charge, fee, tax, distributable pool, and each
party's share). This runs the real engine, so what you see is what a batch will
produce.

## Versioning

Editing a template's config **bumps its version**. Instances resolve against the
template's live config, but any batch that has already computed keeps its own
frozen snapshot — so editing a template never changes a computed batch.

## Archiving

Archive a template to stop new instances/edits from using it. Instances already
bound keep working off their stored config.

## The config shape

Templates store a portable, versioned `SettlementConfigV1` JSON:

```jsonc theme={null}
{
  "schema_version": 1,
  "parties": [
    // Σ split_bps must equal 10000; exactly one role=merchant; ≤1 role=klikit
    { "id": "p_merchant", "name": "Merchant", "role": "merchant", "split_bps": 9000 },
    { "id": "p_klikit",   "name": "klikit",   "role": "klikit",   "split_bps": 1000 }
  ],
  "fees": {
    "mdr_bps": 150,
    "service_charge": { "type": "percentage", "value": 100 }, // bps, or minor units if "fixed"
    "fee_bearer": "merchant",
    "tax_rate_bps": 1100,
    "tax_base": "fees",     // fees | gross
    "tax_mode": "include",  // include | exclude
    "tax_payer": "merchant" // merchant | klikit
  }
}
```
