# Ledger

How every payment, refund and payout posts balanced, append-only double-entry entries, reconciled against the chain and the card processor and exported for finance.

<ShortProductTruth>**Books that balance by construction.** Every money movement posts to an append-only double-entry ledger, and each settlement is reconciled against the chain or the card processor.</ShortProductTruth>


## The problem it removes [#the-problem-it-removes]

Agent spend arrives as many small payments on several networks and a card processor. Without one set of books, finance reconciles by hand and corrections overwrite history. Abazi Ledger records every movement as balanced entries that are never edited, and checks each one against where the money actually moved.

## Who uses it [#who-uses-it]

| Who | How |
| --- | --- |
| Finance | Read entries and the trial balance, reconcile settlements and export CSV files. |
| Owners and admins | Read the entries behind any payment. |
| Merchants and platforms | Read the entries for their own accounts, including payouts. |

## How it works [#how-it-works]

1. **Post.** Every posting goes through one function that refuses a transaction whose debits and credits differ, or whose amounts are not positive whole numbers of the smallest unit.
2. **Payment.** A confirmed payment debits the organization's spend account and credits its funds account on that network, and credits the merchant's revenue.
3. **Never edit.** Rows are append-only. A correction is a new transaction that reverses the old one and points to it.
4. **Reconcile.** Each settlement is compared with the chain or the card processor record and marked matched, unmatched, reconciling or resolved by hand.
5. **Export.** Finance builds a CSV export in the background and downloads it for 24 hours.

**Treasury and Guarantee stay apart.** [Abazi Treasury](/docs/products/treasury) and [Abazi Guarantee](/docs/products/guarantee) post to their own section of the ledger, separate from payment activity. The trial balance is reported per section, and exports leave those rows out unless finance includes them.

## Screens [#screens]

<Screenshot id="finance-ledger" />

<Screenshot id="finance-reconciliation" />

## Boundaries [#boundaries]

| Case | What happens |
| --- | --- |
| A transaction that does not balance | Refused; nothing is written. |
| A settlement that does not match the chain or processor | Stays unmatched and shows on the reconciliation page. |
| A payment whose outcome is unknown after signing | Stays reconciling, with its budget still held, until it is resolved. It is never re-sent automatically. |
| A reversal of a transaction already reversed | Refused. |

The ledger has no reason codes of its own; it records the outcome of decisions, it never takes part in them.

## API [#api]

The Ledger and reports operations in the API reference, each with its parameters, responses and code samples:

<ApiOperationList ids={['getFinanceSummary', 'listSettlements', 'runReconciliation', 'getSettlement', 'recheckSettlement', 'escalateSettlement', 'getSpendReport', 'listExports']} />

## Next steps [#next-steps]

<Cards>
  <Card title="Payment lifecycle" href="/docs/architecture/payment-lifecycle" description="See the moment in a payment when the ledger posts." />
  <Card title="Proof" href="/docs/products/proof" description="Pair each ledger entry with a receipt anyone can check." />
  <Card title="Treasury" href="/docs/products/treasury" description="See idle balances and the sweep model, kept in their own ledger section." />
</Cards>

