Hanzo
OpenapiBooks

Returns the org's accrual-basis Profit & Loss over an optional (from, to]…

Returns the org's accrual-basis Profit & Loss over an optional (from, to] window of RFC3339 posting times: recognized revenue, matched cost, and the net.

GET /v1/books/pnl

Addresshttps://api.hanzo.ai/v1/books/pnl
MethodGET
Operationget_books_pnl
AuthAuthorization: Bearer $HANZO_API_KEY

Returns the org's accrual-basis Profit & Loss over an optional (from, to] window of RFC3339 posting times: recognized revenue, matched cost, and the net.

Request

3 fields.

FieldInTypeRequiredDescription
sandboxquerystringSandbox reads the org's SANDBOX ledger when it is exactly "true".
fromquerystringFrom is the RFC3339 start of the window, exclusive.
toquerystringTo is the RFC3339 end of the window, inclusive.

Response

StatusBodyMeaning
200PnLok

200 body — 15 fields.

FieldInTypeAlwaysDescription
expensebodyPnLLine[]Expense is the cost lines that moved in the period, one per account.
expense[].accountbodystringAccount is the chart-of-accounts number this line reports on.
expense[].amountbodyintegerAmount is the account's movement over the period in whole cents, in its NATURAL sign: positive when the account behaved normally, for income and expense alike.
expense[].namebodystringName is that account's human name from the fixed chart.
expense[].typebodystringType is the account's fundamental class, which on this statement is always income or expense — it tells a reader which half of the statement the line came from…
frombodystringFrom opens the period and is EXCLUSIVE — movement strictly after it, matching the trial balance's opening boundary so the two reports agree on what belongs to…
incomebodyPnLLine[]Income is the revenue lines that moved in the period, one per account.
income[].accountbodystringAccount is the chart-of-accounts number this line reports on.
income[].amountbodyintegerAmount is the account's movement over the period in whole cents, in its NATURAL sign: positive when the account behaved normally, for income and expense alike.
income[].namebodystringName is that account's human name from the fixed chart.
income[].typebodystringType is the account's fundamental class, which on this statement is always income or expense — it tells a reader which half of the statement the line came from…
netIncomebodyintegerNetIncome is totalIncome minus totalExpense, in cents.
tobodystringTo closes the period and is inclusive.
totalExpensebodyintegerTotalExpense is cost MATCHED to that revenue, in cents, including accrued infrastructure that has not been billed yet.
totalIncomebodyintegerTotalIncome is revenue RECOGNIZED in the period, in cents — accrual, not cash, so a prepaid top-up is not in it until the credit is consumed.

Failure carries the platform error shape — see Errors.

Examples

hanzo books pnl

Books API · All Hanzo APIs · Interactive reference

How is this guide?

On this page