API reference

Drafts

Entries being written that have not reached the ledger yet.

Guides: Write and correct journal entries

List draft entries

GET/v1/drafts

client.drafts.list()

Entries being written, oldest first. None of them is in the books.

Parameters

NameTypeDescription
limitQueryinteger

Page size, 1–200.

Default 50
cursorQuerystring or null

The next_cursor of the previous page.

Response

200DraftPage

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

Start a draft entry

POST/v1/drafts· Idempotent

client.drafts.create()

Start a draft entry. It may be unbalanced; it is checked when it posts.

Request body

NewDraft

Response

201DraftOut

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/drafts" \
  -H "Authorization: Bearer $LEDGERIT_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"description":"…","entry_date":"2026-09-30"}'

Get a draft entry

GET/v1/drafts/{draft_id}

client.drafts.get()

One draft, with its lines and whether it would post as it stands.

Parameters

NameTypeDescription
draft_idPath · Requiredstring

An id that starts with draft_.

Response

200DraftOut

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

Change a draft entry

PATCH/v1/drafts/{draft_id}· Idempotent

client.drafts.update()

Change a draft. lines, when sent, replaces all of them. Refused with draft_changed when someone else changed it since row_version.

Parameters

NameTypeDescription
draft_idPath · Requiredstring

An id that starts with draft_.

Request body

DraftChange

Response

200DraftOut

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/drafts/{draft_id}" \
  -H "Authorization: Bearer $LEDGERIT_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"row_version":0}'

Discard a draft entry

DELETE/v1/drafts/{draft_id}

client.drafts.discard()

Throw a draft away. It was never in the books, so nothing is reversed.

Parameters

NameTypeDescription
draft_idPath · Requiredstring

An id that starts with draft_.

row_versionQueryinteger or null

The version you read; a stale one is refused.

Response

204No content

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 DELETE "https://api.ledgerit.ai/v1/drafts/{draft_id}" \
  -H "Authorization: Bearer $LEDGERIT_TOKEN"

Post a draft entry into the books

POST/v1/drafts/{draft_id}/post· Idempotent

client.drafts.post()

Post a draft into the books, with every rule an entry is held to, and remove the draft. Posting it again returns the same entry.

Parameters

NameTypeDescription
draft_idPath · Requiredstring

An id that starts with draft_.

Request body

DraftVersion

Response

201EntryOut

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/drafts/{draft_id}/post" \
  -H "Authorization: Bearer $LEDGERIT_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"row_version":0}'

Objects

The objects these operations take and return.

DraftPage

NameTypeDescription
dataRequiredarray of DraftOut
has_moreRequiredboolean
next_cursorRequiredstring or null

NewDraft

NameTypeDescription
descriptionRequiredstring
entry_dateRequiredstring (date)
linesarray of NewDraftLine
memostring or null

DraftOut

NameTypeDescription
balancedRequiredboolean

Whether it would post as it stands: two lines or more, and equal sides.

created_atRequiredstring (date-time)
creditsRequiredstring
debitsRequiredstring
descriptionRequiredstring
entry_dateRequiredstring (date)
idRequiredstring

An id that starts with draft_.

linesRequiredarray of DraftLineOut
memoRequiredstring or null
row_versionRequiredinteger

Send it back with a change or a post; a stale one is refused with draft_changed.

updated_atRequiredstring (date-time)

DraftChange

NameTypeDescription
descriptionstring or null
entry_datestring (date) or null
linesarray of NewDraftLine or null
memostring or null
row_versionRequiredinteger

The version you read; a stale one is refused.

DraftVersion

NameTypeDescription
row_versionRequiredinteger

The version you read; a stale one is refused.

EntryOut

NameTypeDescription
amountRequiredstring
created_atstring (date-time) or null

When the entry was posted.

descriptionRequiredstring
documentsarray of DocumentOut

The receipts and invoices attached to the transactions the entry was posted from, oldest first. Empty for an entry with no transaction behind it.

entry_dateRequiredstring (date)
entry_kindRequiredstring

What produced the entry: manual, system, adjusting, opening, closing or reversal.

entry_noRequiredinteger
idRequiredstring

An id that starts with je_.

importedEntryImportOut or null

Where the entry's transactions were imported from and who brought them in. Null for an entry with no imported transaction behind it.

linesRequiredarray of LineOut
memoRequiredstring or null
originsarray of EntryOriginOut

What the entry was posted from. Empty for an entry written by hand, an opening or closing entry, and a reversal.

periodstring or null

The accounting period the entry is in, as YYYY-MM.

replaced_by_entry_idstring or null

An id that starts with je_.

