Recursive Ledger
A Recursive Ledger is a list of Transactions from the perspective of a particular Account, and all the Transactions party to all child Accounts of that Account. Recursive Ledgers are ordered by Transaction time, and include a running Account Balance for every line.
If you request a Recursive Ledger in a unit other than the target Account native unit, or if child Accounts feature heterogenous units, Amatino will compute and return unrealised gains and losses. Find out more in the Unrealised Gains and Losses article
Amatino will return a maximum total of 1,000 Ledger Rows per retrieval request. If the Ledger you define spans more than 1,000 rows, it will be broken into pages you can retrieve seperately.
The Recursive Ledger Object
The Amatino API returns Recursive Ledger objects with the following structure
Root Type
JSON Object
Object Structure
type | JSON Number |
key | "account_id" |
example | 42 |
description | An integer identifier of the Account this Ledger describes |
type | JSON String |
key | "start_time" |
example | "2017-01-01_17:22:16.00000" |
description | Time at which the ledger window starts, in the format YYYY-MM-DD_HH24:MI:SS.US |
type | JSON String |
key | "end_time" |
example | "2018-02-07_17:22:16.51245" |
description | Time at which the ledger window ends, in the format YYYY-MM-DD_HH24:MI:SS.US |
type | JSON Boolean |
key | "recursive" |
example | True |
description | A bool asserting that this is a Recursive Ledger. Always true |
type | JSON String |
key | "generated_time" |
example | "2018-05-02_05:01:54.72941" |
description | Time that this Ledger was computed, in the format YYYY-MM-DD_HH24:MI:SS.US |
type | JSON Number or JSON Null |
key | "global_unit_denomination" |
example | 5 |
description | The id of the Global Unit in which this Ledger is denominated, if applicable |
type | JSON Number or JSON Null |
key | "custom_unit_denomination" |
example | null |
description | The id of the custom unit in which this Ledger is denominated, if applicable. |
type | JSON Number |
key | "page" |
example | 2 |
description | The page number covered by this ledger object |
type | JSON Number |
key | "number_of_pages" |
example | 3 |
description | The number of pages this Ledger covers, in total |
type | JSON Bool |
key | "ordered_oldest_first" |
example | true |
description | True of the ledger presents oldest transactions first, false if newest first |
type | JSON Array |
key | "ledger_rows" |
list objects | Ledger Row |
example | See Ledger Rows |
description | A list of Ledger Row objects |
Retrieve Recursive Ledger
API Path | /accounts/ledger/recursive |
HTTP Method | GET |
Description Descr. | Retrieve a Recursive Ledger for an account or accounts |
Required Headers
Key | X-Signature |
Value | Your Session signature |
Example | "yxATCPRKAAXHNiPctNQPHEGGVJF"... |
Key | X-Session-ID |
Value | An an integer Session ID |
Example | 7449059267091272858 |
Required URL Parameters
Key | entity_id |
Type | string |
Description Descr. | The entity id of the entity from which you wish to retrieve a Ledger |
Example | oB3cjSNKXklkJ4Tb |
Repeatable | No |
Required JSON Data
Root type
JSON Array
Max Array Length
10
Object Structure
type | JSON Number |
key | "account_id" |
example | 42 |
description | The unique integer identifier of the Account for which you would like to retrieve a Recursive Ledger |
type | JSON String or JSON Null |
key | "start_time" |
example | "2018-01-01_00:00:00.00000" |
description | The time at which the Recursive Ledger will start. Specify JSON Null to start at the first Transaction |
type | JSON String or JSON Null |
key | "end_time" |
example | "2018-12-31_00:00:00.00000" |
description | The time at which the Recursive Ledger will end. Specify JSON Null to end at the last Transaction |
type | JSON Number or JSON Null |
key | "page" |
example | 2 |
description | The page to retrieve. Specify JSON Null to retrieve the first page. |
type | JSON Number or JSON Null |
source | /units/list |
key | "global_unit_denomination" |
example | 5 |
description | The id of the Global Unit in which you would like to denominate the Recursive Ledger, if desired. Specify JSON Null both here and in the custom unit to retrieve the transaction in the target Account's native unit. |
type | JSON Number or JSON Null |
source | /custom_units/list |
key | "custom_unit_denomination" |
example | null |
description | The id of the custom unit denomination in which you would like to view the Ledger, if desired. Specify JSON Null both here and in the custom unit to retrieve the Ledger in the target Account's native unit. |
type | JSON Bool |
key | "order_oldest_first" |
example | false |
description | Specify true to order the ledger oldest first, false to reverse. |
Returns
Root Type
JSON Array