When to use this endpoint

Use CustomerTypes_list for sorted choices, exports, or incremental reads that need raw customer-type column names.

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

ParameterTypeRequiredDescription
idsJSON array stringNoOptional ID filter. It is applied only when the encoded string is longer than two characters; a native array is not supported.
fieldsJSON array string or native arrayNoUnique columns selected from id, name, allowed_next, last_edited, and colour_hex. Invalid or empty selection defaults to id, name, and colour_hex. triggers is unavailable.
last_editedDatetime stringNoReturns rows with last_edited strictly later than this value and strictly earlier than the current server time. The input is not date-validated.

Example request

$types = FM_api('CustomerTypes_list', [
	'ids' => json_encode([12, 13]),
	'fields' => ['id', 'name', 'allowed_next', 'colour_hex'],
]);

Example response

[
  {"id": "12", "name": "Commercial", "allowed_next": "12,13", "colour_hex": "#336699"},
  {"id": "13", "name": "Residential", "allowed_next": "", "colour_hex": "#669933"}
]

Errors and unusual responses

ResponseCondition
{"error":"not logged in"}No authenticated tenant context is available. Invalid signed credentials can be rejected by the dispatcher before the handler runs.
PHP type/error response rather than a stable API errorids is sent as a native array, or a longer malformed JSON value is decoded and then used as an array.

Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.

Behaviour and edge cases

  • Rows are ordered by name using the tenant database collation. There is no pagination or maximum row count.
  • When both filters are present they are combined with AND. The upper edit-window bound is captured from current server time.
  • The table has no deleted/status column, and no tenant setting changes the result.

See it in Fieldmotion

CRM1

Customer forms and exports use this endpoint for type choices and selected raw columns.

CRM2

CRM2 customer and reporting screens use this list where a lightweight sorted choice set is sufficient.

Related endpoints