Contract types
Retrieve selected contract-type fields
/a/ContractType_getRequestedDetails
Retrieve selected named fields for one, several, or all contract types through CRM2’s field map.
When to use this endpoint
Use ContractType_getRequestedDetails for CRM2 configurable details and lightweight ID/name lookups that do not need table counts.
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 |
|---|---|---|---|
fields | Array | No | Native array of id, name, disableInvoicing, lastEdited, and/or meta. Omission requests all mapped fields; unknown names are ignored; id is always added. |
id / ids | Integer string or array | No | Optional ID restriction; id takes precedence. Scalars and array items are integer-converted. JSON-encoded arrays are not decoded. |
name / lastEdited / meta | String or array | No | Exact case-insensitive mapped filters. Arrays become IN lists. |
disableInvoicing | Integer string or array | No | Exact integer filter; nonnumeric scalar input becomes zero and nonnumeric array items are omitted. |
order | Field name or native list | No | Mapped ordering. List members may be field names or objects such as {"id":"name","dir":"desc"}; exact desc reverses that key. Unknown keys are skipped. |
advanceSearch | Array | No | Shared CRM2 advanced conditions over mapped fields. |
Example request
$types = FM_api('ContractType_getRequestedDetails', [
'ids' => ['31', '32'],
'fields' => ['id', 'name', 'disableInvoicing'],
'order' => [['id' => 'name', 'dir' => 'asc']],
]);
Example response
[
{"id": "31", "name": "Planned service", "disableInvoicing": "0"},
{"id": "32", "name": "Warranty", "disableInvoicing": "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. |
[] | No row matches or the supplied numeric filter contains no usable values. |
Runtime warning or type error | fields, order, or advanceSearch is supplied in a malformed non-array shape. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- No default ordering is applied. Missing IDs are omitted rather than represented by placeholders.
- Raw
metaremains stored text. Contract types have no status/deleted filter. - Tenant feature bit
64controls visibility of the Contracts UI but is not checked by this handler. - Legacy advanced-search objects containing raw
whereexpressions are trusted internal CRM input and should not be constructed by third parties.
See it in Fieldmotion
CRM1
A production-source search found no direct CRM1 caller.
CRM2
Open Contracts → Types and inspect configurable detail/list requests. The shared widget derives this route as its detail endpoint.
Related endpoints
ContractTypes_getDataTableadds table paging and counts.ContractType_getreturns raw database-column names.