Unira

use_case · bank_vs_ledger

Bank statement to the cash general ledger

Month-end cash does not tie when a fee never hit the ledger, a check has not cleared, a card deposit is off by two cents, or the books posted the same invoice twice.

What breaks in practice

An exact-amount match hides the $0.02 card rounding and the check that cleared three days later. A duplicate ledger line for one bank withdrawal can steal the only candidate, so a human has to decide which posting stands. The bank fee has no journal entry at all.

What Unira reconciles

POST /api/v1/examples/bank-books needs no body. It creates the October sample datasets, the ruleset, and one 49-record job per organization and environment, and it sets use_case to bank_vs_ledger. Repeating the call returns that same job with HTTP 202. The full sample is 22 matched groups (20 exact, one $0.02 rounding difference, and one check that clears inside the 4-day window) and 5 records needing review: the bank fee missing from the books, the uncleared check missing from the bank, and three records touched by a duplicate posting. Download the files from bank.csv, books.csv, and ruleset.json.

Outputs and exceptions

On the three-row illustration below, rent matches exactly, the card deposit matches within $0.02, missing_books is the bank fee (dataset A only), and missing_bank is the uncleared check (dataset B only). Fetch GET /api/v1/reconciliations/{id}/exceptions and GET /api/v1/reconciliations/{id}/export?format=csv after status is completed.

Sample payload

These rows are a slice of the official October fixture, not a second product sample. Field names match POST /api/v1/datasets.

POST /api/v1/datasets (bank)

{
  "name": "Bank statement — October 2026",
  "id_field": "bank_id",
  "idempotency_key": "bank-books-bank-v1",
  "records": [
    {"bank_id": "BANK-001", "date": "2026-10-01", "description": "ACH rent · Maple Street Properties", "amount": "-2400.00", "reference": "RENT-OCT", "currency": "USD"},
    {"bank_id": "BANK-021", "date": "2026-10-27", "description": "Card settlement · Northline rounding adjustment", "amount": "1432.18", "reference": "CARD-1027", "currency": "USD"},
    {"bank_id": "BANK-024", "date": "2026-10-31", "description": "Monthly bank service charge", "amount": "-18.00", "reference": "BANK-FEE-OCT", "currency": "USD"}
  ]
}

POST /api/v1/datasets (books)

{
  "name": "General ledger cash account — October 2026",
  "id_field": "journal_id",
  "idempotency_key": "bank-books-books-v1",
  "records": [
    {"journal_id": "JE-001", "posting_date": "2026-10-01", "memo": "ACH rent · Maple Street Properties", "amount": "-2400.00", "reference": "RENT-OCT", "vendor_customer": "Maple Street Properties", "currency": "USD"},
    {"journal_id": "JE-021", "posting_date": "2026-10-27", "memo": "Northline card deposit recorded before rounding", "amount": "1432.20", "reference": "CARD-1027", "vendor_customer": "Retail customers", "currency": "USD"},
    {"journal_id": "JE-025", "posting_date": "2026-10-31", "memo": "Check 1043 issued · equipment deposit, not cleared", "amount": "-950.00", "reference": "CHK-1043", "vendor_customer": "North Workshop Equipment", "currency": "USD"}
  ]
}

POST /api/v1/rulesets

{
  "name": "Bank transactions vs. general ledger — October",
  "rules": [
    {"id": "bank-books-exact", "name": "Same reference, currency, amount and date", "priority": 1, "conditions": [
      {"field_a": "currency", "field_b": "currency", "operator": "exact", "nulls_equal": false},
      {"field_a": "reference", "field_b": "reference", "operator": "exact", "trim": true, "ignore_case": true, "nulls_equal": false},
      {"field_a": "amount", "field_b": "amount", "operator": "amount", "tolerance": "0"},
      {"field_a": "date", "field_b": "posting_date", "operator": "date", "tolerance": "0"}
    ]},
    {"id": "bank-books-rounding", "name": "Same date; amount within 0.05", "priority": 2, "conditions": [
      {"field_a": "currency", "field_b": "currency", "operator": "exact", "nulls_equal": false},
      {"field_a": "reference", "field_b": "reference", "operator": "exact", "trim": true, "ignore_case": true, "nulls_equal": false},
      {"field_a": "amount", "field_b": "amount", "operator": "amount", "tolerance": "0.05"},
      {"field_a": "date", "field_b": "posting_date", "operator": "date", "tolerance": "0"}
    ]},
    {"id": "bank-books-clearing", "name": "Exact amount; clearing within 4 days", "priority": 3, "conditions": [
      {"field_a": "currency", "field_b": "currency", "operator": "exact", "nulls_equal": false},
      {"field_a": "reference", "field_b": "reference", "operator": "exact", "trim": true, "ignore_case": true, "nulls_equal": false},
      {"field_a": "amount", "field_b": "amount", "operator": "amount", "tolerance": "0"},
      {"field_a": "date", "field_b": "posting_date", "operator": "date", "tolerance": "4"}
    ]}
  ]
}

