API reference
Report runs
Reports kept as they stood, produced again figure for figure after later corrections and reopened months.
- GET
/v1/report_runsList kept reports - POST
/v1/report_runsKeep a report - GET
/v1/report_runs/{run_id}Produce a kept report again - GET
/v1/report_runs/{run_id}/explainExplain a figure in a kept report
Guides: Read and export reports
List kept reports
GET/v1/report_runs
client.reportRuns.list()
Kept reports, the newest first: those kept by hand, and those each close kept of its month.
Parameters
| Name | Type | Description |
|---|---|---|
reportQuery | string or null | Only runs of this report. trial_balance, balance_sheet, income_statement, cash_flow, board_pack |
close_run_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/report_runs" \
-H "Authorization: Bearer $LEDGERIT_TOKEN"Keep a report
POST/v1/report_runs· Idempotent
client.reportRuns.create()
Keep a report as it stands now: the books read through their latest posting sequence, and the manifest recorded so it can be produced again exactly. Any member may keep one, a viewer included; a read-only API key may not, since keeping is a write.
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 POST "https://api.ledgerit.ai/v1/report_runs" \
-H "Authorization: Bearer $LEDGERIT_TOKEN" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"report":"trial_balance"}'Produce a kept report again
GET/v1/report_runs/{run_id}
client.reportRuns.get()
A kept report, produced again from its manifest, with whether it says exactly what it said when it was kept.
Parameters
| Name | Type | Description |
|---|---|---|
run_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/report_runs/{run_id}" \
-H "Authorization: Bearer $LEDGERIT_TOKEN"Explain a figure in a kept report
GET/v1/report_runs/{run_id}/explain
client.reportRuns.explain()
Why a figure in a kept report is what it is: every journal line behind it, read through the posting sequence the report was, with the entry each belongs to and the transactions and documents behind that entry. Name an account, or a figure.
For a report over a window (the income statement, the cash flow statement, a board pack's figures) the figure is what the lines moved, closing entries left out. For a report as of a day (the balance sheet, the trial balance) and for cash, it is the balance on the day: the opening balance, then the lines of the month the day ends. The newest 500 lines are listed.
Parameters
| Name | Type | Description |
|---|---|---|
run_idPath · Required | string | An id that starts with |
account_idQuery | string or null | An id that starts with |
figureQuery | string or null | A figure that is not one account's: cash, mrr |
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/report_runs/{run_id}/explain" \
-H "Authorization: Bearer $LEDGERIT_TOKEN"Objects
The objects these operations take and return.
ReportRunPage
| Name | Type | Description |
|---|---|---|
dataRequired | array of ReportRunOut | |
has_moreRequired | boolean | |
next_cursorRequired | string or null |
ReportRunCreate
| Name | Type | Description |
|---|---|---|
as_of | string (date) or null | For the trial balance and the balance sheet: the day. Defaults to today. |
reportRequired | string |
trial_balance, balance_sheet, income_statement, cash_flow |
since | string (date) or null | For the income statement and the cash flow statement: the first day. Defaults to this month's first. |
until | string (date) or null | For the income statement and the cash flow statement: the last day. Defaults to today. |
ReportRunWithReportOut
A run with the report it keeps, produced again from its manifest.
| Name | Type | Description |
|---|---|---|
artifact_hashRequired | string | The sha256 of what the report said. |
balance_sheet | BalanceSheetOut or null | |
board_pack | BoardPackFiguresOut or null | |
cash_flow | CashFlowStatementOut or null | |
close_run_idRequired | string or null | An id that starts with |
created_byRequired | string or null | An id that starts with |
definition_versionRequired | integer | The version of the report's definition it was made under. |
idRequired | string | An id that starts with |
income_statement | IncomeStatementOut or null | |
parametersRequired | object | What it was asked for. |
periodRequired | string | The day ( |
recorded_atRequired | string (date-time) | |
reportRequired | string | One of trial_balance, balance_sheet, income_statement, cash_flow, board_pack |
reproduced_hashRequired | string | The sha256 of the report as produced now from the manifest. |
reproducesRequired | boolean | True when its figures are exactly what they were when it was kept. Since definition version 2 an account renamed in between does not count against it. |
through_sequenceRequired | integer | The books were read as posted through this sequence, and no further. |
trial_balance | TrialBalanceOut or null |
ExplanationOut
Why a figure in a kept report is what it is: the journal lines it adds up from, read through the same posting sequence the report was, so they add up to the kept figure after any later posting or reopen.
| Name | Type | Description |
|---|---|---|
accountsRequired | array of ExplanationAccountOut | The accounts the figure is read from: the account and every account beneath it, or every cash account. |
closing_balanceRequired | string | The balance on |
currencyRequired | string | |
figureRequired | string | What the report says: the closing balance, or what moved. |
kindRequired | string |
balance, movement |
linesRequired | array of ExplanationLineOut | Oldest first. |
opening_balanceRequired | string | The balance before |
reportRequired | string | One of trial_balance, balance_sheet, income_statement, cash_flow, board_pack |
report_run_idRequired | string | An id that starts with |
sinceRequired | string (date) | |
subjectRequired | string | What is explained: the account asked for, or a figure ( account, cash, mrr |
through_sequenceRequired | integer | Every line here was posted at or before this sequence. |
truncatedRequired | boolean | True when older lines were left out; the opening balance is then what stood before the oldest line shown, so the lines still add up. |
untilRequired | string (date) |
ReportRunOut
A kept report's manifest.
| Name | Type | Description |
|---|---|---|
artifact_hashRequired | string | The sha256 of what the report said. |
close_run_idRequired | string or null | An id that starts with |
created_byRequired | string or null | An id that starts with |
definition_versionRequired | integer | The version of the report's definition it was made under. |
idRequired | string | An id that starts with |
parametersRequired | object | What it was asked for. |
periodRequired | string | The day ( |
recorded_atRequired | string (date-time) | |
reportRequired | string | One of trial_balance, balance_sheet, income_statement, cash_flow, board_pack |
through_sequenceRequired | integer | The books were read as posted through this sequence, and no further. |
BalanceSheetOut
| Name | Type | Description |
|---|---|---|
as_ofRequired | string (date) | |
assetsRequired | BalanceSheetSectionOut | |
balancedRequired | boolean | |
currencyRequired | string | |
differenceRequired | string | |
equityRequired | BalanceSheetSectionOut | |
liabilitiesRequired | BalanceSheetSectionOut | |
total_assetsRequired | string | |
total_liabilities_and_equityRequired | string |
BoardPackFiguresOut
What a month's board pack says in figures, every one read from the books through the same posting sequence.
| Name | Type | Description |
|---|---|---|
arrRequired | string | MRR times twelve. |
burningRequired | boolean | True when the trailing net burn is above zero. |
cashRequired | string | Cash across every cash account at the end of the month. |
currencyRequired | string | The books' currency, as an ISO 4217 code. |
gross_burnRequired | string or null | Operating cash that left in the month, as a positive figure. Null before the books began. |
gross_marginRequired | string or null | Gross profit over revenue, as a fraction (0.9 = 90%); null with no revenue. |
monthsRequired | array of BurnMonthOut | Burn for up to six complete months, oldest first, ending with this one; months before the books began are left out. |
mrrRequired | string | Subscription revenue recognized in the month, as Home reads it. |
mrr_monthRequired | string (date) | The month MRR is for: this one, by its first day. |
net_burnRequired | string or null | The month's gross burn less its operating inflows. Positive means more went out than came in. |
net_incomeRequired | string | Net income in the month. |
operating_expensesRequired | string | Operating expenses in the month. |
revenueRequired | string | Revenue in the month, from the income statement. |
runway_monthsRequired | string or null | Months of cash at the trailing net burn, to one decimal; null when not burning. |
sinceRequired | string (date) | The month's first day. |
trailing_monthsRequired | integer | How many months |
trailing_net_burnRequired | string or null | Average net burn of the three complete months ending with this one: what runway divides by. The figure Home shows as net burn. |
untilRequired | string (date) | The month's last day. |
CashFlowStatementOut
| Name | Type | Description |
|---|---|---|
balancedRequired | boolean | |
beginning_cashRequired | string | |
currencyRequired | string | |
differenceRequired | string | |
ending_cashRequired | string | |
net_changeRequired | string | |
net_incomeRequired | string | |
sectionsRequired | array of CashFlowSectionOut | |
sinceRequired | string (date) | |
untilRequired | string (date) |
IncomeStatementOut
| Name | Type | Description |
|---|---|---|
cost_of_revenueRequired | string | |
currencyRequired | string | |
gross_marginRequired | string or null | |
gross_profitRequired | string | |
net_incomeRequired | string | |
operating_expensesRequired | string | |
operating_incomeRequired | string | |
other_expenseRequired | string | |
other_incomeRequired | string | |
revenueRequired | string | |
sectionsRequired | array of IncomeSectionOut | |
sinceRequired | string (date) | |
untilRequired | string (date) |
TrialBalanceOut
| Name | Type | Description |
|---|---|---|
as_ofRequired | string (date) | |
balancedRequired | boolean | |
currencyRequired | string | |
differenceRequired | string | |
rowsRequired | array of TrialBalanceRowOut | |
total_creditsRequired | string | |
total_debitsRequired | string |
ExplanationAccountOut
| Name | Type | Description |
|---|---|---|
codeRequired | string | |
idRequired | string | An id that starts with |
nameRequired | string |
ExplanationLineOut
One journal line behind the figure, with the entry it belongs to and the evidence behind that entry.
| Name | Type | Description |
|---|---|---|
account_idRequired | string | An id that starts with |
amountRequired | string | |
descriptionRequired | string | |
directionRequired | string | One of debit, credit |
document_idsRequired | array of string | The receipts and invoices that support them. |
entry_dateRequired | string (date) | |
entry_idRequired | string | The journal entry to cite. |
entry_noRequired | integer | |
line_idRequired | string | An id that starts with |
memoRequired | string or null | |
signed_amountRequired | string |
|
sourceRequired | string | How the entry was written: |
transaction_idsRequired | array of string | The bank, card or processor transactions the entry was filed from. |
BalanceSheetSectionOut
| Name | Type | Description |
|---|---|---|
linesRequired | array of BalanceSheetLineOut | |
totalRequired | string |
BurnMonthOut
| Name | Type | Description |
|---|---|---|
completeRequired | boolean | False for the current month, which is month to date. |
gross_burnRequired | string | Operating cash that left in the month, as a positive figure. |
monthRequired | string (date) | The first day of the month. |
net_burnRequired | string | Gross burn less operating inflows. Positive means more went out than came in. |
operating_inflowsRequired | string | Operating cash that came in during the month, as a positive figure. |
CashFlowSectionOut
| Name | Type | Description |
|---|---|---|
keyRequired | string | |
linesRequired | array of CashFlowLineOut | |
nameRequired | string | |
totalRequired | string |
IncomeSectionOut
| Name | Type | Description |
|---|---|---|
groupsRequired | array of IncomeGroupOut | |
keyRequired | string | |
nameRequired | string | |
totalRequired | string |
TrialBalanceRowOut
| Name | Type | Description |
|---|---|---|
account_idRequired | string | An id that starts with |
codeRequired | string | |
creditRequired | string | |
debitRequired | string | |
nameRequired | string | |
typeRequired | string |
BalanceSheetLineOut
| Name | Type | Description |
|---|---|---|
account_idRequired | string or null | An id that starts with |
amountRequired | string | |
codeRequired | string | |
nameRequired | string |
CashFlowLineOut
| Name | Type | Description |
|---|---|---|
account_idRequired | string | An id that starts with |
amountRequired | string | |
codeRequired | string | |
nameRequired | string |
IncomeGroupOut
| Name | Type | Description |
|---|---|---|
codeRequired | string | |
linesRequired | array of IncomeLineOut | |
nameRequired | string | |
totalRequired | string |
IncomeLineOut
| Name | Type | Description |
|---|---|---|
account_idRequired | string | An id that starts with |
amountRequired | string | |
codeRequired | string | |
nameRequired | string |