Subledgers
Subledger management and batch posting
Authentication
Requires session cookie (web app) or API key (x-api-key header). All endpoints are tenant-scoped via entityId.
Endpoints
| Method | Path | Description |
|---|---|---|
| GET | /api/subledgers?entityId= | List subledgers |
| GET | /api/subledgers?entityId=&id= | Get subledger detail with transactions |
| POST | /api/subledgers | Create subledger or post batch |
List subledgers
GET /api/subledgers?entityId={entityId}
Returns an array of subledgers for the entity.
[
{
"id": "sl_abc123",
"name": "AR Subledger",
"type": "accounts_receivable",
"bookId": "book_xyz"
}
]Subledger detail
GET /api/subledgers?entityId={entityId}&id={subledgerId}
Returns subledger with nested transactions.
Create / post batch
POST /api/subledgers
Create subledger — body: { "entityId", "name", "type", "bookId" }
Post batch — body: { "entityId", "action": "post-batch", "subledgerId", "entries": [...] }