Customers
Retrieve customer credit terms
/a/Customer_getCreditTerms
Retrieve the free-text credit terms stored on one customer.
When to use this endpoint
Use Customer_getCreditTerms when a job or billing workflow needs only the customer-specific terms without loading the full customer record.
The result is opaque text; the endpoint does not calculate a due date or interpret a number of days.
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 | Customer to read; it must convert to a positive integer. |
Example request
$terms = FM_api('Customer_getCreditTerms', [
'id' => '1088',
]);
Example response
{
"credit_terms": "30 days from invoice date"
}
The value is returned exactly as stored. A legacy SQL NULL value is returned as JSON 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":"missing or invalid parameter: id"} | id is absent or invalid. |
{"error":"customer does not exist"} | No customer row with that ID exists. |
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 lookup does not filter inactive or soft-deleted customers.
- The returned value is the stored scalar, including blank text or a legacy null; there are no derived fields.
- This is a single-record lookup with no filtering or pagination.
See it in Fieldmotion
CRM1
Open or create a job in CRM1 and choose a normal customer. The job editor requests Customer_getCreditTerms and displays the result in the Credit Terms area; filter Network requests by the function name.
CRM2
No direct production CRM2 caller was found. CRM2 obtains customer finance values through its broader customer/layout data flow.
Related endpoints
Customer_setCreditTermsreplaces or clears the stored text.Customer_getretrieves the wider customer record.