Subledgers
Subledger grid, balances, and reconcile-now
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.
Required API key scope: read:ledger for reads, write:ledger for reconcile and batch post.
Endpoints
| Method | Path | Description |
|---|---|---|
| GET | /api/ledger/subledgers | List subledger configs and grid (moduleKey, onlyDrift) |
| POST | /api/ledger/subledgers | Batch post or reconcile (action) |
| PATCH | /api/ledger/subledgers | Update subledger config |
| GET | /api/subledgers/{moduleKey}/balance | Live module balances as of a date |
| POST | /api/subledgers/{moduleKey}/reconcile-now | Reconcile one module now |
| GET | /api/subledgers/balance | Combined module balances |
| POST | /api/subledgers/inventory/reconcile | Reconcile inventory subledger |
List and grid
GET /api/ledger/subledgers?entityId={entityId}
Optional query: moduleKey (for example ar, ap, inventory, cap_table), onlyDrift=true for variance-only rows.
Batch post or reconcile
POST /api/ledger/subledgers
Body includes entityId and action (batch post or reconcile). Batch posting applies to ar, ap, and inventory.
Module balance
GET /api/subledgers/{moduleKey}/balance?entityId={entityId}
Optional asOf (ISO date). Allowed moduleKey values include inventory, projects, maintenance, expenses, helpdesk, fleet, manufacturing, and marketing.
Reconcile now
POST /api/subledgers/{moduleKey}/reconcile-now
Runs an on-demand reconcile for that module. Requires write:ledger.