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.
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
- 200
- 401
- 403
- 404
- 422
- 429
OK
Response Headers
Unauthenticated — the bearer token is missing, revoked, expired, or malformed. Never retry automatically; fix the credential. See the Errors guide.
Forbidden — the token lacks a required scope, the endpoint is not available to API tokens, or the user behind the token lacks the permission. A human must adjust the token scopes or user permissions; do not retry.
Not found — no record with the given identifier (or the route does not exist). Verify the ID before retrying.
Validation failed — the body is a field → messages map (Laravel shape) or the platform envelope with a stable machine-readable code. Fix the payload and resubmit.
Rate limited — platform limit is 1,000 requests/min; individual tokens may carry lower limits. Honor the Retry-After header before retrying. See the Rate Limits guide.