When to use this endpoint

Use only for the legacy manual paid-date control after the invoice is marked Paid. It does not record a payment or change status.

Authentication and permissions

The request must use a logged-in CRM session or valid signed API credentials and is scoped to that tenant.

Users whose legacy crm_access mask contains bit 64 receive {"error":"no permission to access api"}. No record-owner check is made.

Parameters

ParameterTypeRequiredDescription
idPositive integerYesActive Paid invoice ID.
valNon-empty stringYesPassed through HTML escaping and stored without date parsing.

Example request

$result = FM_api('Invoice_setPaidDate', ['id' => 981, 'val' => '2026-10-02']);

Example response

{
  "ok": 1
}

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":"invalid invoice date content"}The supplied value is empty after escaping.
{"error":"invoice does not exist"}The invoice is absent or deleted.
{"error":"cannot set paid date unless invoice is marked Paid"}The active invoice is not Paid.

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

Behaviour and edge cases

  • The value is not parsed as a date. The endpoint does not adjust paid, change status, or create an invoice-payment row.

Side effects

  • Updates paid_date and invoice edit metadata and fires Invoice_edit.

See it in Fieldmotion

CRM1

The main invoice page calls this route from the paid-date control.

CRM2

No direct production CRM2 caller was found for this route.

Related endpoints