Skip to main content
Ledger Entries are the core double-entry transactions in Sintropix. Each entry has a header (date, memo, notes) and at least two balanced lines. This page covers creating, listing, reversing, and unbooking entries, plus Scheduled Entries and line-level updates.
Source: apps/erp-backend/src/ledger-core/ledger/ledger.controller.ts.

GET /api/entities/:entityId/ledger/entries

List Ledger Entries with pagination, filtering, and sorting. Defaults to live entries (active and reversed statuses).
  • Path param: entityId (UUID)
  • Query params: ListLedgerEntriesQueryDto (from listLedgerEntriesQuerySchema)
  • Success response: ledgerEntriesPageSchema{ entries, nextCursor }
  • Status: 200

GET /api/entities/:entityId/ledger/entries/:entryId

Get the full detail of a single Ledger Entry, including lines, related invoices, related bank movements, and allocations.
  • Path params: entityId (UUID), entryId (UUID)
  • Success response: ledgerEntryDetailSchema
  • Status: 200

POST /api/entities/:entityId/ledger/entries

Create a new Ledger Entry. The entry must have at least two lines and total debits must equal total credits. The client supplies the idempotency id.
  • Path param: entityId (UUID)
  • Body: CreateLedgerEntryDto (from createLedgerEntrySchema)
Each line in newLedgerEntryLines:
The transaction trio (currency, amount, rate) must be provided together or omitted together. The rate is a plain decimal string, never a float.
  • Success response: ledgerEntryWithLinesSchema
  • Status: 201

PATCH /api/entities/:entityId/ledger/entries/:entryId

Update an entry’s header fields (date, memo, notes). At least one field must be provided.
  • Path params: entityId (UUID), entryId (UUID)
  • Body: UpdateLedgerEntryDto (from updateLedgerEntrySchema)
  • Success response: ledgerEntrySchema
  • Status: 200

POST /api/entities/:entityId/ledger/entries/:entryId/reverse

Reverse a live Ledger Entry by posting a mirror entry. The reversal date must be after the original entry date and after the ledger lock date.
  • Path params: entityId (UUID), entryId (UUID)
  • Body: ReverseLedgerEntryDto (from reverseLedgerEntrySchema)
  • Success response: reverseLedgerEntryResultSchema{ reversalEntry, reversedEntry, severedInvoices, severedMovements, settledChainEntries }
  • Status: 201

DELETE /api/entities/:entityId/ledger/entries/:entryId

Unbook (soft-delete) a Ledger Entry. The entry status becomes deleted. This severs any linked invoices, bank movements, and allocations. If the entry is a reversal, the chain behind it is settled back to its prior state.
  • Path params: entityId (UUID), entryId (UUID)
  • Success response: unbookLedgerEntryResultSchema{ unbookedEntry, severedInvoices, severedMovements, settledChainEntries }
  • Status: 200

Scheduled Entries

POST /api/entities/:entityId/ledger/scheduled-entries

Schedule a Ledger Entry for future booking. The entry date must be in the future. Scheduled entries cannot carry transaction currency lines.
  • Path param: entityId (UUID)
  • Body: Same shape as CreateLedgerEntryDto
  • Success response: ledgerEntryWithLinesSchema
  • Status: 201

POST /api/entities/:entityId/ledger/scheduled-entries/:entryId/book

Book a Scheduled Entry immediately. The entry date must be on or before today.
  • Path params: entityId (UUID), entryId (UUID)
  • Success response: ledgerEntryWithLinesSchema
  • Status: 200

PATCH /api/entities/:entityId/ledger/scheduled-entries/:entryId

Reschedule a planned entry. Replaces the date, memo, notes, and the entire line set.
  • Path params: entityId (UUID), entryId (UUID)
  • Body: RescheduleLedgerEntryDto (from rescheduleLedgerEntrySchema)
  • Success response: ledgerEntryWithLinesSchema
  • Status: 200

DELETE /api/entities/:entityId/ledger/scheduled-entries/:entryId

Cancel a Scheduled Entry. The entry status becomes cancelled.
  • Path params: entityId (UUID), entryId (UUID)
  • Success response: ledgerEntrySchema
  • Status: 200

Ledger Lines

GET /api/entities/:entityId/ledger/lines

List Ledger Entry Lines. Defaults to live entries only. Optionally filter by partner.
  • Path param: entityId (UUID)
  • Query params: ListLedgerEntryLinesQueryDto (from listLedgerEntryLinesQuerySchema)
  • Success response: Array of listedLedgerEntryLineSchema
  • Status: 200

GET /api/entities/:entityId/ledger/open-item-lines

List Open Item lines for an Open-Item Account with pagination. Shows unsettled lines by default.
  • Path param: entityId (UUID)
  • Query params: ListOpenItemLinesQueryDto (from listOpenItemLinesQuerySchema)
  • Success response: openItemLinesPageSchema{ lines, nextCursor, openTotal, lineCount, partnerOptions }
  • Status: 200

PATCH /api/entities/:entityId/ledger/lines/:lineId/partner

Change the partner on a Ledger Entry Line. null clears the partner.
  • Path params: entityId (UUID), lineId (UUID)
  • Body: UpdateLedgerEntryLinePartnerDto (from updateLedgerEntryLinePartnerSchema)
  • Success response: ledgerEntryLineSchema
  • Status: 200

PATCH /api/entities/:entityId/ledger/lines/:lineId/account

Reclassify a Ledger Entry Line to a different Ledger Account. The line must have no Allocation and no document link, and its entry must be open.
  • Path params: entityId (UUID), lineId (UUID)
  • Body: UpdateLedgerEntryLineAccountDto (from updateLedgerEntryLineAccountSchema)
  • Success response: ledgerEntryLineWithNamedDimensionValuesSchema
  • Status: 200

PUT /api/entities/:entityId/ledger/lines/:lineId/dimension-values

Replace the Dimension Value tags on a Ledger Entry Line. An empty array untags the line.
  • Path params: entityId (UUID), lineId (UUID)
  • Body: UpdateLedgerEntryLineDimensionValuesDto (from updateLedgerEntryLineDimensionValuesSchema)
  • Success response: ledgerEntryLineWithNamedDimensionValuesSchema
  • Status: 200

Domain error codes

Status codes