JSON API: Journal Queries
Journal queries are used to obtain a list of the sub-journals defined in the ledger.
Refer to the journal query schema for a formal definition of the request and the journal query response schema for a definition of the response.
Sub-journals are retrieved by code and/or name. There are two ways to select results by code: the
range
andrangeEnding
properties specify the first and last code to retrieve, respectively.
Alternatively, the codes
array can be used to select or exclude specific codes and code ranges.
The names
property can be used to select names by content or language, including wildcard and
exclusion. See Range Selectors for more information on ranges with examples.
The page size limit
is capped by the ledger configuration. If a request is made for more records
than the configured limit, then only the configured maximum page size will be returned.
Route: journal/query
Request all journals in sets of 10:
{
"limit": 10
}
Request a single journal:
{
"codes": ["SALES"]
}
Request all journals containing "tax":
{
"names": {
"name": "%tax%",
"like": true
}
}
Sample result:
{
"journals": [
{
"code": "SALES",
"uuid": "2d81f859-8e5b-4a84-b866-4d99b62ecfe3",
"names": [
{
"name": "Sales Journal",
"language": "en",
"createdAt": "2021-12-22T05:28:27.776353Z",
"updatedAt": "2021-12-22T05:28:27.776353Z"
}
],
"revision": "7180c8d8abd512082ae522a0556d8d55432e6cc932e531799c8a25c95efc58de",
"createdAt": "2022-01-18T16:10:17.036247Z",
"updatedAt": "2022-01-18T16:10:17.036247Z"
}
],
"after": "2ec47cc3-6117-40f8-adaf-d1067caf04b0",
"time": "2022-01-18T16:10:58.021722Z"
}