Skip to main content

Recreate Accounting Transaction

POST 

/api/ledger/entries/:entry/recreate

"Recreate document" for an entry whose remote document was VOIDED or DELETED in the accounting provider (display_status voided — "Synced, Voided" — or removed_in_provider — "Synced, Deleted"). Once a provider document is voided/deleted there is nothing left to update on it, so this reverse+replaces the entry into a fresh UNLINKED draft replacement and mints it from the same source, even though the source itself never changed.

Authorization

Any valid API token can call this endpoint — no specific scope required. Manage tokens.

The dead provider link is RETAINED on the reversed original as the historical record; the replacement starts with NO provider link and is chained via replaced_by_id, so the detail view shows a "Replaces …" link. This action does NOT push and does NOT touch the dead document — the user syncs the fresh draft to push a brand-new document on demand.

Authentication: Requires Bearer token.

Request body: none.

Response: 200 with data.recreate ({ recreated, status, reason, replacement_id }) and data.entry (the now-reversed original). replacement_id is the id of the fresh unlinked draft. recreated is false with reason not_voided (nothing voided to replace), generation_disabled, or source_not_accounting_ready (the source no longer produces an entry). Returns 404 when the entry does not exist.

Permission: requires accounting.sync.

Request

Responses

OK

Response Headers
    Content-Type