Stock items and catalogue maintenance
Filter legacy stock suggestions
/a/Stock_filterListItems
Return full catalogue rows whose names match a legacy substring filter.
When to use this endpoint
Prefer Stocks_list or a mapped grid for supported projection and explicit archive/deletion controls.
Authentication and permissions
Authenticate with a signed API key or a logged-in CRM session on the account’s routed host. API keys act as their owner; session calls require dispatcher CSRF protection where configured. IDs address the authenticated tenant.
The handler checks that the tenant database context is defined rather than calling Core_requireLogin. Use normal authenticated dispatcher access; this is not a public or cross-tenant endpoint. No extra Stock page-action/CRM2 role check is added here.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
value | String | Yes | Trimmed substring. Empty string is accepted and matches all names. SQL LIKE % and _ retain wildcard meaning. |
Example request
$result = FM_api('Stock_filterListItems', ['value'=>'valve']);
Example response
[
{
"id": "18",
"name": "Valve",
"code": "VALVE-1",
"is_archived": "0",
"deleted": "0"
}
]
Application errors can use HTTP 200. Inspect error/warning fields; database numeric values can be strings unless this handler explicitly converts them.
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: value"} | value is absent/null. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- Returns whole undeleted, unarchived stock rows matching a trimmed, case-insensitive name substring. Empty text matches all active items; LIKE wildcards retain their meaning.
- Preserves SQL name ordering; PHP no longer sorts complete row arrays. There is no field projection or pagination.
Side effects
- Read only.
See it in Fieldmotion
CRM1
Source search found no direct current CRM1 caller for Stock_filterListItems. Stock pickers use Stocks_list and catalogue-specific lists.
CRM2
Source search found no direct current CRM2 caller for this legacy filter. The stock picker/grid uses mapped reads.
Related endpoints
Stocks_list— Stream a bare JSON stock list with warehouse quantities and an optional field projection.Stocks_getDataTable— Return named stock rows with mapped filters, paging and optional supplier/allocation summaries.