---
title: "Set a register's opening balance from its statement"
method: POST
path: "/bank-accounts/{bankAccountId}/opening-balance"
tags: ["Banking"]
---

# Set a register's opening balance from its statement

`POST /bank-accounts/{bankAccountId}/opening-balance`

## Request

- Base URL: `https://ledgerhq.pro/api/v1`
- URL: `https://ledgerhq.pro/api/v1/bank-accounts/{bankAccountId}/opening-balance`
- Auth: one of:
  - HTTP bearer and API key in header `x-organization-id`
  - HTTP bearer and API key in header `x-organization-id`

Posts one entry against Opening Balance Equity so the register's book balance on asOfDate equals the statement balance. statementBalanceCents is entered as the statement shows it (a card or loan's amount owed is positive). Only the difference from the current book balance is posted; preview=true posts nothing. Honors Idempotency-Key.

## Path parameters

- `bankAccountId` string, uuid, required

## Request body

- object
  - `asOfDate` string, date, required
  - `statementBalanceCents` integer, required
  - `preview` boolean

## Response `200`

Book balance before, target, adjustment, and the posted entry when one was needed

## Other responses

- `default`: Error response

---

[API](https://skmtc.dev/ledgerhq-pro/apis/ledgerhq-bookkeeping-api.md) · [All operations](https://skmtc.dev/ledgerhq-pro/apis/ledgerhq-bookkeeping-api/llms.txt) · [OpenAPI document](https://skmtc.dev/ledgerhq-pro/apis/ledgerhq-bookkeeping-api/revisions/9a8269f0a586?raw)
