API reference

Opening balances

What each balance-sheet account held on the day the books begin.

Guides: Write and correct journal entries

Get the opening balances

GET/v1/opening_balances

client.openingBalances.get()

What every balance-sheet account held before these books began.

Response

200OpeningBalancesOut

Errors

400
The request was malformed or a parameter is invalid.
401
No valid credential was sent.
403
The credential or the member's role does not allow this.
404
No such resource in this ledger.
409
A conflicting request, e.g. one with the same Idempotency-Key still running.
422
A well-formed request a business rule refused.
429
Too many requests; retry after the Retry-After header.
500
Something failed on our side; the request_id identifies it.

Example

curl
curl "https://api.ledgerit.ai/v1/opening_balances" \
  -H "Authorization: Bearer $LEDGERIT_TOKEN"

Set the opening balances

POST/v1/opening_balances· Idempotent

client.openingBalances.set()

Replace the opening balances, as one entry against opening balance equity. The entry that stood before is reversed, not edited.

Refused with opening_balance_invalid for an income or expense account, and with period_closed when the month it lands in is closed.

Request body

SetOpeningBalances

Response

200OpeningBalancesOut

Errors

400
The request was malformed or a parameter is invalid.
401
No valid credential was sent.
403
The credential or the member's role does not allow this.
404
No such resource in this ledger.
409
A conflicting request, e.g. one with the same Idempotency-Key still running.
422
A well-formed request a business rule refused.
429
Too many requests; retry after the Retry-After header.
500
Something failed on our side; the request_id identifies it.

Example

curl
curl -X POST "https://api.ledgerit.ai/v1/opening_balances" \
  -H "Authorization: Bearer $LEDGERIT_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"as_of":"2026-09-30","balances":[{"account_id":"…","balance":0}]}'

Objects

The objects these operations take and return.

OpeningBalancesOut

NameTypeDescription
as_ofRequiredstring (date) or null
currencyRequiredstring
differenceRequiredstring
entry_idRequiredstring or null

An id that starts with je_.

entry_noRequiredinteger or null
linesRequiredarray of OpeningLineOut

SetOpeningBalances

NameTypeDescription
as_ofRequiredstring (date)
balancesRequiredarray of OpeningBalanceIn

OpeningLineOut

NameTypeDescription
account_codeRequiredstring
account_idRequiredstring

An id that starts with gla_.

account_nameRequiredstring
balanceRequiredstring

OpeningBalanceIn

NameTypeDescription
account_idRequiredstring

An id that starts with gla_.

balanceRequirednumber | string