Stock catalog fields and lookups
Read the stock description
/a/Stock_descriptionGet
Read the complete stored description without the stock table’s shortened preview.
When to use this endpoint
Use before editing a stock description, or when a display needs the entire text rather than its table preview.
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 | Stock ID converted with intval. Omitted or integer zero is rejected; negative integers pass the legacy guard. |
Example request
$description = FM_api('Stock_descriptionGet', ['id'=>'1042']);
Example response
"Replacement filter cartridge"
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":"no id given"} | id is omitted or integer-converts to zero. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- Archived stock is included; soft-deleted stock is excluded. Missing/deleted rows return false; an existing SQL NULL field returns null, not empty text.
- No paging, search, department or owner restriction is applied. The response is not a DataTables wrapper.
- Returns a JSON scalar, not an object containing description. There is no fields parameter.
- 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, timestamp, event or inventory movement.
See it in Fieldmotion
CRM1
Open Stock and click a description cell; filter Network for Stock_descriptionGet. CRM1 loads the full text into a textarea before Stock_descriptionSet saves it.
CRM2
No direct CRM2 browser caller was found for this exact endpoint; the Stocks module uses mapped Stock reads and writes.
Related endpoints
Stock_descriptionSetsaves the description.