Ledger Accounts

Get ledger account by ID

Changed on

Returns a single ledger account. The balance field reflects the current running total in minor currency units.

get/api/ledger-accounts/{id}

Request

  • Base URL: http://localhost:4100
  • URL: http://localhost:4100/api/ledger-accounts/{id}
  • Auth: none required

Path parameters

idstring uuid required

Ledger account ID

Response

Ledger account

account_holder_idstring uuid required
balanceinteger

Running net balance (credits − debits) in minor currency units. Atomically maintained by the ledger_entry_propagate_to_balances trigger on entry insert/void.

counterparty_idstring uuid nullable

Counterparty this account belongs to (NULL on master roots and PaymentAccount accounts).

currencystring required

ISO 4217 three-letter currency code — inherited from parent Ledger.

idstring uuid
inserted_atstring date-time
la_type'account_holder_root' | 'account_holder_regime_root' | 'counter_party_root' | 'counter_party_regime_root' | 'account_holder_payment_account_root' | 'account_holder_payment_account_regime_root' | 'counter_party_payment_account_root' | 'counter_party_payment_account_regime_root'

Position of this row in the LedgerAccount tree. Combined with regime, determines whether this row is an aggregation root or a regime-specific child. Enforced by the ledger_accounts_la_type_shape_check CHECK constraint.

ledger_account_numberstring nullable

Opaque external SoE identifier (upsert identity)

ledger_idstring uuid required
payment_account_idstring uuid nullable

PaymentAccount this account belongs to (NULL on master roots).

regimestring required

Generic regime discriminator (regulatory regime, fraud regime, …). Regime leaves carry the real regime name; aggregation roots carry the sentinel "root".

status'active' | 'closed' nullable
tenant_idstring uuid
updated_atstring date-time

Example response

{
  "account_holder_id": "02ef9c5f-29e6-48fc-9ec3-7ed57ed351f6",
  "balance": 0,
  "counterparty_id": "02ef9c5f-29e6-48fc-9ec3-7ed57ed351f6",
  "currency": "",
  "id": "02ef9c5f-29e6-48fc-9ec3-7ed57ed351f6",
  "inserted_at": "2020-04-20T16:20:00Z",
  "la_type": "account_holder_root",
  "ledger_account_number": "",
  "ledger_id": "02ef9c5f-29e6-48fc-9ec3-7ed57ed351f6",
  "linked_ledger_accounts": [
    null
  ],
  "payment_account_id": "02ef9c5f-29e6-48fc-9ec3-7ed57ed351f6",
  "regime": "",
  "status": "active",
  "tenant_id": "02ef9c5f-29e6-48fc-9ec3-7ed57ed351f6",
  "updated_at": "2020-04-20T16:20:00Z"
}

Changes

    • breaking

      removed the required property from the response with the status

    • warning

      removed the optional property from the response with the status

    • warning

      removed the optional property from the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the required property to the response with the status