Skip to content

Where did this come from? Trace a statement line, a posting or an entry back to its document

GET
/v1/entities/{entity_id}/provenance
curl --request GET \
--url https://example.com/v1/entities/example/provenance
entity_id
required
Entity Id

The entity this path is relative to

string

The entity this path is relative to

line_id
Any of:
string

A statement line

posting_id
Any of:
string

One leg of an entry

entry_id
Any of:
string

A whole entry

Successful Response

Media typeapplication/json
Provenance

The answer to “where did this come from?”: the actual document, or nothing.

For a statement line, the answer is the document it was read off. For a posting or an entry, it is the lines behind it, and so their documents. A subject this entity does not hold is a 404; an empty lines list means the subject exists but nothing links it to a document yet.

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
subject
required
ProvenanceSubject
object
kind
required
Kind
string
id
required
Id
string
lines
required
Lines
Array<object>
ProvenanceLine

One statement line traced back to the document it was read off.

object
line_id
required
Line Id
string
line_no
required
Line No
integer
source_key
required
Source Key
string
content_hash
required
Content Hash
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]*)$/
description
required
Description
string
reference
required
Any of:
string
currency
required
Currency
string
raw
required
Raw
string
statement_id
required
Statement Id
string
account_id
required
Account Id
string
commodity
required
Commodity
string
period_start
required
Period Start
string
period_end
required
Period End
string
statement_live
required
Statement Live
boolean
document_id
required
Document Id
string
document
required
DocumentView

The original document as a reader sees it: what identifies it, and whether it can be opened here.

There is deliberately no blob_path (removed in issue 0007): a server-local path is no use to a reviewer and discloses where the service keeps files. storage says instead whether the bytes are available: stored means GET /documents/{id}/content will hand them over, external means only external_ref exists and the document is held elsewhere.

object
sha256
required
Sha256

SHA-256 of the registered bytes, and the document’s identity

string
filename
required
Filename
string
media_type
required
Media Type
string
size_bytes
required
Size Bytes
integer
storage
required
Storage

Stored | external

string
external_ref
required
Any of:
string
allocations
required
Allocations
Array<object>
ProvenanceAllocation
object
allocation_id
required
Allocation Id
string
explanation_id
required
Explanation Id
string
kind
required
Kind
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]*)$/
links
required
Links
object
key
additional properties
string
evidence
required
Evidence
Array<object>
ProvenanceEvidence
object
evidence_id
required
Evidence Id
string
entry_id
required
Any of:
string
statement_id
required
Any of:
string
page
required
Any of:
integer
locator
required
Locator
string
caption
required
Caption
string
document_id
required
Document Id
string
document
required
DocumentView

The original document as a reader sees it: what identifies it, and whether it can be opened here.

There is deliberately no blob_path (removed in issue 0007): a server-local path is no use to a reviewer and discloses where the service keeps files. storage says instead whether the bytes are available: stored means GET /documents/{id}/content will hand them over, external means only external_ref exists and the document is held elsewhere.

object
sha256
required
Sha256

SHA-256 of the registered bytes, and the document’s identity

string
filename
required
Filename
string
media_type
required
Media Type
string
size_bytes
required
Size Bytes
integer
storage
required
Storage

Stored | external

string
external_ref
required
Any of:
string
line_count
required
Line Count
integer
links
required
Links
object
key
additional properties
string

Example

{
"lines": [
{
"amount_micros": "-12000000",
"allocations": [
{
"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": {}
}
}