Suppliers
Query requested supplier fields
/a/Supplier_getRequestedDetails
Retrieve selected mapped supplier fields for CRM2 pickers, layouts, and related-record screens.
When to use this endpoint
Use Supplier_getRequestedDetails for camel-cased supplier records, optional exact filters, and batch IDs. It is the general CRM2 supplier lookup and has no pagination.
Authentication and permissions
The request must authenticate with signed API-key fields or a logged-in CRM session. The handler calls the normal login guard but performs no additional Suppliers-page, stock, purchasing, role, create, edit, or delete permission check.
All records are selected from the authenticated tenant. CRM1 and CRM2 hide some controls through client-side permissions, but these endpoints do not repeat those UI checks.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
fields | Native array of mapped field names | No | Fields to return; omission requests every mapped field. Use a native array, not a JSON string. Available names are name, contactName, streetAddress1, streetAddress2, town, county, country, postcode, email, phone, notes, website, taxId, terms, accountNumber, refNumber, isActive, onHold, type, meta, createDate, lastEdited, editedUuid, accountsContact, accountsEmail, additionalEmail, and customValues. |
id or ids | Integer-compatible or native array | No | Limit results to one or more supplier IDs. If both are present, id wins. |
Mapped field filters | Scalar or native array | No | Any mapped field can filter the query. Text filters are lowercased exact matches; numeric filters use integer conversion. Multiple filters are joined with AND. |
order | Field name, field object, or native array | No | Optional mapped ordering; an object may specify id and dir=desc. |
Example request
$suppliers = FM_api('Supplier_getRequestedDetails', [
'fields' => ['id', 'name', 'onHold'],
'onHold' => 0,
'order' => [['id' => 'name']],
]);
Example response
[
{"id":"488104","name":"Northshore Components","onHold":"0"}
]
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 active supplier matches the accumulated filters. |
Runtime/type error | fields is supplied as a JSON string or scalar instead of a native 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
- Deleted suppliers are excluded automatically.
- There is no pagination, default ordering, or implicit limit. Omitting all filters requests every active supplier.
- Unknown selected fields are silently omitted and
idis always included. - Accounting metadata fields and
customValuesare returned as mapped decoded values rather than the raw storage columns.
See it in Fieldmotion
CRM1
CRM1 source contains no direct caller; its supplier and purchasing screens use Supplier_get or Suppliers_list.
CRM2
Open Stock → Suppliers in CRM2 and filter browser developer tools for the exact function name. Supplier pickers throughout Stock, Requisition Orders, Goods Returned, Xero settings, reports, and quote modules call this endpoint; inspect any such picker load.
Related endpoints
Suppliers_getDataTableadds search, filtering, counts, and pagination for table views.Supplier_getDetailsis a legacy alias with the same implementation path.Suppliers_listis a smaller ID/name list for selectors.