Stock catalog fields and lookups
Read legacy many-to-many stock supplier links
/a/Stock_getSuppliers
Return raw legacy supplier-link IDs and metadata for one stock ID.
When to use this endpoint
Use only when investigating the old relation store. This does not retrieve the current stock_suppliers pricing records or the stock’s single supplier_id.
Authentication and permissions
Authenticate with signed API-key fields or a logged-in CRM session. This handler requires both a user identity and tenant context; it adds no stock-page, finance or administrator permission check.
All queries use the authenticated tenant. API signing and session CSRF checks still apply; see Getting started.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | Integer-compatible string | Yes | Presence is required, then integer-converted. Zero, negative and nonexistent stock IDs are not separately rejected. |
Example request
$links = FM_api('Stock_getSuppliers', ['id'=>'1042']);
Example response
[{"toID":"1088","meta":"{}"}]
toID is the linked supplier identifier, not a supplier name. meta remains raw stored text and may be null or encoded JSON.
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: id"} | id is absent/null. |
[] | No type-9 many-to-many rows have that stock from_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
- Reads manymany type_num=9 with from_id=id, joining non-deleted stock and suppliers. Missing/deleted stock or suppliers do not produce links. Archived stock and inactive/on-hold non-deleted suppliers are not excluded.
- No order or pagination. Relation metadata stays raw text, not current stock_suppliers cost, price or part-number fields.
- No direct mobile caller was found in the current app JavaScript or
m/wwwintermediary. The app receives stock throughsyncDownloads, 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 call was found. The CRM2 stock detail screen requests StockSupplier_getRequestedDetails for supplier options from stock_suppliers, while the Stocks supplier cell opens its mapped supplier layout; neither invokes this old many-to-many reader.
Related endpoints
StockSupplier_getRequestedDetailsreads current supplier-pricing records.Stock_supplierSetwrites a separate scalar supplier assignment.