When to use this endpoint

Use when filtering the old single-supplier field. It does not search multi-supplier pricing links or supplier inventory ownership.

Authentication and permissions

Authenticate with signed API-key fields or a logged-in CRM session. The handler calls the user-login guard but adds no stock-page, finance or administrator permission check.

Queries use the authenticated tenant. Sign numeric values as strings; JSON-encode only parameters described as JSON text. See Getting started.

Parameters

ParameterTypeRequiredDescription
supplier_idInteger-compatible stringYesPresence is checked, then intval is used. Zero/blank selects stock with supplier_id=0; a missing supplier record is not an error.

Example request

$items = FM_api('Stock_listBySupplier', ['supplier_id'=>'1088']);

Example response

[{"id":"1042","name":"Filter cartridge","code":"FLT-01"}]

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":"no Supplier ID provided"}supplier_id is absent/null.
[]No non-deleted stock uses that scalar supplier ID.

Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.

Behaviour and edge cases

  • Filters deleted=0 but not is_archived. Orders by name, with no pagination or tie-breaker.
  • Returns exactly id,name,code. No fields, category, stock-quantity, permission or tenant-setting filter.
  • Does not consult stock_suppliers or the legacy many-to-many supplier links.
  • No direct mobile caller was found in the current app JavaScript or m/www intermediary. The app receives stock through syncDownloads, which selects non-deleted stock by edit timestamp; these calls are not the app synchronization protocol.

Side effects

  • Read-only; no audit, edit timestamp, event or stock movement.

See it in Fieldmotion

CRM1

No direct CRM1 browser caller was found for this exact endpoint.

CRM2

No direct CRM2 browser caller was found for this exact endpoint; the Stocks module uses mapped Stock reads and writes.

Related endpoints