Invoices
Set invoice recurrence notes
POST
/a/InvoiceRecurring_setNotes
Replace the stored notes JSON for an invoice recurrence.
When to use this endpoint
Use this legacy route when saving the CRM1 recurrence notes editor.
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 | Recurrence ID. |
val | Non-empty JSON string | Yes | Replacement notes value. JSON values that decode as false, including [], {}, 0, and false, are rejected. |
Example request
$result = FM_api('InvoiceRecurring_setNotes', [
'id' => '42',
'val' => json_encode(['Follow up before issue']),
]);
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":"no permission to access api"} | The legacy access bit is set. |
{"error":"missing or invalid parameter: id"} | ID is absent or not positive. |
{"error":"missing or invalid parameter: val"} | The value is invalid JSON or decodes as false/empty. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- A positive nonexistent ID still returns success.
- The JSON string is stored verbatim; the handler does not validate note item shape.
Side effects
- Replaces
notesand advanceslast_edited.
See it in Fieldmotion
CRM1
The recurring-invoices notes widget calls this route.
CRM2
No direct CRM2 caller was found; CRM2 uses mapped updates.
Related endpoints
InvoiceRecurring_updateFieldupdates a mapped field.