Suppliers
Download the legacy supplier CSV
/a/Suppliers_export
Download the legacy fixed-column supplier CSV used by CRM1, optionally filtered by the visible table controls.
When to use this endpoint
Use Suppliers_export only when you need CRM1’s fixed 18-column suppliers.csv download. It writes a file response and terminates the request instead of returning JSON.
For a selectable-field, batchable export use Suppliers_getExportData.
Authentication and permissions
The request must establish an authenticated tenant context with signed API credentials or a logged-in CRM session. This legacy handler checks for the tenant database prefix rather than calling the normal login guard.
It performs no additional Suppliers-page, stock, purchasing, role, create, edit, or delete permission check.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
search | String | No | Case-insensitive substring across name, account number, phone, email, tax ID, and website. The ID branch uses the integer-converted search value inside a wildcard expression. |
supplierID | Integer string | No | Exact supplier ID when it converts to a nonzero integer. |
name, accountNumber, phone, email, website, taxID | String | No | Case-insensitive substring filters for their corresponding columns. All supplied filters are AND-combined. |
Example request
// This response is a CSV download, not JSON.
header('Location: /a/Suppliers_export?name=Northshore');
Example response
Id,Name,"Account Number",Phone,Email,Website,"Tax Number","Contact Name","Street Address 1","Street Address 2",Town,Region,Country,Postcode,Notes,"Hold Status",Accounts_Email,Accounts_Contact
488104,"Northshore Components",NS-42,+35315550100,orders@example.test,https://example.test,IE123,"Alex Example","14 Harbour Road",,Dublin,Dublin,IRL,D02X285,,Active,accounts@example.test,"Morgan Example"
The response has Content-Type: text/csv and attachment filename suppliers.csv. Accounting email/contact are read from the supplier metadata JSON; missing values are blank.
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":"not logged in"} | No tenant database prefix is available; this legacy route checks tenant context directly. |
Partial or empty file response | The temporary CSV cannot be written or read. The implementation does not return a structured file error. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- Rows are ordered by supplier ID and are not paginated.
- Inactive suppliers and suppliers on hold remain in the export. Hold status is rendered as
Activefor zero andOn Holdfor one. - The handler writes
/tmp/<tenant-id>/tmp/suppliers.csv, streams it, and callsexit; an API client expecting JSON receives CSV instead. - The global search’s ID expression is a legacy wildcard comparison around an integer value and should not be treated as a reliable textual ID search.
See it in Fieldmotion
CRM1
Open Stock → Suppliers and use the legacy export action. Its visible filters are sent to Suppliers_export.
CRM2
No CRM2 production caller was found. CRM2 uses Suppliers_getDataTable and the selectable-field export flow.
Related endpoints
Suppliers_getExportDatasupports the current two-phase export widget.Suppliers_listreturns a narrow JSON list and excludes deleted suppliers.