Customers
Archive a batch of customers
/a/Customers_disable
Archive a validated batch of active or already-inactive customers and stop their active recurrences.
When to use this endpoint
Use Customers_disable for the CRM2 bulk Archived action when every selected customer should remain available for history and possible reactivation.
The operation is destructive to future recurring work even though it retains customer rows. Confirm the selection before calling it.
Authentication and permissions
The request must authenticate with signed API-key fields or a logged-in CRM session. The handler performs no additional page or role-permission check.
The lookup and any write use the authenticated tenant; an ID from another tenant cannot be addressed through this call.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
ids | JSON array string | Yes | Nonempty JSON array of positive customer IDs. Values are converted to integers and duplicates collapse. |
Example request
$result = FM_api('Customers_disable', [
'ids' => json_encode([1042, 1088]),
]);
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":"missing parameter: ids"} | ids is absent or blank. |
{"error":"invalid parameter: ids"} | JSON is not a nonempty array, or any converted ID is below 1. |
{"error":"customer 1088 does not exist"} | Any supplied ID is missing or soft-deleted. Validation happens before recurrence or customer mutation. |
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 whole normalized ID list is validated against non-deleted customers before any item is changed.
- Inactive customers are accepted. Their active recurrences are still disabled, but their customer rows and deletion markers are not rewritten.
- Active rows are updated together to
is_active=0with a new timestamp andedited_uuid="Customer_disable". - The route requires login but performs no extra customer-page role/permission check.
- There is no pagination or explicit batch limit.
Side effects
- Disables every active recurrence for the selected customers, deleting future incomplete generated jobs and related scheduler/notification state through the recurrence workflow.
- Writes a deletion-log marker for each customer that changes from active to inactive, even though the row remains
deleted=0. - Removes generated daily-archive customer-name caches. Reactivating a customer does not recreate its recurrence schedule or removed jobs.
See it in Fieldmotion
CRM1
No direct production CRM1 caller was found. CRM1 commonly archives one row through Customer_disable.
CRM2
Select customers, choose Archived, confirm the recurrence warning, and filter Network requests for Customers_disable.
Related endpoints
Customer_disableperforms the same lifecycle operation for one customer.Customer_enablereactivates a retained customer but not its recurrence work.Customers_deletesoft-deletes instead of archiving.