# Start or resume an account reconciliation

Operation ID: `startReconciliation`

Group: Banking › Reconciliations

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

`POST /banking/reconciliations`

Retry-safe: A write that accepts Idempotency-Key: repeating a request with the same key replays the stored answer instead of executing twice.

Opens the next reconciliation for a bank or credit-card account. This is the only route that does not name a reconciliation: it is how one comes into existence, and every other route addresses the `id` it returns.

**The period is derived, not chosen.** An account reconciles in order, so the server picks the period: the one after the account's last completed reconciliation, or — for an account that has never been reconciled — the period containing its configured reconciliation start date. A caller cannot skip ahead.

**The call resumes rather than duplicates.** If the account already has a reconciliation that is not complete, that one's `id` is returned and nothing is created; `statementEndBalance` and `statementEndDate` are then ignored, and adjusting them is `PATCH banking/reconciliations/{id}`. Calling this repeatedly is therefore safe, and is the intended way to get at the account's open reconciliation without knowing its id. The response is the `id` alone: read `GET banking/reconciliations/{id}` for the period the server derived and the figures it stored.

**Both statement figures default.** Omit `statementEndDate` and the period end date is used; omit `statementEndBalance` and the account's own balance as of that date is used, which is a starting point to correct rather than a statement figure. Supply them when the bank statement is already in hand.

Two failures are foreseeable. `RECONCILIATION_INVALID_ACCOUNT_TYPE` means the account is not a bank or credit-card account — nothing else reconciles this way. `RECONCILIATION_NO_PERIOD_FOUND` means no accounting period covers the account's reconciliation start date, which is fiscal-calendar configuration rather than anything about this request. Both arrive under HTTP **400**, as does `ACCOUNT_NOT_FOUND`; branch on the `code` in the error body. A `statementEndDate` outside the derived period is refused with `STATEMENT_END_DATE_OUTSIDE_PERIOD` when a reconciliation would be created.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `Api-Version` | header | string · v1 | yes | The API version this request targets, named by its public identifier. Required on every request; omitting it, or naming a version this company does not have, is answered with 400. This document describes version `v1`. |
| `Idempotency-Key` | header | string | no | An opaque caller-chosen string (1-255 characters) that makes this request safe to retry. Repeating the same key with an identical request body replays the original response instead of re-executing - but only once that original request succeeded; a failed attempt re-executes on retry. Repeating the key with a different body is answered with 422. A key still in flight is answered with 409 - as is a key whose original request was interrupted before it finished, for a few minutes afterwards, until that attempt is presumed dead. A completed response stays replayable for 24 hours. The key is scoped to the caller, not to the action: reusing it for a different action is answered with 409 or 422 rather than treated independently. On read actions this header is ignored. On write actions that cannot offer the guarantee it is answered with `400 IDEMPOTENCY_NOT_SUPPORTED` rather than silently ignored. |

## Request body

Required, `application/json`: startReconciliationInput.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `accountId` | string | yes | Id (a UUID) of the bank or credit-card account to reconcile. Must be a cash account: anything else fails with RECONCILIATION_INVALID_ACCOUNT_TYPE. Example: `"9f2c6a10-7d34-4c8e-9b21-5a0f3e6d81b7"`. |
| `statementEndBalance` | decimal | no | Closing balance from the bank statement, in the account currency. Omit to default to the account's own balance as of the statement end date. Ignored when an open reconciliation is resumed — adjust that one with PATCH banking/reconciliations/{id}. Example: `"184320.55"`. |
| `statementEndDate` | date | no | Closing date of the bank statement. Omit to default to the end date of the derived accounting period. Ignored when an open reconciliation is resumed. Format YYYY-MM-DD. Example: `"2026-07-31"`. |

```json
{
  "accountId": "9f2c6a10-7d34-4c8e-9b21-5a0f3e6d81b7"
}
```

## Response

`200` Success

Under `data` (startReconciliationOutput):

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | yes | Platform id (a UUID) of the started or resumed reconciliation. Every other route addresses this value. Example: `"3b7d5e9c-1a24-4f80-9c6d-2e8f70b13a45"`. |

```json
{
  "data": {
    "id": "3b7d5e9c-1a24-4f80-9c6d-2e8f70b13a45"
  },
  "diagnostics": [
    {
      "code": "<code>",
      "message": "<message>",
      "severity": "error",
      "path": [
        "<path>"
      ],
      "details": "<details>"
    }
  ]
}
```

## Response headers

- `Idempotency-Replayed` — Present and `true` only when this response replays a previously stored one for the same Idempotency-Key, rather than reflecting a live execution. Absent on a live response - never sent as `false`.

## Errors

| Code | Status |
| --- | --- |
| `ACCOUNT_NOT_FOUND` | 400 |
| `RECONCILIATION_INVALID_ACCOUNT_TYPE` | 400 |
| `RECONCILIATION_NO_PERIOD_FOUND` | 400 |
| `RECONCILIATION_ACCOUNT_NOT_LINKED` | 400 |
| `STATEMENT_END_DATE_OUTSIDE_PERIOD` | 400 |
| `IDEMPOTENCY_KEY_CONFLICT` | 409 |
| `IDEMPOTENCY_PAYLOAD_MISMATCH` | 422 |

## Statuses

- `400` — Invalid request or business failure. Codes: ACCOUNT_NOT_FOUND, RECONCILIATION_INVALID_ACCOUNT_TYPE, RECONCILIATION_NO_PERIOD_FOUND, RECONCILIATION_ACCOUNT_NOT_LINKED, STATEMENT_END_DATE_OUTSIDE_PERIOD
- `401` — The request carries no valid access token.
- `403` — Not authorized
- `404` — Not found
- `409` — The Idempotency-Key is still being processed by another request.
- `422` — The Idempotency-Key was already used with a different request payload.
- `429` — Too many requests from this client address. The response has no body and no `Retry-After` header.
- `500` — Internal server error
