When to use this endpoint

Use after a stock header, inventory selection or table supplies allocation IDs or a stockID filter. Prefer this mapped read over raw columns when consuming container objects.

Authentication and permissions

Authenticate with a signed API key or a logged-in CRM session on the account’s routed host. Signed requests act as the key owner. Session requests must include the dispatcher CSRF value when configured. All record identifiers belong to the authenticated tenant.

The dispatcher and these handlers do not impose an additional CRM2 Stock role or Stock TeamAccess record scope. CRM2 screen permissions are separate controls and must not be assumed to apply to CRM1. These routes do not become public because an individual legacy handler checks only the tenant context.

Parameters

ParameterTypeRequiredDescription
id / idsScalar or native ID arrayNoAllocation/ledger row IDs, not stock IDs. id takes precedence; omission or an empty native array leaves the ID restriction unset.
fieldsNative field-name arrayNoNative mapped field-name list. Omission defaults to all mapped names. qty retains fractions on reads and writes; container is an id/type object. meta/metaInventory can remain encoded JSON strings.
stockID / containerID / containerType / containerMapped filtersNostockID is a catalogue ID. container is native {id,type}; it expands into owner/type filters. Numeric IDs use exact equality/list matching.
hasQTYTruthy controlNoWhen present and equal to true, adds amt>0. Omission/false/"0" leaves signed/zero balances visible.
Mapped filters / order / advanceSearchNative values/arraysNoMapped equality filters and typed advanced-search rules; order uses mapped names or {id,dir}. Raw where SQL is rejected.

Example request

$rows = FM_api('StockContainer_getRequestedDetails', ['stockID'=>'1042','fields'=>['id','qty','container'],'hasQTY'=>'1']);

Example response

[{"id":"2081","qty":"3","container":{"id":"1088","type":"1"}}]

Examples show one representative result; database numeric scalars can be JSON strings. Application errors can use HTTP 200: inspect error and warning in the decoded response.

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":"invalid advanced search"}Raw where SQL in advanceSearch.

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

Behaviour and edge cases

  • Use native arrays for fields and ID selections; these wrappers do not decode JSON strings into those arrays. The response is a bare row array. id is always included; missing records are omitted, with no requested-ID ordering or pagination.
  • Omitting id/ids, or supplying an empty native ID array, adds no ID restriction and can read the whole matching table. Use a deliberate nonempty selection. id takes precedence over ids.
  • Mapped scalar/list filters combine with AND. Numeric equality filters integer-convert values; text equality is case-insensitive and trimmed. order accepts mapped names or native {id,dir} entries. Unknown projected names are ignored; stored JSON is not generally decoded into objects.
  • These allocation/ledger tables have no automatic deleted-row filter in the shared reader and are not joined to active stock/owners unless the endpoint explicitly says so. A retained allocation/history can therefore refer to a missing, archived or deleted business record.
  • Vehicle container objects use numeric logical id and the saved vehicle uuid for type2/type20. Filters using numeric IDs or UUIDs resolve the same allocations without rewriting saved keys. Missing field arrays now use the normal shared default safely.
  • Native multi-ID selections default to mapped containerType/containerID ordering. Explicit mapped order remains available. Native query-control shapes are validated. amtTrigger still returns saved amount|email text; the dedicated threshold route validates edits.

Side effects

  • Database reads only; no reservation, movement, alert or history entry is created.

See it in Fieldmotion

CRM1

No direct CRM1 caller was found in the source search. CRM1 uses its legacy Stock grid and stockContainerEdit allocation editor instead.

CRM2

CRM2 stockShowDetails reads qty/containerType for header totals; widgetInventorySelection reads allocation and batch IDs before selection. Filter Network for StockContainer_getRequestedDetails.

Related endpoints