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
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 "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
Response
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 -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
| Name | Type | Description |
|---|---|---|
as_ofRequired | string (date) or null | |
currencyRequired | string | |
differenceRequired | string | |
entry_idRequired | string or null | An id that starts with |
entry_noRequired | integer or null | |
linesRequired | array of OpeningLineOut |
SetOpeningBalances
| Name | Type | Description |
|---|---|---|
as_ofRequired | string (date) | |
balancesRequired | array of OpeningBalanceIn |
OpeningLineOut
| Name | Type | Description |
|---|---|---|
account_codeRequired | string | |
account_idRequired | string | An id that starts with |
account_nameRequired | string | |
balanceRequired | string |
OpeningBalanceIn
| Name | Type | Description |
|---|---|---|
account_idRequired | string | An id that starts with |
balanceRequired | number | string |