When to use this endpoint

Use when notes are needed independently of a full stock record. This is not stock movement history or supplier notes.

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

ParameterTypeRequiredDescription
idInteger-compatible stringYesStock ID, converted with intval; use a positive tenant-local ID.

Example request

$notes = FM_api('Stock_notesGet', ['id'=>'1042']);

Example response

"Store in a dry cabinet."

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":"missing or invalid parameter: id"}Missing id or integer-converted value below 1.

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.
  • No direct mobile caller was found in the current app JavaScript or m/www intermediary. The app receives stock through syncDownloads, 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

No direct Stock_notesGet caller was found. The Stock notes dialog starts from notes already returned by its table request, then saves through Stock_notesSet.

CRM2

No direct CRM2 browser caller was found for this exact endpoint; the Stocks module uses mapped Stock reads and writes.

Related endpoints