The income statement and balance sheet of a period, arranged and signed by the service
const url = 'https://example.com/v1/entities/example/reports/statements?comparative=true';const options = {method: 'GET'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://example.com/v1/entities/example/reports/statements?comparative=true'Return the statements the PDF is drawn from, as JSON, so a screen and an emailed document cannot disagree.
This is the canonical shaped view from issue 0008 section B. Sections, their order, signs, subtotals, the
result row and whether the two sides of the sheet meet are decided once in haddon.statements.shape. The
interface reads that arrangement instead of rebuilding it, and the PDF is drawn from the same view.
difference and its per-column checks are part of the output, which keeps JSON, interface and PDF in
agreement mid-period when equity carries a result nothing has posted to it.
Every commodity the period holds comes back shaped, the requested one first. other_commodities names the
rest, so a reader is told what a single-commodity statement leaves out.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The entity this path is relative to
The entity this path is relative to
Query Parameters
Section titled “Query Parameters”Show the period before this one beside it, when these books hold one
Show the period before this one beside it, when these books hold one
Responses
Section titled “Responses”Successful Response
object
The commodity the document leads with: the one requested, or the base one
object
object
The sign convention and the commodities this document does not show
One shaped income statement and balance sheet per commodity these books hold in the period
object
object
This commodity’s own bottom line, said rather than left to the sign; a document of several commodities has one label per commodity
object
Signed integer micro-units (millionths) as a base-10 string; never a JSON number.
object
Signed integer micro-units (millionths) as a base-10 string; never a JSON number.
object
object
Signed integer micro-units (millionths) as a base-10 string; never a JSON number.
object
Signed integer micro-units (millionths) as a base-10 string; never a JSON number.
Signed integer micro-units (millionths) as a base-10 string; never a JSON number.
Signed integer micro-units (millionths) as a base-10 string; never a JSON number.
One entry per column shown: assets less the two sides funding them, which is zero on a balanced journal at every date
object
Signed integer micro-units (millionths) as a base-10 string; never a JSON number.
object
Example
{ "statements": [ { "income_statement": { "sections": [ { "total_micros": "-12000000", "groups": [ { "lines": [ { "amount_micros": "-12000000" } ] } ] } ], "result_micros": "-12000000" }, "balance_sheet": { "sections": [ { "total_micros": "-12000000", "groups": [ { "lines": [ { "amount_micros": "-12000000" } ] } ] } ], "total_assets_micros": "-12000000", "total_funding_micros": "-12000000", "difference_micros": "-12000000", "checks": [ { "difference_micros": "-12000000" } ] } } ]}Bad Request
object
Example generated
{ "error": { "code": "example", "message": "example", "retryable": true, "details": [ {} ], "request_id": "example", "next_action": {} }}Unauthorized
object
Example generated
{ "error": { "code": "example", "message": "example", "retryable": true, "details": [ {} ], "request_id": "example", "next_action": {} }}Forbidden
object
Example generated
{ "error": { "code": "example", "message": "example", "retryable": true, "details": [ {} ], "request_id": "example", "next_action": {} }}Not Found
object
Example generated
{ "error": { "code": "example", "message": "example", "retryable": true, "details": [ {} ], "request_id": "example", "next_action": {} }}Conflict
object
Example generated
{ "error": { "code": "example", "message": "example", "retryable": true, "details": [ {} ], "request_id": "example", "next_action": {} }}Precondition Failed
object
Example generated
{ "error": { "code": "example", "message": "example", "retryable": true, "details": [ {} ], "request_id": "example", "next_action": {} }}Unprocessable Content
object
Example generated
{ "error": { "code": "example", "message": "example", "retryable": true, "details": [ {} ], "request_id": "example", "next_action": {} }}Internal Server Error
object
Example generated
{ "error": { "code": "example", "message": "example", "retryable": true, "details": [ {} ], "request_id": "example", "next_action": {} }}Service Unavailable
object
Example generated
{ "error": { "code": "example", "message": "example", "retryable": true, "details": [ {} ], "request_id": "example", "next_action": {} }}