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

ParameterTypeRequiredDescription
startInteger stringYesZero-based SQL offset. Presence is checked, but negative values are not rejected before reaching SQL.
lengthInteger stringEffectively yesSQL page size. The implementation reads it directly without validating presence or positivity.
drawInteger stringEffectively yesDataTables request counter, integer-converted into the response.
order[0][column]Integer stringEffectively yesSort 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]StringEffectively yesExact desc selects descending; every other value selects ascending.
search[value]StringEffectively yesCase-insensitive substring across ID, name, account number, phone, email, website, and tax ID. Blank applies no global search.
fIdInteger stringNoExact 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

ResponseCondition
{"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 dataThe 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.
  • recordsTotal is the non-deleted tenant-wide count; recordsFiltered applies global search and fId before 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