Skip to main content
An Intercompany Entry is one act between two Entities of the same Organization, such as a loan from one company of the group to another. The act books one balanced Ledger Entry in each Entity, both on the same date and with the same memo. It also stores Pairs. Each Pair joins one line of the first Entry with one line of the second: the two halves of one position, such as the receivable in the lender and the payable in the borrower. A consolidated view eliminates the paired lines. The act changes only as a whole. You create it, read it, and unbook it. Nothing edits it in place, and its two Ledger Entries refuse the ordinary Ledger Entry edits. To fix a mistake, unbook the act and create it again. The routes live under the Organization, not under an Entity:
There is no PATCH or PUT on an act, and no /reverse or /unbook sub-route. Those requests return 404. DELETE is the Unbook. It isn’t a hard delete: the act and its Entries stay readable, and their history is kept.
All amounts are integers in the minor unit of the currency (for example, cents). Dates are YYYY-MM-DD strings. Timestamps are ISO 8601 datetimes.
Open in the app. This resource has a page in the Sintropix web app at https://app.sintropix.com/organizations/{organizationId}/intercompany-entries/{intercompanyEntryId}, where each id in braces is the same UUID as in the API route or response. The list is at /organizations/{organizationId}/intercompany-entries, under Intercompañía in the Grupo sidebar. When you mention a record to a user, include that link. See Link to the App for the full URL grammar.

Access

An act holds the books of two Entities, so every route asks for access to the whole Organization:
  • Use an Organization-level API key. Create the key with Todas las empresas in the Empresa selector (see Get an API Key). A key confined to one Entity gets 403 with PERMISSION_DENIED_ERROR on every route on this page, reads included.
  • Writes need a Role that writes. POST and DELETE need the staff or client Role. A viewer can list and read acts, and gets 403 with PERMISSION_DENIED_ERROR on a write. See Access and roles.
  • Send the audit headers on writes. With an API key, POST and DELETE need x-audit-actor and x-audit-reason, like every mutation. See Authentication.
An act the Organization doesn’t hold, including an act of another Organization, returns 404 with INTERCOMPANY_ENTRY_NOT_FOUND_ERROR.

The Intercompany Entry object

The act has no date of its own. The list and the detail add entryDate, the date its two Entries carry.

GET /api/organizations/:organizationId/intercompany-entries

List the Organization’s acts as keyset pages, newest entryDate first. The list includes unbooked acts, with status set to deleted.
  • Path param: organizationId (UUID)
  • Query params:
No other query parameter is accepted. An unknown one returns 400.
  • Success response: a page of acts
  • Status: 200
Each item in intercompanyEntries is the Intercompany Entry object plus:

GET /api/organizations/:organizationId/intercompany-entries/:intercompanyEntryId

Read one act with its two Ledger Entries, their lines, and its Pairs. An unbooked act is still readable.
  • Path params: organizationId (UUID), intercompanyEntryId (UUID)
  • Success response: the Intercompany Entry detail
  • Status: 200
The detail is the Intercompany Entry object plus: Each item in ledgerEntries: A line in a Pair carries the Pair’s id in intercompanyPairId. An unpaired line carries null. Each item in pairs:
The response has the same shape as the create response.

POST /api/organizations/:organizationId/intercompany-entries

Create an act. In one transaction, Sintropix books one Ledger Entry in each of the two Entities, links both to the act, and stores the Pairs. If any check fails, nothing is written.
  • Path param: organizationId (UUID)
  • Body:
Each item in newLedgerEntries: Each line has the fields of a line in POST /api/entities/:entityId/ledger/entries: id, accountId, functionalAmount, side, and optionally partnerId, the transaction trio (transactionCurrency, transactionAmount, transactionFxRate), and dimensionValueIds. Every line id must be new and unique across both Entries. Each item in newIntercompanyPairs: The Pairs follow these rules:
  • One Pair per line. A line is in at most one Pair. A line in no Pair is an ordinary line of its Entry, such as the bank side of a loan.
  • Opposite sides. A Pair is a debit in one Entity and a credit in the other, so the elimination cancels it. Otherwise: 422 with INTERCOMPANY_PAIR_SAME_SIDE_ERROR.
  • Same amount. Both lines carry the same currency and amount. A line in a foreign currency carries it in its transaction trio. Any other line carries it in its functionalAmount, in its Entity’s functional currency. Otherwise: 422 with INTERCOMPANY_PAIR_AMOUNTS_DIFFER_ERROR.
  • One currency per act. The act’s currency is the currency of its first Pair. A Pair in another currency returns 422 with INTERCOMPANY_PAIR_CURRENCY_DIFFERS_ERROR.
  • One rate per Entity. When an Entity takes the act’s currency as a foreign currency, its paired lines carry one rate. "0.9" and "0.90" count as the same rate. Otherwise: 422 with INTERCOMPANY_PAIR_RATES_DIFFER_ERROR, naming the Entity.
  • No Partner on a paired line. Leave partnerId out or null. Sintropix sets it to the Partner that represents the other Entity.
Each Entry also passes every check of an ordinary Ledger Entry, the Lock Date included.
  • Success response: the Intercompany Entry detail, the same shape as the read
  • Status: 201
