API reference

Accounts

The chart of accounts, each account's balance and its register.

Guides: Read your chart of accounts

List the chart of accounts with balances

GET/v1/accounts

client.accounts.list()

The chart of accounts as a tree, each account with its balance as of as_of (today by default), headers rolled up from the accounts under them.

Parameters

NameTypeDescription
as_ofQuerystring (date) or null

Balances as of this date.

include_emptyQuerybooleanDefault true

Response

200ChartOut

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/accounts" \
  -H "Authorization: Bearer $LEDGERIT_TOKEN"

Add an account to the chart

POST/v1/accounts· Idempotent

client.accounts.create()

Add an account to this entity's chart.

The code range has to match the type (ACCOUNT_CODE_PREFIXES): an expense account numbered in the 4000s works perfectly until a report groups by prefix, and then it is revenue.

Request body

NewAccount

Response

201AccountOut

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/accounts" \
  -H "Authorization: Bearer $LEDGERIT_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"code":"…","name":"…","type":"…"}'

Get an account

GET/v1/accounts/{account_id}

client.accounts.get()

One account: its balance, where it sits in the chart, and what is under it.

Parameters

NameTypeDescription
account_idPath · Requiredstring

An id that starts with gla_.

as_ofQuerystring (date) or null

Balances as of this date.

Response

200AccountDetailOut

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/accounts/{account_id}" \
  -H "Authorization: Bearer $LEDGERIT_TOKEN"

Rename an account, move it in the chart, or take it out of use

PATCH/v1/accounts/{account_id}· Idempotent

client.accounts.update()

Rename an account, move it in the chart, or take it out of use and bring it back.

A move puts it under another account of its own type, or at the top of its type. Nothing posted changes; the headers above its old place stop counting it and the ones above its new place start. It is refused under itself, under anything that is under it, and under an account out of use.

An account with history is never deleted: taking it out of use stops anything new being filed or posted to it, and leaves what is there. It is refused for an account the books cannot run without (retained earnings, suspense and the other one-of-a-kind roles), for a header with accounts still in use under it, and while a rule still files to it.

Parameters

NameTypeDescription
account_idPath · Requiredstring

An id that starts with gla_.

Request body

AccountChange

Response

200AccountOut

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 PATCH "https://api.ledgerit.ai/v1/accounts/{account_id}" \
  -H "Authorization: Bearer $LEDGERIT_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'

List an account's lines with a running balance

GET/v1/accounts/{account_id}/activity

client.accounts.listActivity()

The account's register, oldest first, with a running balance.

A header account's register is its whole subtree's.

Parameters

NameTypeDescription
account_idPath · Requiredstring

An id that starts with gla_.

sinceQuerystring (date) or null

First day. Defaults to 1 January of until's year.

untilQuerystring (date) or null

Last day. Defaults to today.

Response

200RegisterOut

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/accounts/{account_id}/activity" \
  -H "Authorization: Bearer $LEDGERIT_TOKEN"

Get the dimensions every line on an account must name

GET/v1/accounts/{account_id}/required_dimensions

client.accounts.getRequiredDimensions()

The dimensions every line on this account must name a value of.

Parameters

NameTypeDescription
account_idPath · Requiredstring

An id that starts with gla_.

Response

200RequiredDimensionsOut

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/accounts/{account_id}/required_dimensions" \
  -H "Authorization: Bearer $LEDGERIT_TOKEN"

Set the dimensions every line on an account must name

PUT/v1/accounts/{account_id}/required_dimensions· Idempotent

client.accounts.setRequiredDimensions()

Set which dimensions every line on this account must name. Lines already posted are not revisited; every line posted after is held to it, and refused with dimension_required without one.

Parameters

NameTypeDescription
account_idPath · Requiredstring

An id that starts with gla_.

Request body

RequiredDimensionsIn

Response

200RequiredDimensionsOut

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 PUT "https://api.ledgerit.ai/v1/accounts/{account_id}/required_dimensions" \
  -H "Authorization: Bearer $LEDGERIT_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"dimension_ids":["…"]}'

Choose the tax line an account reports on

PUT/v1/accounts/{account_id}/tax_line· Idempotent

client.accounts.setTaxLine()

Choose the line an account reports on, or send null to go back to its default. Refused with unprocessable for a line of the wrong part: a balance-sheet account belongs on Schedule L.

Parameters