replaced_by_entry_nointeger or null

That replacement's number, as people cite it.

replaces_entry_idRequiredstring or null

An id that starts with je_.

replaces_entry_nointeger or null

The number of the entry this one replaced, as people cite it.

reversed_by_entry_idstring or null

An id that starts with je_.

reversed_by_entry_nointeger or null

That reversal's number, as people cite it.

reverses_entry_idRequiredstring or null

An id that starts with je_.

reverses_entry_nointeger or null

The number of the entry a reversal undoes, as people cite it.

sourceRequiredstring
statusRequiredstringOne of posted, reversed

NewDraftLine

A draft's line. It may leave out a dimension its account requires: that is asked for when the draft posts (dimension_required). A value that is not of the dimension named is refused now (dimension_invalid). A foreign amount is kept as given and held to the line's amount when the draft posts (foreign_amount_mismatch); a currency LedgerIt does not know is refused now.

NameTypeDescription
account_idRequiredstring

An id that starts with gla_.

amountRequirednumber | string
dimensionsarray of LineDimensionIn

At most one value per dimension, kept with the line and posted with it.

directionRequiredstringOne of debit, credit
foreignForeignIn or null

For a line that moved in another currency: that currency, the amount in it and the rate. amount must be that amount at that rate, to the books' minor unit; refused with foreign_amount_mismatch otherwise.

memostring or null
party_idstring or null

An id that starts with party_.

DraftLineOut

NameTypeDescription
account_codeRequiredstring
account_idRequiredstring

An id that starts with gla_.

account_nameRequiredstring
amountRequiredstring
dimensionsarray of LineDimensionOut

The line's value for each dimension it names, by key.

directionRequiredstringOne of debit, credit
foreignForeignOut or null

What the line moved in, when not the books' own currency. Kept as given: whether amount is that amount at that rate is asked when the draft posts.

line_noRequiredinteger
memoRequiredstring or null
party_idstring or null

An id that starts with party_.

DocumentOut

NameTypeDescription
content_typeRequiredstring or null
created_atRequiredstring (date-time)
idRequiredstring

An id that starts with doc_.

kindRequiredstring
sourceRequiredstring
storedRequiredboolean
urlRequiredstring or null

EntryImportOut

Where the transactions behind an entry were brought in from, and by whom: the answer to "imported from where?".

NameTypeDescription
actor_avatar_urlstring or null

That member's profile picture, when they have one.

actor_emailstring or null

That member's email, while they are still in the books.

actor_idstring or null

An id that starts with usr_.

actor_kindRequiredstring

user when a member brought it in, system when a connection synced it.

One of user, system, model
actor_namestring or null

That member's name, when known.

labelstring or null

The import's own name: an uploaded file's name.

sourceRequiredstring

The connector it came from, such as stripe, or the format of a statement file a person uploaded, such as csv.

LineOut

NameTypeDescription
account_codeRequiredstring
account_idRequiredstring

An id that starts with gla_.

account_nameRequiredstring
amountRequiredstring
dimensionsarray of LineDimensionOut

The line's value for each dimension it names, by key.

directionRequiredstringOne of debit, credit
foreignForeignOut or null

What the line moved in, when not the books' own currency.

idRequiredstring

An id that starts with jel_.

memoRequiredstring or null
party_idstring or null

An id that starts with party_.

party_logo_urlstring or null

The party's logo, square PNG; null for none.

party_namestring or null

The party's name.

EntryOriginOut

What an entry was posted from: the step back from the books toward the evidence.

NameTypeDescription
descriptionRequiredstring
idRequiredstring

The transaction's id, or the schedule's.

kindRequiredstring

transaction: a bank, card or processor movement that was filed. schedule: one period of a recognition schedule.

One of transaction, schedule

LineDimensionIn

NameTypeDescription
dimension_idRequiredstring

An id that starts with dim_.

value_idRequiredstring

A value of that dimension.

ForeignIn

NameTypeDescription
amountRequirednumber | string

The amount in that currency, unsigned like amount.

currencyRequiredstring

The currency the line moved in, ISO 4217.

rateRequirednumber | string

One unit of it in the books' currency, as booked.

LineDimensionOut

NameTypeDescription
dimension_idRequiredstring

An id that starts with dim_.

dimension_keyRequiredstring

The dimension's key, e.g. department.

dimension_nameRequiredstring
value_codeRequiredstring
value_idRequiredstring

An id that starts with dimv_.

value_nameRequiredstring

ForeignOut

NameTypeDescription
amountRequiredstring
currencyRequiredstring
rateRequiredstring or null

The rate it was booked at; null on a revaluation line.