Customer types
Retrieve customer types by ID
POST
/a/CustomerTypes_getById
Return an allowlisted set of raw customer-type columns for explicit IDs.
When to use this endpoint
Use CustomerTypes_getById when an integration already knows the IDs and needs a narrow raw-column response, including trigger text.
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 or native array | Yes | Requested IDs. Values are converted to integers and duplicates are removed; zero is retained if supplied. |
fields | JSON array string or native array | Yes | Unique fields selected from id, name, allowed_next, last_edited, and triggers. colour_hex is not available from this endpoint. |
Example request
$types = FM_api('CustomerTypes_getById', [
'ids' => json_encode([12, 13]),
'fields' => json_encode(['id', 'name', 'triggers']),
]);
Example response
[
{"id": "12", "name": "Commercial", "triggers": "[]"},
{"id": "13", "name": "Residential", "triggers": "[]"}
]
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: ids"} | The ids key is absent. |
{"error":"missing required parameter: fields"} | The fields key is absent. |
{"error":"no fields selected"} | No supplied field is in the allowlist. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- Missing IDs are omitted. The response contains exactly the accepted raw column names; trigger JSON is not decoded.
- The SQL query has no explicit ordering, so response order is not guaranteed to match
ids. There is no pagination.
See it in Fieldmotion
CRM1
No direct production CRM1 caller was found.
CRM2
No direct production CRM2 caller was found; most CRM2 forms use CustomerType_getRequestedDetails.
Related endpoints
CustomerType_getRequestedDetailsexposes all fields through mapped names.CustomerTypes_listsupplies sorted export/choice data.