API reference
Bank statements
Uploaded statements kept as the bank printed them, each line pointing at the transaction it became.
- GET
/v1/bank_statementsList uploaded statements - GET
/v1/bank_statements/{statement_id}Get a statement and its lines - DELETE
/v1/bank_statements/{statement_id}Forget a statement uploaded by mistake - GET
/v1/bank_statements/{statement_id}/ledger_linesList the ledger lines a statement can still be matched to - POST
/v1/bank_statements/{statement_id}/matchMatch a statement to the ledger
Guides: Review and file transactions
List uploaded statements
GET/v1/bank_statements
client.bankStatements.list()
Statements uploaded to these books, the newest first.
Parameters
| Name | Type | Description |
|---|---|---|
account_idQuery | string or null | An id that starts with |
limitQuery | integer | Page size, 1–200. |
cursorQuery | string or null | The |
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/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
| Name | Type | Description |
|---|---|---|
statement_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/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
| Name | Type | Description |
|---|---|---|
statement_idPath · Required | string | An id that starts with |
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 -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
| Name | Type | Description |
|---|---|---|
statement_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/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
| Name | Type | Description |
|---|---|---|
statement_idPath · Required | string | An id that starts with |
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 -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
| Name | Type | Description |
|---|---|---|
dataRequired | array of BankStatementOut | |
has_moreRequired | boolean | |
next_cursorRequired | string or null |
BankStatementDetailOut
| Name | Type | Description |
|---|---|---|
account_idRequired | string | An id that starts with |
closingRequired | string or null | The closing balance the file states, as the ledger reads it (OFX). |
created_atRequired | string (date-time) | |
currencyRequired | string | |
ends_onRequired | string (date) | The last day a line is dated. |
filenameRequired | string or null | |
formatRequired | string | The file it came in: |
idRequired | string | An id that starts with |
linesRequired | integer | |
money_inRequired | string | |
money_outRequired | string | |
openingRequired | string or null | |
starts_onRequired | string (date) | The first day a line is dated. |
statement_linesRequired | array of BankStatementLineOut | |
statusRequired | string |
|
FreeLedgerLineList
| Name | Type | Description |
|---|---|---|
dataRequired | array of FreeLedgerLineOut |
MatchRunOut
| Name | Type | Description |
|---|---|---|
amountRequired | integer | Lines matched one for one by amount, days apart. |
batchedRequired | integer | Groups of statement lines matched to one ledger line. |
feedRequired | integer | Lines matched through the transaction they were imported as. |
reconciledRequired | boolean | Every line is matched. |
splitRequired | integer | Statement lines matched to several ledger lines. |
unmatched_linesRequired | integer | Lines still waiting for a person. |
BankStatementOut
| Name | Type | Description |
|---|---|---|
account_idRequired | string | An id that starts with |
closingRequired | string or null | The closing balance the file states, as the ledger reads it (OFX). |
created_atRequired | string (date-time) | |
currencyRequired | string | |
ends_onRequired | string (date) | The last day a line is dated. |
filenameRequired | string or null | |
formatRequired | string | The file it came in: |
idRequired | string | An id that starts with |
linesRequired | integer | |
money_inRequired | string | |
money_outRequired | string | |
openingRequired | string or null | |
starts_onRequired | string (date) | The first day a line is dated. |
statusRequired | string |
|
BankStatementLineOut
| Name | Type | Description |
|---|---|---|
amountRequired | string | As the statement prints it: money into the account positive, for a bank and a card alike. |
descriptionRequired | string | |
idRequired | string | The line's id: what a match made by hand names. |
line_dateRequired | string (date) | |
line_noRequired | integer | Its line in the file. |
match_id | string or null | An id that starts with |
transaction_idRequired | string or null | An id that starts with |
FreeLedgerLineOut
| Name | Type | Description |
|---|---|---|
amountRequired | string | As the statement prints it: money into the account positive, for a bank and a card alike. |
descriptionRequired | string | The entry's description. |
entry_dateRequired | string (date) | |
entry_idRequired | string | The journal entry it is on. |
entry_noRequired | integer | |
idRequired | string | The journal line's id: what a match made by hand names. |