Ledger
Consolidation
Multi-entity consolidation and groups
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
| Method | Path | Description |
|---|---|---|
| GET | /api/ledger/consolidation?entityId= | Run consolidation |
| GET | /api/ledger/consolidation-groups?entityId= | List consolidation groups |
| POST | /api/ledger/consolidation-groups | Create group |
Run consolidation
GET /api/ledger/consolidation?entityId={entityId}
Query params: entityId, groupId?, periodId?, currency?
Returns consolidated balances or trial balance for the group.
{
"groupId": "grp_abc",
"periodId": "per_xyz",
"accounts": [
{ "accountId": "acc_1", "debit": 100000, "credit": 50000 }
]
}List consolidation groups
GET /api/ledger/consolidation-groups?entityId={entityId}
Returns groups and their member entities.
Create group
POST /api/ledger/consolidation-groups
Body: { "entityId", "name", "memberEntityIds" }