Skip to main content
An Allocation settles one debit line against one credit line on an Open-Item Account. The match endpoint lets you auto-allocate a selection of lines. This page covers the full CRUD for Allocations plus the match operation. All amounts are integers in the minor unit of the currency (for example, cents).
Entities with Books. An Allocation, and every pair inside a match, must stay within a single Book (or between two common lines). Crossing Books is refused with RECONCILIATION_ALLOCATION_LINES_IN_DIFFERENT_BOOKS_ERROR for a single Allocation or RECONCILIATION_MATCH_LINES_IN_DIFFERENT_BOOKS_ERROR for a match.
Open in the app. This resource has a page in the Sintropix web app at https://app.sintropix.com/{entityId}/entries/{entryId}, where each id in braces is the same UUID as in the API route or response. Allocations have no page of their own: link the Ledger Entry being settled, or /{entityId}/open-items for the full list. When you mention a record to a user, include that link. See Link to the App for the full URL grammar.

GET /api/entities/:entityId/ledger/allocations

List the Allocations of a set of Ledger Entry Lines. Returns every Allocation where either the debit or credit side is one of the lines in scope. Name the lines directly with lineIds, or pass entryId to read the Allocations of every line of one Ledger Entry in a single request.
  • Path param: entityId (UUID)
  • Query params: pass exactly one of the two below. Passing both, or neither, returns 400.
  • Success response: an array of Allocation objects with the fields below
  • Status: 200
If any id in lineIds is not a line of the Entity, Sintropix returns 404 with LEDGER_ENTRY_LINE_NOT_FOUND_ERROR and the missing lineId in params. If entryId names no live entry of the Entity, Sintropix returns 404 with LEDGER_ENTRY_NOT_FOUND_ERROR.
The single lineId query parameter is no longer accepted. To read the Allocations of one line, pass it as lineIds=$LINE_ID.

POST /api/entities/:entityId/ledger/allocations

Create a single Allocation between two lines. The caller supplies the idempotency id. The debit line must be on the debit side, the credit line on the credit side, both must belong to the same Open-Item Account, and the amount must not exceed either line’s open amount.
  • Path param: entityId (UUID)
  • Body:
  • Success response: the created Allocation object (same fields as the list response)
  • Status: 201

POST /api/entities/:entityId/ledger/allocations/bulk

Create up to 100 Allocations in a single request and transaction. Each element has the body of the single create, including its own client-supplied id. The whole batch runs against the same Open-Item Account constraints as the single-create endpoint.
  • Path param: entityId (UUID)
  • Body: { allocations: [...] }, 1 to 100 elements, each with the fields of the single create
  • Success response: an array of the created Allocation objects (same fields as the list response), in input order
  • Status: 201
Bulk endpoints run as one database transaction. If any element fails validation or a domain rule, the whole batch is rejected and the response identifies the offending element by its zero-based elementIndex.

DELETE /api/entities/:entityId/ledger/allocations/:allocationId

Delete an Allocation. This restores the open amounts of the two lines it settled.
  • Path params: entityId (UUID), allocationId (UUID)
  • Success response: the deleted Allocation object (same fields as the list response)
  • Status: 200

POST /api/entities/:entityId/ledger/allocations/match

Auto-match a selection of Open-Item lines. The selection is split by side, greedily decomposed into debit/credit pairs, and every resulting Allocation is created in one transaction. The selection must contain at least two lines, at least one debit and one credit, and all lines must belong to the same Open-Item Account.
  • Path param: entityId (UUID)
  • Body:
  • Success response: the Allocations written and every line they changed
  • Status: 201
Each item in settledLines:

Domain error codes

Status codes