API reference
Accounts
The chart of accounts, each account's balance and its register.
- GET
/v1/accountsList the chart of accounts with balances - POST
/v1/accountsAdd an account to the chart - GET
/v1/accounts/{account_id}Get an account - PATCH
/v1/accounts/{account_id}Rename an account, move it in the chart, or take it out of use - GET
/v1/accounts/{account_id}/activityList an account's lines with a running balance - PUT
/v1/accounts/{account_id}/logoUpload an account's logo - DELETE
/v1/accounts/{account_id}/logoRemove an account's uploaded logo - GET
/v1/accounts/{account_id}/required_dimensionsGet the dimensions every line on an account must name - PUT
/v1/accounts/{account_id}/required_dimensionsSet the dimensions every line on an account must name - PUT
/v1/accounts/{account_id}/tax_lineChoose the tax line an account reports on
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
| Name | Type | Description |
|---|---|---|
as_ofQuery | string (date) or null | Balances as of this date. |
include_emptyQuery | boolean | Default 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 "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
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 -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
| Name | Type | Description |
|---|---|---|
account_idPath · Required | string | An id that starts with |
as_ofQuery | string (date) or null | Balances as of this date. |
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/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
| Name | Type | Description |
|---|---|---|
account_idPath · Required | string | An id that starts with |
Request body
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 -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
| Name | Type | Description |
|---|---|---|
account_idPath · Required | string | An id that starts with |
sinceQuery | string (date) or null | First day. Defaults to 1 January of |
untilQuery | string (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 "https://api.ledgerit.ai/v1/accounts/{account_id}/activity" \
-H "Authorization: Bearer $LEDGERIT_TOKEN"Upload an account's logo
PUT/v1/accounts/{account_id}/logo· Idempotent
client.accounts.setLogo()
Upload a logo for an account, replacing any uploaded before. It is shown instead of the mark of the integration that feeds it.
The image type is read from the bytes, not from the upload's declared
type: PNG, JPEG or WebP, never SVG. It is redrawn as a square PNG of
128 pixels at most. Refused with payload_too_large over 1 MB and
unsupported_image for anything else, or an image under 32 pixels.
Parameters
| Name | Type | Description |
|---|---|---|
account_idPath · Required | string | An id that starts with |
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 -X PUT "https://api.ledgerit.ai/v1/accounts/{account_id}/logo" \
-H "Authorization: Bearer $LEDGERIT_TOKEN" \
-H "Idempotency-Key: $(uuidgen)"Remove an account's uploaded logo
DELETE/v1/accounts/{account_id}/logo· Idempotent
client.accounts.removeLogo()
Remove the logo uploaded for an account. It wears the mark of the integration that feeds it again, or its type's icon when none does. Removing a logo that is not there succeeds and changes nothing.
Parameters
| Name | Type | Description |
|---|---|---|
account_idPath · Required | string | An id that starts with |
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 -X DELETE "https://api.ledgerit.ai/v1/accounts/{account_id}/logo" \
-H "Authorization: Bearer $LEDGERIT_TOKEN" \
-H "Idempotency-Key: $(uuidgen)"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
| Name | Type | Description |
|---|---|---|
account_idPath · Required | string | An id that starts with |
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/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
| Name | Type | Description |
|---|---|---|
account_idPath · Required | string | An id that starts with |
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 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
| Name | Type | Description |
|---|---|---|
account_idPath · Required | string | An id that starts with |
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 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
| Name | Type | Description |
|---|---|---|
accountsRequired | array of AccountOut | |
as_ofRequired | string (date) | |
currencyRequired | string | |
minor_unit_scaleRequired | integer | 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
| Name | Type | Description |
|---|---|---|
codeRequired | string | |
control_role | string or null | Make it a control account: every line on it must then name its party. ar, ap, processor_clearing |
is_postable | boolean | Default true |
nameRequired | string | |
parent_id | string or null | An id that starts with |
role | string or null | |
typeRequired | string |
AccountOut
| Name | Type | Description |
|---|---|---|
balanceRequired | string | |
carries_financing | boolean | 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). |
codeRequired | string | |
control_role | string or null |
ar, ap, processor_clearing |
currencyRequired | string or null | |
has_activity | boolean | Default false |
idRequired | string | An id that starts with |
is_activeRequired | boolean | |
is_postableRequired | boolean | |
is_rollupRequired | boolean | |
logo_url | string or null | The logo a person uploaded for the account, a square PNG; null for none. Shown instead of |
nameRequired | string | |
parent_idRequired | string or null | An id that starts with |
provider | string or null | The integration that feeds the account ( |
roleRequired | string or null | |
typeRequired | string |
AccountDetailOut
| Name | Type | Description |
|---|---|---|
accountRequired | AccountOut | |
as_ofRequired | string (date) | |
childrenRequired | array of AccountOut | |
currencyRequired | string | |
parentRequired | AccountRef 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.
| Name | Type | Description |
|---|---|---|
is_active | boolean 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. |
name | string or null | What the chart calls it. |
parent_id | string or null | An id that starts with |
RegisterOut
| Name | Type | Description |
|---|---|---|
closing_balanceRequired | string | |
currencyRequired | string | |
linesRequired | array of RegisterLineOut | |
opening_balanceRequired | string | |
sinceRequired | string (date) | |
truncatedRequired | boolean | |
untilRequired | string (date) |
RequiredDimensionsOut
| Name | Type | Description |
|---|---|---|
account_idRequired | string | An id that starts with |
dimension_idsRequired | array of string | Every line posted to the account names a value of each of these dimensions. |
RequiredDimensionsIn
| Name | Type | Description |
|---|---|---|
dimension_idsRequired | array of string | The whole set: dimensions left out stop being required. |
AccountTaxLineIn
| Name | Type | Description |
|---|---|---|
tax_lineRequired | string or null | A key from |
AccountTaxLineOut
| Name | Type | Description |
|---|---|---|
account_idRequired | string | An id that starts with |
account_typeRequired | string | |
codeRequired | string | |
nameRequired | string | |
sourceRequired | string |
|
tax_lineRequired | string | |
tax_line_labelRequired | string |
AccountRef
| Name | Type | Description |
|---|---|---|
codeRequired | string | |
idRequired | string | An id that starts with |
nameRequired | string |
RegisterLineOut
| Name | Type | Description |
|---|---|---|
accountRequired | AccountRef | |
amountRequired | string | |
balanceRequired | string | |
descriptionRequired | string | |
directionRequired | string | One of debit, credit |
entry_dateRequired | string (date) | |
entry_idRequired | string | An id that starts with |
entry_noRequired | integer | |
line_idRequired | string | An id that starts with |
memoRequired | string or null | |
reverses_entry_id | string or null | An id that starts with |
signed_amountRequired | string | |
sourceRequired | string |