API reference

Bank statements

Uploaded statements kept as the bank printed them, each line pointing at the transaction it became.

Guides: Review and file transactions

List uploaded statements

GET/v1/bank_statements

client.bankStatements.list()

Statements uploaded to these books, the newest first.

Parameters

NameTypeDescription
account_idQuerystring or null

An id that starts with gla_.

limitQueryinteger

Page size, 1–200.

Default 50
cursorQuerystring or null

The next_cursor of the previous page.

Response

200BankStatementPage

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

Get a statement and its lines

GET/v1/bank_statements/{statement_id}

client.bankStatements.get()

A statement with each line as the bank printed it and the transaction it was imported as.

Parameters

NameTypeDescription
statement_idPath · Requiredstring

An id that starts with stmt_.

Response

200BankStatementDetailOut

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

Forget a statement uploaded by mistake

DELETE/v1/bank_statements/{statement_id}· Idempotent

client.bankStatements.delete()

Forget a statement uploaded by mistake. The transactions its lines were imported as stay in the books; reverse or exclude those on their own. A reconciled statement is refused with statement_not_deletable.

Parameters

NameTypeDescription
statement_idPath · Requiredstring

An id that starts with stmt_.

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/bank_statements/{statement_id}" \
  -H "Authorization: Bearer $LEDGERIT_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)"

List the ledger lines a statement can still be matched to

GET/v1/bank_statements/{statement_id}/ledger_lines

client.bankStatements.ledgerLines()

The ledger lines a statement's lines may still be matched to: posted to its account within four days of its dates, not reversed, and in no standing match. The oldest first.

Parameters

NameTypeDescription
statement_idPath · Requiredstring

An id that starts with stmt_.

Response

200FreeLedgerLineList

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/bank_statements/{statement_id}/ledger_lines" \
  -H "Authorization: Bearer $LEDGERIT_TOKEN"

Match a statement to the ledger

POST/v1/bank_statements/{statement_id}/match· Idempotent

client.bankStatements.match()

Match the statement's lines to the ledger lines on its account: through the transaction each line was imported as, then one for one by amount within four days, then batches of statement lines that are one ledger line, and statement lines split across several. Anything with more than one candidate is left for a person. A statement whose every line is matched is reconciled.

Parameters

NameTypeDescription
statement_idPath · Requiredstring

An id that starts with stmt_.

Response

200MatchRunOut

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/bank_statements/{statement_id}/match" \
  -H "Authorization: Bearer $LEDGERIT_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)"

Objects

The objects these operations take and return.

BankStatementPage

NameTypeDescription
dataRequiredarray of BankStatementOut
has_moreRequiredboolean
next_cursorRequiredstring or null

BankStatementDetailOut

NameTypeDescription
account_idRequiredstring

An id that starts with gla_.

closingRequiredstring or null

The closing balance the file states, as the ledger reads it (OFX).

created_atRequiredstring (date-time)
currencyRequiredstring
ends_onRequiredstring (date)

The last day a line is dated.

filenameRequiredstring or null
formatRequiredstring

The file it came in: csv or ofx.

idRequiredstring

An id that starts with stmt_.

linesRequiredinteger
money_inRequiredstring
money_outRequiredstring
openingRequiredstring or null
starts_onRequiredstring (date)

The first day a line is dated.

statement_linesRequiredarray of BankStatementLineOut
statusRequiredstring

imported, or reconciled once a close relied on it.

FreeLedgerLineList

NameTypeDescription
dataRequiredarray of FreeLedgerLineOut

MatchRunOut

NameTypeDescription
amountRequiredinteger

Lines matched one for one by amount, days apart.

batchedRequiredinteger

Groups of statement lines matched to one ledger line.

feedRequiredinteger

Lines matched through the transaction they were imported as.

reconciledRequiredboolean

Every line is matched.

splitRequiredinteger

Statement lines matched to several ledger lines.

unmatched_linesRequiredinteger

Lines still waiting for a person.

BankStatementOut

NameTypeDescription
account_idRequiredstring

An id that starts with gla_.

closingRequiredstring or null

The closing balance the file states, as the ledger reads it (OFX).

created_atRequiredstring (date-time)
currencyRequiredstring
ends_onRequiredstring (date)

The last day a line is dated.

filenameRequiredstring or null
formatRequiredstring

The file it came in: csv or ofx.

idRequiredstring

An id that starts with stmt_.

linesRequiredinteger
money_inRequiredstring
money_outRequiredstring
openingRequiredstring or null
starts_onRequiredstring (date)

The first day a line is dated.

statusRequiredstring

imported, or reconciled once a close relied on it.

BankStatementLineOut

NameTypeDescription
amountRequiredstring

As the statement prints it: money into the account positive, for a bank and a card alike.

descriptionRequiredstring
idRequiredstring

The line's id: what a match made by hand names.

line_dateRequiredstring (date)
line_noRequiredinteger

Its line in the file.

match_idstring or null

An id that starts with match_.

transaction_idRequiredstring or null

An id that starts with txn_.

FreeLedgerLineOut

NameTypeDescription
amountRequiredstring

As the statement prints it: money into the account positive, for a bank and a card alike.

descriptionRequiredstring

The entry's description.

entry_dateRequiredstring (date)
entry_idRequiredstring

The journal entry it is on.

entry_noRequiredinteger
idRequiredstring

The journal line's id: what a match made by hand names.