TripleBooks
Ledger

Loans

Loan instruments, payments, and modifications

Authentication

Authenticate with Authorization: Bearer ak_... — see API keys. Requests are scoped to one entity. Pass entityId as a query parameter, JSON field, or x-entity-id header. API keys are already pinned to an entity. A mismatched entityId returns 403.

Endpoints

MethodPathDescription
GET/api/ledger/loans?entityId=List loan instruments
POST/api/ledger/loansCreate loan or actions: record-payment, modify
PUT/api/ledger/loansUpdate loan
DELETE/api/ledger/loansDelete loan

List loans

GET /api/ledger/loans?entityId={entityId}

Returns an array of loan instruments for the entity.

[
  {
    "id": "loan_abc123",
    "principal": 100000,
    "interestRate": 0.05,
    "termMonths": 36,
    "status": "active"
  }
]

Create / actions

POST /api/ledger/loans

Create loan — body: { "entityId", "principal", "interestRate", "termMonths", ... }

Actions — body: { "entityId", "action": "record-payment" | "modify", "loanId", ... }

  • record-payment: { "amount", "date", "memo?" }
  • modify: { "principal?", "interestRate?", "termMonths?" }

Update / Delete

PUT /api/ledger/loans — body: { "entityId", "loanId", ...fields }

DELETE /api/ledger/loans — body: { "entityId", "loanId" }

On this page