Get a party’s exposure

  GET /ledger/v1/parties/{partyId}/exposure
  

partyId is the party’s UUID. The same party may appear as customer, supplier and owner — the endpoint sums each role separately and nets AR against AP.

  curl "http://localhost:8081/ledger/v1/parties/6f1c…/exposure?receivableAccounts=1500&payableAccounts=2400&timePeriodType=YEAR&timePeriodValue=2026" \
  -H "X-Tenant-ID: org-84120557"
  

Query parameters

ParameterRequiredNotes
receivableAccountsyesCodes/ranges for accounts receivable
payableAccountsyesCodes/ranges for accounts payable
ownerAccountsnoCodes/ranges for owner/equity accounts
timePeriodTypenoDefault YEAR
timePeriodValuenoDefault: current year

Response — 200 OK

  {
  "partyId": "6f1c…",
  "timePeriodType": "YEAR",
  "timePeriodValue": "2026",
  "receivable": 50000,
  "payable": 20000,
  "net": 30000,
  "roles": [
    { "role": "CUSTOMER", "accountCodes": ["1500"], "balance": 50000 },
    { "role": "SUPPLIER", "accountCodes": ["2400"], "balance": -20000 }
  ]
}
  

net = receivable − payable. An owner/COUNTERPARTY balance appears in roles but is excluded from net.

An unknown party — or a party with no activity — returns 200 with zeroes and empty roles, not 404.

StatusCause
400partyId is not a UUID, or invalid account syntax
403No read access to tenant