Skip to content

Statement lines across every statement, by date: what each is and what it was booked to

GET
/v1/entities/{entity_id}/lines
curl --request GET \
--url https://example.com/v1/entities/example/lines

List lines across every statement over a date range, with what became of each and its entries.

GET /statements/{id}/lines reads one document in printed order. This reads by time: every line of every statement in the range, ordered by date and then document order, the way somebody reviewing a period reads it.

state is applied after the page is read, because a line’s status is not a column. It is derived from the chain of explanations written for the line, their allocations, the entries behind them and whether the line’s statement has been replaced. Doing that in SQL would be a second implementation of lines_repo.line_state that could disagree with the first, which is worse than a short page.

So a page here can hold fewer items than limit, or none, while next_cursor is still set. filtered_after_page lists the filters applied after selection; while it is non-empty, a short page is not the end of the results. Read until next_cursor is null.

entity_id
required
Entity Id

The entity this path is relative to

string

The entity this path is relative to

from
Any of:
string

Inclusive line date (YYYY-MM-DD)

to
Any of:
string

Inclusive line date (YYYY-MM-DD)

account_id
Any of:
string
statement_id
Any of:
string
state
State

Keep only these line statuses; repeat for several

Array<string>

Keep only these line statuses; repeat for several

limit
Any of:
integer
cursor
Any of:
string

Successful Response

Media typeapplication/json
LinePage

Statement lines across every statement, by date: what each one is, and what it was booked to.

object
entity_id
required
Entity Id
string
legal_name
required
Legal Name
string
base_currency
required
Base Currency
string
snapshot_seq
required
Snapshot Seq
integer
items
required
Items
Array<object>
Line

What has become of one statement line.

status is derived from the live explanation, never stored, so there is exactly one answer. unexplained_micros is the remainder, reported in every state including a fully explained line, where it is "0". history is every explanation ever written for this line, oldest first.

object
line_id
required
Line Id
string
statement_id
required
Statement Id
string
statement_live
required
Statement Live
boolean
line_no
required
Line No
integer
source_key
required
Source Key
string
dt
required
Dt
string
amount_micros
required
Amount Micros

Signed integer micro-units (millionths) as a base-10 string; never a JSON number.

string
/^-?(0|[1-9][0-9]*)$/
commodity
required
Commodity
string
account_id
required
Account Id
string
description
required
Description
string
reference
required
Any of:
string
raw
required
Raw
string
status
required
Status

Unexplained | partly_explained | booked | linked | ignored | superseded_input

string
allocated_micros
required
Allocated Micros

Signed integer micro-units (millionths) as a base-10 string; never a JSON number.

string
/^-?(0|[1-9][0-9]*)$/
unexplained_micros
required
Unexplained Micros

Signed integer micro-units (millionths) as a base-10 string; never a JSON number.

string
/^-?(0|[1-9][0-9]*)$/
explanation
required
Any of:
LineExplanation

One thing somebody said about a line. The chain of these is the line’s history.

object
explanation_id
required
Explanation Id
string
line_id
required
Line Id
string
kind
required
Kind

Booked | linked | ignored

string
reason
required
Reason
string
entry_id
required
Any of:
string
correction_id
required
Any of:
string
supersedes_id
required
Any of:
string
allocations
required
Allocations
Array<object>
LineAllocation
object
allocation_id
required
Allocation Id
string
posting_id
required
Posting Id
string
entry_id
required
Entry Id
string
amount_micros
required
Amount Micros

Signed integer micro-units (millionths) as a base-10 string; never a JSON number.

string
/^-?(0|[1-9][0-9]*)$/
allocated_micros
required
Allocated Micros

Signed integer micro-units (millionths) as a base-10 string; never a JSON number.

string
/^-?(0|[1-9][0-9]*)$/
created_at
required
Created At
string
created_by
required
Created By
string
history
required
History
Array<object>
LineExplanation

One thing somebody said about a line. The chain of these is the line’s history.

object
explanation_id
required
Explanation Id
string
line_id
required
Line Id
string
kind
required
Kind

Booked | linked | ignored

string
reason
required
Reason
string
entry_id
required
Any of:
string
correction_id
required
Any of:
string
supersedes_id
required
Any of:
string
allocations
required
Allocations
Array<object>
LineAllocation
object
allocation_id
required
Allocation Id
string
posting_id
required
Posting Id
string
entry_id
required
Entry Id
string
amount_micros
required
Amount Micros

Signed integer micro-units (millionths) as a base-10 string; never a JSON number.

string
/^-?(0|[1-9][0-9]*)$/
allocated_micros
required
Allocated Micros

Signed integer micro-units (millionths) as a base-10 string; never a JSON number.

string
/^-?(0|[1-9][0-9]*)$/
created_at
required
Created At
string
created_by
required
Created By
string
entries
Entries

The entries this line is booked or linked to, oldest first

Array<object>
LineEntry

An entry a statement line is explained by, with the mirror that already reverses it, if any.

object
id
required
Id
string
dt
required
Dt
string
narration
required
Narration
string
status
required
Status
string
origin
required
Origin
string
version
required
Version
integer
code
required
Code
string
comment
required
Comment
string
tags
required
Tags
Array<Array<string>>
created_at
required
Created At
string
created_by
required
Created By
string
postings
required
Postings
Array<object>
Posting
object
id
required
Id
string
seq
required
Seq
integer
account_id
required
Account Id
string
account_path
required
Account Path
string
commodity
required
Commodity
string
amount_micros
required
Amount Micros

Signed integer micro-units (millionths) as a base-10 string; never a JSON number.

