# Reconciliations

Group: Banking

[Open in the interactive reference](https://docs.api.lensing.ai/lensing/v1/groups/bankReconciliations)

Bank and credit-card account reconciliations: start one for an account, adjust its statement figures, submit it once it is done (submit does not check that it balances), and reopen it when it has to be revisited.

A reconciliation ties one bank or credit-card account to one accounting period, and its job is to prove that what the bank says happened and what the ledger says happened are the same thing. It is the resource here, addressed by its own `id`; the `(account, period)` pair that identifies it internally is not part of the contract.

The lifecycle is four routes. `POST banking/reconciliations` starts one for an account — the period is derived, so a caller does not pick it. That call resumes rather than duplicates: if the account already has a reconciliation that is not complete, its `id` is returned and nothing is created. `PATCH banking/reconciliations/{id}` sets the statement figures the bank sends. `POST banking/reconciliations/{id}/submit` closes it and stamps who reconciled it and when. `POST banking/reconciliations/{id}/reopen` reverses that.

Two routes read. `GET banking/reconciliations` is the worklist, with filters, ordering and cursor pagination in the query string. `GET banking/reconciliations/{id}` is one reconciliation, and it carries a nested `balances` object the worklist cannot — the balance roll-forward that shows how the statement and the ledger reach their respective ending balances, and what remains between them. The scalar fields are named and typed identically in both.

Submit is ordered: a period cannot be submitted while the account's previous period is still open. Reopen cascades forward — reopening a period also reopens every later completed one for that account, because their beginning balances descend from it.

One thing to know before writing error handling: a business failure such as `NOT_FOUND` arrives under HTTP 400, not 404, because a route cannot yet declare a status per diagnostic code. Branch on the `code` in the error body.

## Endpoints

- [List and filter account reconciliations](https://docs.api.lensing.ai/reference/lensing/v1/endpoints/reconciliations.html): `GET /banking/reconciliations`
- [Start or resume an account reconciliation](https://docs.api.lensing.ai/reference/lensing/v1/endpoints/startReconciliation.html): `POST /banking/reconciliations`
- [Fetch an account reconciliation by id](https://docs.api.lensing.ai/reference/lensing/v1/endpoints/getReconciliation.html): `GET /banking/reconciliations/{id}`
- [Update the statement figures on a reconciliation](https://docs.api.lensing.ai/reference/lensing/v1/endpoints/updateReconciliation.html): `PATCH /banking/reconciliations/{id}`
- [List the in-transit bank transactions of a reconciliation](https://docs.api.lensing.ai/reference/lensing/v1/endpoints/getReconciliationInTransitBankTransactions.html): `GET /banking/reconciliations/{id}/in-transit/bank-transactions`
- [Set and clear the in-transit flag on bank transactions](https://docs.api.lensing.ai/reference/lensing/v1/endpoints/updateReconciliationInTransitBankTransactions.html): `PATCH /banking/reconciliations/{id}/in-transit/bank-transactions`
- [List the in-transit GL transactions of a reconciliation](https://docs.api.lensing.ai/reference/lensing/v1/endpoints/getReconciliationInTransitGlTransactions.html): `GET /banking/reconciliations/{id}/in-transit/gl-transactions`
- [Set and clear the in-transit flag on GL transactions](https://docs.api.lensing.ai/reference/lensing/v1/endpoints/updateReconciliationInTransitGlTransactions.html): `PATCH /banking/reconciliations/{id}/in-transit/gl-transactions`
- [List the matches of a reconciliation](https://docs.api.lensing.ai/reference/lensing/v1/endpoints/getReconciliationMatches.html): `GET /banking/reconciliations/{id}/matches`
- [List the outstanding bank transactions of a reconciliation](https://docs.api.lensing.ai/reference/lensing/v1/endpoints/getReconciliationOutstandingBankTransactions.html): `GET /banking/reconciliations/{id}/outstanding/bank-transactions`
- [List the outstanding GL transactions of a reconciliation](https://docs.api.lensing.ai/reference/lensing/v1/endpoints/getReconciliationOutstandingGlTransactions.html): `GET /banking/reconciliations/{id}/outstanding/gl-transactions`
- [Reopen an account reconciliation and every later one](https://docs.api.lensing.ai/reference/lensing/v1/endpoints/reopenReconciliation.html): `POST /banking/reconciliations/{id}/reopen`
- [Submit an account reconciliation](https://docs.api.lensing.ai/reference/lensing/v1/endpoints/submitReconciliation.html): `POST /banking/reconciliations/{id}/submit`
