Invoices
Set invoice notes
POST
/a/Invoice_setNotes
Replace the notes on an active invoice.
When to use this endpoint
Use this for a direct notes-only save from CRM1 or a job invoice panel.
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
| Parameter | Type | Required | Description |
|---|---|---|---|
id | Positive integer | Yes | Active invoice ID. |
notes | String | Yes | Complete replacement notes; an empty string clears them. |
Example request
$result = FM_api('Invoice_setNotes', ['id' => 981, 'notes' => 'Payment due within 30 days']);
Example response
{
"ok": 1
}
Errors and unusual responses
| Response | Condition |
|---|---|
{"error":"not logged in"} | No authenticated tenant context is available. Invalid signed credentials can be rejected by the dispatcher before the handler runs. |
{"error":"invoice does not exist"} | The invoice is absent or 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
- Paid invoices are editable through this route. An identical value returns
warning: no change necessary.
Side effects
- Updates notes and edit metadata and fires
Invoice_edit.
See it in Fieldmotion
CRM1
The main invoice editor and Job page invoice-notes control call this route.
CRM2
No direct production CRM2 caller was found for this route.
Related endpoints
Invoices_getDataTablesupplies paginated CRM2 invoice rows and IDs.Invoices_getDTis the CRM1 invoice-list counterpart.