A Holding lends 5,000,000 CLP to Operaciones. Both Entities keep their books in CLP, so each paired line carries the amount in functionalAmount:
The Pair joins the Holding’s receivable (debit) with the Operaciones payable (credit). The two bank lines stay unpaired.
An act dated on or before the Lock Date of either Entity is refused, and nothing is written:

DELETE /api/organizations/:organizationId/intercompany-entries/:intercompanyEntryId

Unbook the act. In one transaction, Sintropix unbooks both Ledger Entries and sets the act’s status to deleted. Each Entry is unbooked the way DELETE /api/entities/:entityId/ledger/entries/:entryId unbooks one Entry. Either both Entries are unbooked or neither is. This is not a hard delete. The act, its two Entries, their lines, and the Pairs stay readable, with status set to deleted. Their history stays in the Audit Trail.
  • Path params: organizationId (UUID), intercompanyEntryId (UUID)
  • Success response: every row the Unbook changed
  • Status: 200
Like an ordinary Unbook, it also cuts the Allocations and bank Matches that settle the Entries’ lines. The Unbook is refused when:
  • Either Entry is on or before its Entity’s Lock Date. The request returns 409 with LEDGER_ENTRY_UNBOOK_FROZEN_ERROR. params names the Entry, its date, and its Entity’s Lock Date. The act and both Entries stay active.
  • The act is already unbooked. The request returns 409 with INTERCOMPANY_ENTRY_NOT_ACTIVE_ERROR.
A refused Unbook, where the Holding’s Entry falls inside its locked period:

Correct an Intercompany Entry

You can’t edit an act or either of its Entries. To change its date, memo, amounts, accounts, Entities, or Pairs, unbook it and create it again:
1

Read the act

GET /api/organizations/:organizationId/intercompany-entries/:intercompanyEntryId returns what you need to rebuild it: the date, the memo, both Entries with their lines, and the Pairs.
2

Save the Allocations of its Entries

The Unbook removes the Allocations that settle the act’s lines. To keep them, read them first with GET /api/entities/:entityId/ledger/allocations?entryId=:entryId for each Entry. This read only accepts a live Entry, so do it before the Unbook.
3

Unbook it with DELETE

DELETE /api/organizations/:organizationId/intercompany-entries/:intercompanyEntryId unbooks both Entries in one transaction. It isn’t a hard delete. The act and its Entries stay readable with status set to deleted, and the Audit Trail keeps their history.
4

Create the corrected act with POST

Send POST /api/organizations/:organizationId/intercompany-entries with the corrected body. Use new ids for the act, both Entries, and every line. The unbooked act keeps its ids, so reusing the act’s id returns 409 with INTERCOMPANY_ENTRY_ALREADY_EXISTS_ERROR, reusing an Entry id returns 409 with LEDGER_ENTRY_ALREADY_EXISTS_ERROR, and reusing a line id returns 409 with LEDGER_ENTRY_LINE_ALREADY_EXISTS_ERROR.The new lines don’t inherit the old lines’ Dimension values. To keep a line’s tags, send the dimensionValueId of each item in its lineDimensionValues in the new line’s dimensionValueIds. A line sent without dimensionValueIds is created untagged.
5

Restore the Allocations

For each saved Allocation, send POST /api/entities/:entityId/ledger/allocations with a new id, the new line in place of the old one, the same other line, and the same amount. If the correction changed an amount and an Allocation no longer fits the line’s open amount, the request returns 409 with RECONCILIATION_ALLOCATION_AMOUNT_EXCEEDS_OPEN_AMOUNT_ERROR.
If either Entry is on or before its Entity’s Lock Date, the Unbook returns 409 with LEDGER_ENTRY_UNBOOK_FROZEN_ERROR, and you can’t correct the act this way. Book an adjusting act dated in an open period, or ask whoever manages the books to move the Lock Date. These requests don’t exist and return 404:
  • PATCH or PUT /api/organizations/:organizationId/intercompany-entries/:intercompanyEntryId
  • POST /api/organizations/:organizationId/intercompany-entries/:intercompanyEntryId/reverse
  • POST /api/organizations/:organizationId/intercompany-entries/:intercompanyEntryId/unbook
The Ledger Entry routes refuse to edit, unbook, reverse, reclassify, or change the Partner of an act’s Entry on its own. They return 409 with LEDGER_ENTRY_IN_INTERCOMPANY_ENTRY_ERROR, and params.intercompanyEntryId names the act to unbook. You can still tag the Entry’s lines with Dimension values without touching the act.

Find the act of a Ledger Entry

An Entry that belongs to an act says so wherever you meet it:
  • The Ledger Entry object carries intercompanyEntryId, the act’s id, or null for an ordinary Entry.
  • The rows of GET /api/entities/:entityId/ledger/entries and the Entry detail carry otherEntityOfIntercompanyEntry: { id, name } of the act’s other Entity, or null.
  • A line of the general ledger carries the intercompanyEntryId of its Entry.

History

Every create and Unbook is recorded in the Audit Trail. Read an act’s history through either of its Entities:
The act’s changes also show in the Organization Log. Each Entry’s own history is under tableName=ledger_entry and the Entry’s id.

Domain error codes

On create, each Entry can also return any Ledger Entry error of an ordinary create, such as LEDGER_ACCOUNT_NOT_FOUND_ERROR.

Status codes