When to use this endpoint

StockCategory_update saves the complete name and membership after this raw-record read.

Categories organize stock membership and parent/child navigation; these calls do not transfer physical stock or change quantities. Select the legacy or mapped API that matches your field names.

Authentication and permissions

Authenticate using signed API-key fields or a logged-in CRM session. All object queries use the authenticated tenant. The handler has no additional page, role or feature check unless stated below.

Sign numeric request values as strings, including nested native arrays; only JSON-encode parameters that explicitly accept JSON text. See Getting started.

Parameters

ParameterTypeRequiredDescription
idInteger-compatibleYesOnly presence is validated; converted to an integer, including zero or negative.

Example request

$result = FM_api('StockCategory_get', ['id'=>'1042']);

Example response

{"id":1042,"name":"Parts","parent_id":"0","stock":null,"last_edited":"2026-10-03 10:30:00"}

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 id supplied"}ID omitted.
{"error":"requested stock category does not exist"}No matching row.

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 the five legacy stored fields, with id as a JSON number. Other database scalars remain strings/null; soft-delete metadata is not added.
  • Membership stock is comma-separated text or null, not an array. The commented cleanup tool is inactive: reading does not repair membership.
  • No projection or pagination; no matching category returns an explicit error.
  • Only non-deleted categories are read or changed. No quantity, price or accounting-provider availability check is applied.
  • The source search found no direct caller in the mobile JavaScript app or its m/www intermediary for this endpoint.

Side effects

  • Read-only; no object writes, audit entries or notifications are performed.

See it in Fieldmotion

CRM1

Open Stock Categories and select, create, save, drag or delete a category as appropriate; filter browser Network by this endpoint’s exact function name.

CRM2

CRM2 Stock Categories uses mapped detail/create/update/delete calls instead; no direct caller found for this legacy endpoint.

Related endpoints