POST /api/v1/reconciliations

{
  "name": "October bank vs. books",
  "use_case": "bank_vs_ledger",
  "dataset_a_id": "ds_bank",
  "dataset_b_id": "ds_books",
  "ruleset_id": "rules_example",
  "ruleset_version": 1,
  "idempotency_key": "october-close-2026"
}

curl

curl --fail-with-body -sS https://unira.dev/api/v1/examples/bank-books \
  -X POST \
  -H "Authorization: Bearer $UNIRA_API_KEY" \
  -H "Content-Type: application/json"

curl --fail-with-body -sS https://unira.dev/api/v1/datasets \
  -H "Authorization: Bearer $UNIRA_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{"name":"Bank statement — October 2026","id_field":"bank_id","idempotency_key":"bank-books-bank-v1","records":[{"bank_id":"BANK-001","date":"2026-10-01","description":"ACH rent","amount":"-2400.00","reference":"RENT-OCT","currency":"USD"},{"bank_id":"BANK-021","date":"2026-10-27","description":"Card settlement rounding","amount":"1432.18","reference":"CARD-1027","currency":"USD"},{"bank_id":"BANK-024","date":"2026-10-31","description":"Monthly bank service charge","amount":"-18.00","reference":"BANK-FEE-OCT","currency":"USD"}]}'

curl --fail-with-body -sS https://unira.dev/api/v1/datasets \
  -H "Authorization: Bearer $UNIRA_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{"name":"General ledger cash account — October 2026","id_field":"journal_id","idempotency_key":"bank-books-books-v1","records":[{"journal_id":"JE-001","posting_date":"2026-10-01","memo":"ACH rent","amount":"-2400.00","reference":"RENT-OCT","vendor_customer":"Maple Street Properties","currency":"USD"},{"journal_id":"JE-021","posting_date":"2026-10-27","memo":"Card deposit before rounding","amount":"1432.20","reference":"CARD-1027","vendor_customer":"Retail customers","currency":"USD"},{"journal_id":"JE-025","posting_date":"2026-10-31","memo":"Check 1043 not cleared","amount":"-950.00","reference":"CHK-1043","vendor_customer":"North Workshop Equipment","currency":"USD"}]}'

curl --fail-with-body -sS https://unira.dev/api/v1/reconciliations \
  -H "Authorization: Bearer $UNIRA_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{"name":"October bank vs. books","use_case":"bank_vs_ledger","dataset_a_id":"'"$A"'","dataset_b_id":"'"$B"'","ruleset_id":"'"$RULESET"'","ruleset_version":1,"idempotency_key":"october-close-2026"}'

curl --fail-with-body -sS "https://unira.dev/api/v1/reconciliations/$JOB/exceptions" \
  -H "Authorization: Bearer $UNIRA_API_KEY"
curl --fail-with-body -sS "https://unira.dev/api/v1/reconciliations/$JOB/export?format=csv" \
  -H "Authorization: Bearer $UNIRA_API_KEY" --output bank-books.csv

Create the ruleset with POST /api/v1/rulesets and the JSON above before the job call. The same ruleset object is what the quickstart sends.

MCP: reconcile_files

preset bank-books is this recipe. use_case defaults to bank_vs_ledger when omitted. Required arguments are side_a_csv and side_b_csv.

curl --fail-with-body -sS https://unira.dev/api/mcp \
  -H "Authorization: Bearer $UNIRA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  --data '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"reconcile_files","arguments":{"side_a_csv":"bank_id,date,description,amount,reference,currency\nBANK-001,2026-10-01,ACH rent,-2400.00,RENT-OCT,USD\nBANK-021,2026-10-27,Card settlement,1432.18,CARD-1027,USD\nBANK-024,2026-10-31,Bank service charge,-18.00,BANK-FEE-OCT,USD\n","side_b_csv":"journal_id,posting_date,memo,amount,reference,currency\nJE-001,2026-10-01,ACH rent,-2400.00,RENT-OCT,USD\nJE-021,2026-10-27,Card deposit,1432.20,CARD-1027,USD\nJE-025,2026-10-31,Check 1043 not cleared,-950.00,CHK-1043,USD\n","side_a_name":"Bank statement","side_b_name":"General ledger","preset":"bank-books","use_case":"bank_vs_ledger","idempotency_key":"bank-books-mcp-v1"}}}'