When to use this endpoint

Use this only from the administrative deleted-object recovery workflow after reviewing the deletion record.

Authentication and permissions

Requires the Admin console login check used by shared restore routes; an ordinary CRM session or API key is insufficient. Tenant context still selects the invoice table.

Parameters

ParameterTypeRequiredDescription
idPositive integerYesID of an invoice whose deleted flag is currently 1.

Example request

$result = FM_api('Invoice_restore', ['id' => 981]);

Example response

{
  "ok": 1,
  "type": "invoice",
  "id": 981,
  "label": "INV-981",
  "summary": {"type": "invoice", "id": 981, "num": "INV-981"}
}

Errors and unusual responses

ResponseCondition
{"error":"not logged in"}No authenticated tenant context is available. Invalid signed credentials can be rejected by the dispatcher before the handler runs.
{"error":"deleted invoice not found"}The ID is absent or is not currently soft-deleted.

Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.

Behaviour and edge cases

  • Restoration sets deleted=0 and ddate=0. It does not restore deleted notifications, external sync queue entries, or other side effects of the original deletion.

Side effects

  • Marks the newest active tenant deletion-log entry restored with timestamp, user, and restore-function metadata.

See it in Fieldmotion

CRM1

No direct production CRM1 caller was found for this route.

CRM2

No direct production CRM2 caller was found for this route.

Related endpoints