string
/^-?(0|[1-9][0-9]*)$/
memo
required
Any of:
string
tax_code
required
Any of:
string
links
required
Links
object
key
additional properties
string
reversed_by
Any of:
string
links
required
Links
object
key
additional properties
string
next_cursor
required
Any of:
string
links
required
Links
object
key
additional properties
string
filtered_after_page
Filtered After Page

Filters that were applied to each row’s derived state after this page was selected. While this is non-empty a page may hold fewer items than limit – even none – with next_cursor still set, and that is not the end of the results: read until next_cursor is null. It is empty when every filter in play was applied by the query itself, and a short page then does mean the last one.

Array<string>

Example

{
"items": [
{
"amount_micros": "-12000000",
"allocated_micros": "-12000000",
"unexplained_micros": "-12000000",
"explanation": {
"allocations": [
{
"amount_micros": "-12000000"
}
],
"allocated_micros": "-12000000"
},
"history": [
{
"allocations": [
{
"amount_micros": "-12000000"
}
],
"allocated_micros": "-12000000"
}
],
"entries": [
{
"postings": [
{
"amount_micros": "-12000000"
}
]
}
]
}
]
}

Bad Request

Media typeapplication/json
ErrorEnvelope
object
error
required
ErrorBody
object
code
required
Code
string
message
required
Message
string
retryable
required
Retryable
boolean
details
required
Details
Array<object>
object
key
additional properties
any
request_id
Any of:
string
next_action
Any of:
object
key
additional properties
any

Example generated

{
"error": {
"code": "example",
"message": "example",
"retryable": true,
"details": [
{}
],
"request_id": "example",
"next_action": {}
}
}

Unauthorized

Media typeapplication/json
ErrorEnvelope
object
error
required
ErrorBody
object
code
required
Code
string
message
required
Message
string
retryable
required
Retryable
boolean
details
required
Details
Array<object>
object
key
additional properties
any
request_id
Any of:
string
next_action
Any of:
object
key
additional properties
any

Example generated

{
"error": {
"code": "example",
"message": "example",
"retryable": true,
"details": [
{}
],
"request_id": "example",
"next_action": {}
}
}

Forbidden

Media typeapplication/json
ErrorEnvelope
object
error
required
ErrorBody
object
code
required
Code
string
message
required
Message
string
retryable
required
Retryable
boolean
details
required
Details
Array<object>
object
key
additional properties
any
request_id
Any of:
string
next_action
Any of:
object
key
additional properties
any

Example generated

{
"error": {
"code": "example",
"message": "example",
"retryable": true,
"details": [
{}
],
"request_id": "example",
"next_action": {}
}
}

Not Found

Media typeapplication/json
ErrorEnvelope
object
error
required
ErrorBody
object
code
required
Code
string
message
required
Message
string
retryable
required
Retryable
boolean
details
required
Details
Array<object>
object
key
additional properties
any
request_id
Any of:
string
next_action
Any of:
object
key
additional properties
any

Example generated

{
"error": {
"code": "example",
"message": "example",
"retryable": true,
"details": [
{}
],
"request_id": "example",
"next_action": {}
}
}

Conflict

Media typeapplication/json
ErrorEnvelope
object
error
required
ErrorBody
object
code
required
Code
string
message
required
Message
string
retryable
required
Retryable
boolean
details
required
Details
Array<object>
object
key
additional properties
any
request_id
Any of:
string
next_action
Any of:
object
key
additional properties
any

Example generated

{
"error": {
"code": "example",
"message": "example",
"retryable": true,
"details": [
{}
],
"request_id": "example",
"next_action": {}
}
}

Precondition Failed

Media typeapplication/json
ErrorEnvelope
object
error
required
ErrorBody
object
code
required
Code
string
message
required
Message
string
retryable
required
Retryable
boolean
details
required
Details
Array<object>
object
key
additional properties
any
request_id
Any of:
string
next_action
Any of:
object
key
additional properties
any

Example generated

{
"error": {
"code": "example",
"message": "example",
"retryable": true,
"details": [
{}
],
"request_id": "example",
"next_action": {}
}
}

Unprocessable Content

Media typeapplication/json
ErrorEnvelope
object
error
required
ErrorBody
object
code
required
Code
string
message
required
Message
string
retryable
required
Retryable
boolean
details
required
Details
Array<object>
object
key
additional properties
any
request_id
Any of:
string
next_action
Any of:
object
key
additional properties
any

Example generated

{
"error": {
"code": "example",
"message": "example",
"retryable": true,
"details": [
{}
],
"request_id": "example",
"next_action": {}
}
}

Internal Server Error

Media typeapplication/json
ErrorEnvelope
object
error
required
ErrorBody
object
code
required
Code
string
message
required
Message
string
retryable
required
Retryable
boolean
details
required
Details
Array<object>
object
key
additional properties
any
request_id
Any of:
string
next_action
Any of:
object
key
additional properties
any

Example generated

{
"error": {
"code": "example",
"message": "example",
"retryable": true,
"details": [
{}
],
"request_id": "example",
"next_action": {}
}
}

Service Unavailable

Media typeapplication/json
ErrorEnvelope
object
error
required
ErrorBody
object
code
required
Code
string
message
required
Message
string
retryable
required
Retryable
boolean
details
required
Details
Array<object>
object
key
additional properties
any
request_id
Any of:
string
next_action
Any of:
object
key
additional properties
any

Example generated

{
"error": {
"code": "example",
"message": "example",
"retryable": true,
"details": [
{}
],
"request_id": "example",
"next_action": {}
}
}