Customers
Deactivate a customer
/a/Customer_disable
Deactivate one customer and stop its active customer recurrences, including removal of their future incomplete jobs and scheduler work.
When to use this endpoint
Use Customer_disable to archive a customer without soft-deleting its record. The customer remains available for historical references and can later be reactivated, but it is removed from normal active-customer selection.
This operation has broader scheduling consequences than changing an activity flag. Confirm with the user before calling it when the customer has recurring work.
Authentication and permissions
The request must authenticate with signed API-key fields or a logged-in CRM session. The handler requires login but does not perform an additional role or page-permission check.
The customer is selected from the authenticated tenant. The lookup does not exclude a soft-deleted row, although disabling a deleted customer does not restore or make it visible.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | Integer string | Yes | Customer to deactivate. It must convert to an integer of at least 1. |
Example request
$result = FM_api('Customer_disable', [
'id' => '1042',
]);
Example response
{
"ok": 1
}
Errors and unusual responses
| Response | Condition |
|---|---|
{"error":"missing or invalid parameter: id"} | id is absent or does not convert to a positive integer. |
{"error":"customer does not exist"} | No customer row has that ID. |
The response does not enumerate recurrences or jobs affected by the operation.
Behaviour and edge cases
- The customer row is retained with
deleted=0andis_active=0. General detail endpoints can still retrieve it. - Active customer recurrences are processed even if the customer was already inactive. This allows a repeated call to clean up an active recurrence left on an inactive customer.
- If the customer was already inactive, the customer row, deletion log, timestamp, and name caches are not changed after recurrence cleanup.
- For an active customer, the endpoint updates
last_editedand writes a customer deletion-log marker even though the customer is not soft-deleted. Consumers should checkis_activerather than interpreting that marker as permanent deletion.
Side effects
When the customer changes from active to inactive, the endpoint also updates is_active, last_edited, and edited_uuid; records a deletion-log entry used by polling/cache flows; and removes generated daily-archive customer_names.json files so they can be rebuilt.
See it in Fieldmotion
CRM1
Open Customers, choose Deactivate on an active row, type the confirmation phrase, and filter Network requests for Customer_disable. CRM1 warns that recurrences and future incomplete jobs will be removed.
CRM2
Open Customers, use the row action Archived, and confirm the warning. Filter for Customer_disable. CRM2 presents the same recurrence warning before making the request.
Related endpoints
Customer_enablemakes the customer active again but leaves disabled recurrences disabled.Customer_deletesoft-deletes the record and has additional permissions and synchronization cleanup.Customer_getcan confirm the retained record and itsis_activevalue.