NameTypeDescription
account_idPath · Requiredstring

An id that starts with gla_.

Request body

AccountTaxLineIn

Response

200AccountTaxLineOut

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 PUT "https://api.ledgerit.ai/v1/accounts/{account_id}/tax_line" \
  -H "Authorization: Bearer $LEDGERIT_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"tax_line":"…"}'

Objects

The objects these operations take and return.

ChartOut

NameTypeDescription
accountsRequiredarray of AccountOut
as_ofRequiredstring (date)
currencyRequiredstring
minor_unit_scaleRequiredinteger

How many decimal places the books' currency is counted in: 2 for dollars, 0 for yen. Every amount posted to these books is a whole number of that unit.

NewAccount

NameTypeDescription
codeRequiredstring
control_rolestring or null

Make it a control account: every line on it must then name its party.

One of ar, ap, processor_clearing
is_postablebooleanDefault true
nameRequiredstring
parent_idstring or null

An id that starts with gla_.

rolestring or null
typeRequiredstring

AccountOut

NameTypeDescription
balanceRequiredstring
carries_financingboolean

True when a financing instrument is carried in it (a SAFE's, a note's or venture debt's account), whatever its code: never a transfer's other end (decision 0191).

Default false
codeRequiredstring
control_rolestring or null

ar, ap or processor_clearing on a control account, whose every line names its party (party_id).

One of ar, ap, processor_clearing
currencyRequiredstring or null
has_activitybooleanDefault false
idRequiredstring

An id that starts with gla_.

is_activeRequiredboolean
is_postableRequiredboolean
is_rollupRequiredboolean
logo_urlstring or null

The logo a person uploaded for the account, a square PNG; null for none. Shown instead of provider's mark.

nameRequiredstring
parent_idRequiredstring or null

An id that starts with gla_.

providerstring or null

The integration that feeds the account (brex, mercury, …), when one does: the provider of a connected bank account, card or card program mapped to it. The account wears its mark unless a logo was uploaded.

roleRequiredstring or null
typeRequiredstring

AccountDetailOut

NameTypeDescription
accountRequiredAccountOut
as_ofRequiredstring (date)
childrenRequiredarray of AccountOut
currencyRequiredstring
parentRequiredAccountRef or null

AccountChange

What may change on an account. Its code and type do not: the code is how reports group it, and the type is which side of the books it is on.

NameTypeDescription
is_activeboolean or null

False takes it out of use: nothing new is filed or posted to it, and everything already posted stays and still reports. True brings it back.

namestring or null

What the chart calls it.

parent_idstring or null

An id that starts with gla_.

RegisterOut

NameTypeDescription
closing_balanceRequiredstring
currencyRequiredstring
linesRequiredarray of RegisterLineOut
opening_balanceRequiredstring
sinceRequiredstring (date)
truncatedRequiredboolean
untilRequiredstring (date)

RequiredDimensionsOut

NameTypeDescription
account_idRequiredstring

An id that starts with gla_.

dimension_idsRequiredarray of string

Every line posted to the account names a value of each of these dimensions.

RequiredDimensionsIn

NameTypeDescription
dimension_idsRequiredarray of string

The whole set: dimensions left out stop being required.

AccountTaxLineIn

NameTypeDescription
tax_lineRequiredstring or null

A key from GET /v1/tax_lines; null goes back to the default. A balance-sheet account takes a Schedule L line, an income or expense account any other.

AccountTaxLineOut

NameTypeDescription
account_idRequiredstring

An id that starts with gla_.

account_typeRequiredstring
codeRequiredstring
nameRequiredstring
sourceRequiredstring

chosen by a person, or the default by the account's code in the standard chart, or by its type.

tax_lineRequiredstring
tax_line_labelRequiredstring

AccountRef

NameTypeDescription
codeRequiredstring
idRequiredstring

An id that starts with gla_.

nameRequiredstring

RegisterLineOut

NameTypeDescription
accountRequiredAccountRef
amountRequiredstring
balanceRequiredstring
descriptionRequiredstring
directionRequiredstringOne of debit, credit
entry_dateRequiredstring (date)
entry_idRequiredstring

An id that starts with je_.

entry_noRequiredinteger
line_idRequiredstring

An id that starts with jel_.

memoRequiredstring or null
reverses_entry_idstring or null

An id that starts with je_.

signed_amountRequiredstring
sourceRequiredstring