Customers
Check whether a customer name is unique
/a/Customer_checkNameIsUnique
Count non-deleted customers whose name equals a proposed name after trimming and lowercasing.
When to use this endpoint
Use Customer_checkNameIsUnique when creating a customer through a workflow that follows the tenant duplicate-name policy.
It is not suitable for an unchanged edit because it has no customer ID to exclude. Customer_createData invokes it only when customer-name-allow-duplicate is disabled.
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 |
|---|---|---|---|
name | String | Yes | Proposed name. It is trimmed and lowercased before an exact database comparison. A present blank string is accepted. |
Example request
$result = FM_api('Customer_checkNameIsUnique', [
'name' => 'Northwind Service Centre',
]);
Example response
{
"warning": "Customer Name must be unique",
"countID": 2
}
A name with no matches returns {"ok":1}. countID is the number of matching non-deleted rows, not a customer ID.
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 or invalid parameter: name"} | name is omitted. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- Soft-deleted customers are excluded; inactive customers are included.
- The endpoint does not read
customer-name-allow-duplicate; the caller decides whether a warning matters. - There is no exclusion ID, result list, filtering, or pagination.
See it in Fieldmotion
CRM1
No direct production CRM1 JavaScript caller was found. The layout-driven Customer_createData server path calls this check when duplicate names are disabled.
CRM2
CRM2 customer creation uses Customer_createData, which calls this endpoint internally under the tenant duplicate-name setting; there is no direct browser request to filter for this function.
Related endpoints
Customer_newhas its own duplicate-name suffix behavior.Customers_listcan return the actual matching records when IDs are needed.