Suppliers
Query the CRM1 Suppliers table
/a/Suppliers_getDT
Return the paged positional supplier table consumed by the legacy CRM1 Suppliers screen.
When to use this endpoint
Use Suppliers_getDT only to reproduce CRM1’s Supplier table. New integrations should use Suppliers_list or mapped detail reads.
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 |
|---|---|---|---|
start | Integer string | Yes | Zero-based SQL offset. Presence is checked, but negative values are not rejected before reaching SQL. |
length | Integer string | Effectively yes | SQL page size. The implementation reads it directly without validating presence or positivity. |
draw | Integer string | Effectively yes | DataTables request counter, integer-converted into the response. |
order[0][column] | Integer string | Effectively yes | Sort column: 0 ID, 1 name, 2 account number, 3 phone, 4 email, 5 website, or 6 tax ID. Other values fall back to ID. |
order[0][dir] | String | Effectively yes | Exact desc selects descending; every other value selects ascending. |
search[value] | String | Effectively yes | Case-insensitive substring across ID, name, account number, phone, email, website, and tax ID. Blank applies no global search. |
fId | Integer string | No | Exact supplier ID when the value is truthy after request handling. |
Example request
$table = FM_api('Suppliers_getDT', [
'draw' => '3',
'start' => '0',
'length' => '25',
'order' => [['column' => '1', 'dir' => 'asc']],
'search' => ['value' => 'northshore'],
]);
Example response
{
"draw": 3,
"recordsTotal": "42",
"recordsFiltered": "1",
"data": [["488104","Northshore Components","NS-42","+35315550100","orders@example.test","https://example.test","IE123","2026-09-01 09:15:00","0"]]
}
Each row position is: ID, name, account number, phone, email, website, tax ID, creation datetime, and on-hold flag. Database values normally remain strings.
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: start"} | start is absent. |
Warnings, invalid SQL, or empty data | The nested order, search, or length structures are omitted or malformed; only start has an explicit guard. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- Soft-deleted suppliers are excluded from rows and both counts. Inactive and on-hold suppliers remain.
recordsTotalis the non-deleted tenant-wide count;recordsFilteredapplies global search andfIdbefore pagination.- The result has no stable secondary ordering for tied values.
- This handler’s raw positional rows and permissive input handling are legacy UI contracts, not a stable external schema.
See it in Fieldmotion
CRM1
Open Stock → Suppliers in CRM1 and filter browser developer tools for the exact function name. Searching, sorting, and paging the table call Suppliers_getDT.
CRM2
No CRM2 production caller was found. CRM2 uses Suppliers_getDataTable.
Related endpoints
Suppliers_getDataTablereturns CRM2’s mapped table objects.Suppliers_listis the narrower integration read.