# Verify your first bank statement

Run a two-row bank CSV in the browser or locally, resolve a missing opening balance, and trace a released result back to its source.

Source: https://openbooks.lumeo.co.in/docs/quickstart

In this tutorial you’ll process a synthetic bank statement twice, resolve a missing opening balance, and use the released JSON to verify both transactions. The browser walkthrough requires no installation. For the local walkthrough, use Python 3.11 or newer and Node.js 20 or newer if you choose Node.js.

## 1. Read the sample [#1-read-the-sample]

The sample is a CSV, a plain-text file with comma-separated columns. The `Balance` column is the amount left in the account after each transaction.

| Date (day/month/year) | Movement | Amount (INR) | Balance after (INR) |
| --- | --- | ---: | ---: |
| 02/01/2026 | Debit | 100.00 | 900.00 |
| 03/01/2026 | Credit | 50.00 | 950.00 |

The sample omits its opening balance, the amount before the first row. For this exercise, the known opening balance is INR `1000.00`. For a real statement, get this value from the original statement or another authoritative source, such as the verified closing balance of the preceding statement for the same account.

## 2. Run in the browser [#2-run-in-the-browser]

1. Choose **Run without opening**. The engine returns `status: "refused"` and `error.code: "PARSE_ERROR"`. Look for the message asking for an opening balance.
2. Choose **Run with opening**. This sends the same CSV with `--opening 1000.00`. The engine now returns `status: "ok"`.
3. Scroll through the JSON output and find `data.transactions`, `assertions`, and `evidence`.

<SampleTerminal />

## 3. Repeat locally [#3-repeat-locally]

<a href="/examples/statement.csv" download>Download statement.csv</a> into your project and open a terminal in that directory. Set up your environment using the [installation guide](/docs/installation) if you haven't installed Open Books before. The commands pass `INR` as the currency and `dmy` as the date order, so `02/01/2026` becomes `2026-01-02`.

<Tabs items={["Python CLI","Python API","Node.js"]}>
<Tab value="Python CLI">
~~~bash
python -m pip install "openbooks==0.2.0"
python -m openbooks run statement.csv --currency INR --date-order dmy --out refused
python -m openbooks run statement.csv --currency INR --date-order dmy --opening 1000.00 --out released
~~~

The first run exits `1` and writes a refusal under `refused/`. Run the two commands individually if your shell stops on nonzero exit codes. The corrected run exits `0` and writes the release under `released/`. Both files have the same SHA-256 filename because the input bytes are identical. Separate directories preserve both attempts.
</Tab>

<Tab value="Python API">
Install `openbooks==0.2.0` with `python -m pip`. Save this as `quickstart.py` next to `statement.csv` and run `python quickstart.py`.

~~~python
from decimal import Decimal
from openbooks import Params, process

doc = process("statement.csv", Params(
    currency="INR", date_order="dmy", opening=Decimal("1000.00"),
))
if doc["status"] == "ok":
    for transaction in doc["data"]["transactions"]:
        money = transaction["amount"]
        print(transaction["date"], transaction["direction"], money["amount"], money["currency"])
else:
    print(doc["error"]["code"], doc["error"]["message"])
~~~

The script prints `2026-01-02 debit 100.00 INR` and `2026-01-03 credit 50.00 INR`.
</Tab>

<Tab value="Node.js">
~~~bash
python -m pip install "openbooks==0.2.0"
npm install @lumeo_hq/openbooks-core
~~~

Save this as `quickstart.mjs` and run `node quickstart.mjs`.

~~~js
import { runFile } from "@lumeo_hq/openbooks-core";

const result = await runFile("statement.csv", {
  currency: "INR",
  dateOrder: "dmy",
  opening: "1000.00",
});
if (result.kind === "released") {
  console.log(result.document.data.transactions);
} else {
  console.log(result.code, result.message);
}
~~~
</Tab>
</Tabs>

## 4. Verify the result [#4-verify-the-result]

| Check | JSON field | Expected result |
| --- | --- | --- |
| Release decision | `status` | `"ok"` |
| Transaction directions | `data.transactions` | INR `100.00` debit, then INR `50.00` credit |
| Closing balance | `data.batches[0].closing.amount` | `"950.00"` |
| Reconciliation | `assertions` | Opening minus debit plus credit gives `950.00`. Each row's computed balance matches the CSV. |
| Source for the closing balance | `evidence["batch-1.closing"]` | `raw_text: "950.00"` at row 3, counting the CSV header as row 1 |

Next, [build a Python importer](/docs/build-an-importer) that saves the full decision and computes exact totals, or work through [bank statement exports](/docs/bank-statements) with a representative file.
