Contract types
Retrieve a contract type
/a/ContractType_get
Load the complete stored row for one contract type, primarily for CRM1’s edit dialog.
When to use this endpoint
Use ContractType_get for the raw legacy row. Use ContractType_getRequestedDetails when selected named fields are preferable.
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 |
|---|---|---|---|
id | Integer string | Yes | Type ID after integer conversion. Zero is queried when blank/nonnumeric because only key presence is validated. |
Example request
$type = FM_api('ContractType_get', [
'id' => '31',
]);
Example response
{
"id": "31",
"name": "Planned service",
"disable_invoicing": "0",
"last_edited": "2026-09-25 14:30:00",
"meta": null
}
Keys are database column names, not CRM2 map names. Database numeric values normally remain JSON strings and meta remains raw text/null.
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":"no ID provided"} | The id key is absent. |
false | No row has the converted ID. |
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 query returns every column and applies no status/deleted filter because contract types have neither concept.
- There is no field selection, ordering, or pagination.
- Tenant feature bit
64controls visibility of the Contracts UI but is not checked by this handler.
See it in Fieldmotion
CRM1
Open Contracts → Contract Types and click Edit; CRM1 calls ContractType_get before displaying the name.
CRM2
A production-source search found no direct CRM2 caller; CRM2 requests mapped details through ContractType_getRequestedDetails.
Related endpoints
ContractType_editsaves CRM1’s name edit.ContractTypes_listreturns all type rows.