POST
Reverse a journal entry (organization)
Organization space Accounting module Cannot be undone For: Accountant · Permission: journal_entries.reverse Conditions
  • The accounting module must be included in the plan of the organization.
  • In the organization space the caller needs an accounting access grant on the book named in the URL.
  • The entry must belong to the selected book.
  • An entry that is already reversed cannot be reversed again.
  • An entry that is itself a reversal or a refund, or that has been refunded, cannot be reversed.
  • Closing, result allocation and carry-forward entries of a fiscal year cannot be reversed here; the fiscal year reopen route does it.
  • VAT declaration entries and fiscal event entries cannot be reversed here; their own delete or reverse routes post the correction.
  • An entry with a line on the account of a cash register, a money account or a payment route cannot be reversed generically; a specialized correction is required.
  • Depreciation and asset disposal entries are reversed together with the fixed asset register, and for them accounting_date, when sent, must be the entry’s own date.
  • The entry must not hold a bank match on a statement that is no longer open.
  • The reversal date must fall in a period that is not closed. When the period of the original entry is closed, the reversal is dated the first day of the next open period instead of the requested date. The same shift applies to an entry touching VAT accounts when the VAT of the target period is declared.
  • A date sent in accounting_date that falls in a closed period (while the original’s period is open) is refused.
What else happens
  • Posts a reversing entry with every line direction exchanged, in the same journal, with source type reversal pointing to the original; it has reversal_of_entry_id set.
  • Changes the status of the original entry to reversed.
  • Releases the bank statement matches of the original entry, so those statement lines are unexplained again.
  • Takes the original’s lines out of their matches, reopening the other lines of those groups, and matches them with the reversal lines instead.
  • Copies the analytic allocations of the original onto the reversal.
  • For depreciation and disposal entries, also rolls back the fixed asset register.
  • When a business rule refuses the reversal on an organization or company book, a posting incident is recorded.
Part of Record and correct entries.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

journalEntry
string
required

Identifier of the accounting book (the first path segment; the generated name is misleading). The entry is the second parameter, journal_entry.

journal_entry
string
required

Identifier of the journal entry (27-character KSUID).

Query Parameters

response
enum<string>
default:none

Response mode. Default none; none answers 204 No Content.

Available options:
none,
resource
fields
string

Comma-separated JSON keys of the root resource (id is always rendered). Available: id, owner_type, journal_id, fiscal_period_id, accounting_date, reference, description, source_type, source_id, source_event, metadata, currency_code, currency_exponent, status, reversal_of_entry_id, refund_of_entry_id, posted_at, created_at, updated_at, attachments_count.

include
string

Comma-separated include paths, each optionally followed by its fields in parentheses: units(id,sku),units.uomUnit(id,name). Max depth 6, max 40 paths. Available: lines, lines.account, attachments.

Body

application/json
accounting_date
string<date>

Optional date the reversal counts for (YYYY-MM-DD). Default: the date of the original entry. When the original's period is closed the reversal is dated the first day of the next open period instead; a date in a closed period is refused; for depreciation and disposal entries it must equal the entry's own date.

Response

Resource (only with response=resource).

id

Identifier of the journal entry (27-character KSUID).

owner_type

Kind of book the entry belongs to: organization, company or client.

journal_id

Identifier of the journal the entry is posted in (27-character KSUID).

fiscal_period_id

Identifier of the fiscal period covering the accounting date, set by the server (27-character KSUID).

accounting_date

Date the entry counts for in the books (YYYY-MM-DD).

reference

Free-text reference given at posting, or copied from the original entry on a reversal; null when none.

description

Free-text description given at posting; on a reversal, a text naming the original entry; null when none.

source_type

Kind of record that generated the entry (for example reversal, opening_balances or recurring_entry, or a business flow); null for a manual entry.

source_id

Identifier of the record that generated the entry; null for a manual entry.

source_event

Event of the source record that generated the entry (for example reversed, opening or run: for a recurring occurrence); null for a manual entry.

metadata
object | null

Extra data stored by automatic postings, such as fee snapshots or the company identifier; null for most manual entries.

currency_code

ISO 4217 currency code of the entry, taken from the fiscal year (for example XOF).

currency_exponent
integer

Number of decimal places of the currency (0 for XOF). An amount in minor units divided by 10 to this power gives the amount in the currency.

status

State of the entry: posted (in force), reversed (cancelled by a reversal entry) or refunded (refunded by a refund entry).

reversal_of_entry_id

When the entry is a reversal, the identifier of the entry it cancels; otherwise null.

refund_of_entry_id

When the entry is a refund, the identifier of the entry it refunds; otherwise null.

posted_at

Moment the entry was posted, ISO 8601, set by the server.

lines
array

Debit and credit lines of the entry. Present only when requested with include=lines; amounts are integers in minor units (divide by 10 to the power currency_exponent).

attachments_count
integer

Number of supporting documents attached to the entry.

attachments
array

Supporting documents of the entry. Present only when requested with include=attachments and the caller holds the entry_attachments.list permission.

created_at

Date and time the record was created (ISO 8601, UTC).

updated_at

Date and time the record was last changed (ISO 8601, UTC).