Worked example
A 6-step plan that onboards a portfolio with a funded loan, and the report its preview returned.
A legal entity, its property, a lender, a loan secured by the property, a GET that reads
the new legal entity back, and the loan's activation. This preview ran through the real API
on 2026-11-06. loan_account_id and interest_account_id are the org's existing Notes
Payable and Interest Expense accounts.
The plan
POST /v1/plans/preview
{
"description": "Onboard Harbor Point portfolio",
"steps": [
{ "ref": "e1", "method": "POST", "path": "/v1/legal-entities",
"body": { "name": "Harbor Point Holdings LLC", "entity_type": "llc",
"operations_start_date": "2026-01-01", "status": "active" } },
{ "ref": "p1", "method": "POST", "path": "/v1/properties",
"body": { "code": "HP-100", "name": "Harbor Point Plaza", "legal_entity_id": "$e1/data/id" } },
{ "ref": "b1", "method": "POST", "path": "/v1/parties",
"body": { "name": "Harbor Community Bank", "roles": ["bank"] } },
{ "ref": "l1", "method": "POST", "path": "/v1/loans",
"body": { "legal_entity_id": "$e1/data/id", "name": "Harbor Point Acquisition Loan",
"loan_side": "borrower", "counterparty_id": "$b1/data/id",
"amortization_type": "level_payment",
"commitment_amount": "5000000.00", "funded_amount": "5000000.00",
"origination_date": "2026-01-15", "maturity_date": "2031-01-15",
"loan_account_id": "85a5c46a-fad1-4f19-bff0-355e95813d9f",
"interest_account_id": "b7d1769f-314a-40fa-89b8-46a489bb99ed",
"payment_frequency": "monthly", "payment_day": 15,
"rate_terms": { "rate_type": "fixed", "fixed_rate": 0.0625,
"day_count_convention": "30_360", "effective_from": "2026-01-15" },
"collateral": { "properties": [ { "property_id": "$p1/data/id", "share_pct": "100.0000" } ] } } },
{ "ref": "le", "method": "GET", "path": "/v1/legal-entities/$e1/data/id" },
{ "ref": "a1", "method": "POST", "path": "/v1/loans/$l1/data/id/activate" }
]
}Things to notice:
p1,l1andlereferencee1;l1referencesp1andb1;a1referencesl1in its path.a1references the create stepl1, because the activation answers no id.a1'sresourceis the drawdown document the activation wrote, and itsdiff_summaryline reads "create document". The loan isl1's resource.summary.journal_total_debitis the 5,000,000.00 drawdown;journal_entriesshows its lines.scheduled_effectsshows the jobs that will pick the new loan up (loan_accrual_generation,loan_rate_reset,loan_rolling_window, …).would_fire.eventslists the five events the activation would publish after a commit.- Nothing was kept: afterwards there was no
Harbor Pointlegal entity, no audit row and no new job, only the stored preview.
The report
Trimmed to the parts an agent reads first. The full report also carries every step's
response, all 30 writes entries and 28 scheduled_effects entries.
{
"data": {
"plan_id": "2643af76-4f65-40a9-998a-599a2a9facf3",
"mode": "preview",
"committed": false,
"fingerprint": "sha256:903385a4f17ef906210406d14b9abe07fc049506e8e203fa6c2dd6b99320a3a1",
"summary": {
"ok": 6,
"error": 0,
"skipped": 0,
"tables_touched": {
"legal_entities": 1,
"search_documents": 6,
"parties": 2,
"accounting_periods": 47,
"audit_log": 6,
"idempotency_keys": 5,
"properties": 1,
"party_roles": 1,
"loans": 1,
"loan_rate_terms": 1,
"loan_participants": 1,
"documents": 1,
"document_lines": 2,
"journal_entries": 1,
"journal_lines": 2,
"loan_events": 60,
"financial_events": 12
},
"journal_total_debit": "5000000.00",
"first_error": null
},
"diff_summary": [
"e1: create legal entity 'Harbor Point Holdings LLC' (+2 search documents, +1 parties, +47 accounting periods)",
"p1: create property 'Harbor Point Plaza' (+1 search documents)",
"b1: create party 'Harbor Community Bank' (+1 search documents, +1 party roles)",
"l1: create loan 'Harbor Point Acquisition Loan' (+1 search documents, +1 loan rate terms, +1 loan participants)",
"le: GET /v1/legal-entities/$e1/data/id (no writes)",
"a1: create document '61e6b4aa-b30f-4901-995c-defacdea165b' (+1 search documents, +2 document lines, +1 journal entries, +2 journal lines, +60 loan events, +12 financial events)"
],
"steps": [
{ "ref": "e1", "index": 0, "status": "ok", "http_status": 201,
"resource": { "table": "legal_entities", "id": "163fc920-623a-42e5-99e6-d3ee6686f457" }, "…": "…" },
{ "ref": "a1", "index": 5, "status": "ok", "http_status": 200,
"resource": { "table": "documents", "id": "61e6b4aa-b30f-4901-995c-defacdea165b" },
"response": { "data": { "schedule_entries_count": 60 } }, "duration_ms": 293 },
"… 4 more steps"
],
"writes": [
{"step": "a1", "table": "journal_entries", "op": "insert", "count": 1, "ids": ["72615f40-24d3-46f0-8758-47a7d9a50ad8"]},
{"step": "a1", "table": "loan_events", "op": "insert", "count": 60},
"… 28 more"
],
"journal_entries": [
{
"step": "a1",
"journal_entry_id": "72615f40-24d3-46f0-8758-47a7d9a50ad8",
"legal_entity_id": "163fc920-623a-42e5-99e6-d3ee6686f457",
"source_type": "loan_drawdown",
"entry_date": "2026-01-15",
"total_debit": "5000000.00",
"total_credit": "5000000.00",
"lines": [
{
"account_id": "a6eed9a8-a103-4d1f-929b-6306212c7c6b",
"debit": "5000000.00",
"credit": "0.00"
},
{
"account_id": "85a5c46a-fad1-4f19-bff0-355e95813d9f",
"debit": "0.00",
"credit": "5000000.00"
}
]
}
],
"scheduled_effects": [
{"handler": "loan_accrual_generation", "next_run_at": "2026-11-06T19:48:34.060Z", "acts_on": {"table": "loans", "ids": ["464a666a-05d8-4859-9ef6-89db3c7fe461"], "count": 1}},
{"handler": "loan_late_fee", "next_run_at": "2026-11-06T19:48:36.667Z", "acts_on": {"table": "loan_events", "ids": ["9f305186-1c69-4afb-92b0-7ce0ab33e586", "5318f92b-6836-4a31-99dc-7403599a1e21", "… 18 more, trimmed"], "count": 60}},
{"handler": "loan_rate_reset", "next_run_at": "2026-11-06T19:48:34.060Z", "acts_on": {"table": "loan_rate_terms", "ids": ["da109cf6-9ea1-4d70-b45f-33c8919c831d"], "count": 1}},
{"handler": "loan_rate_reset", "next_run_at": "2026-11-06T19:48:34.060Z", "acts_on": {"table": "loans", "ids": ["464a666a-05d8-4859-9ef6-89db3c7fe461"], "count": 1}},
{"handler": "loan_rolling_window", "next_run_at": "2026-11-06T19:48:35.894Z", "acts_on": {"table": "loans", "ids": ["464a666a-05d8-4859-9ef6-89db3c7fe461"], "count": 1}},
"… 23 more"
],
"would_fire": {
"jobs": [],
"events": [
{"step": "a1", "event": "DocumentCreatedEvent"},
{"step": "a1", "event": "JournalEntryPostedEvent"},
{"step": "a1", "event": "DocumentPostedEvent"},
{"step": "a1", "event": "LoanScheduleGeneratedEvent"},
{"step": "a1", "event": "LoanActivatedEvent"}
]
},
"warnings": [],
"truncated": false
}
}Then
Commit it with { "plan_id": "2643af76-…" } and a fresh Idempotency-Key, read the loan
back, and undo it if anything is wrong. Because the
activation posted a drawdown, that undo is compensating: the drawdown is voided, the loan
becomes cancelled, and both journal entries stay visible in the ledger.