Ledger Accounts

Create ledger account

Changed on

Creates a new ledger account within a ledger.

One ledger account per ledger per account_type (enforced by unique constraint). Currency is inherited from the parent ledger — provide the matching ISO 4217 code. Balance starts at 0 and is maintained atomically by the Ledger Entry system.

post/api/ledger-accounts

Request

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

Request body

account_holder_idstring uuid required
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.

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

Example request

{
  "account_holder_id": "02ef9c5f-29e6-48fc-9ec3-7ed57ed351f6",
  "counterparty_id": "02ef9c5f-29e6-48fc-9ec3-7ed57ed351f6",
  "currency": "",
  "la_type": "account_holder_root",
  "ledger_account_number": "",
  "ledger_id": "02ef9c5f-29e6-48fc-9ec3-7ed57ed351f6",
  "payment_account_id": "02ef9c5f-29e6-48fc-9ec3-7ed57ed351f6",
  "regime": "",
  "status": "active",
  "tenant_id": "02ef9c5f-29e6-48fc-9ec3-7ed57ed351f6"
}

Changes

    • breaking

      added the new required request property

    • warning

      removed the request property

    • warning

      removed the request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property