Stock catalog fields and lookups
Read a stock nominal code
/a/Stock_nominalGet
Read the stored ledger code, without resolving its local account record.
When to use this endpoint
Use for the literal nominal_code attached to stock. This does not return an account ID, account name or tax configuration.
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; use a positive tenant-local ID. |
Example request
$code = FM_api('Stock_nominalGet', ['id'=>'1042']);
Example response
"4000"
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: id"} | Missing/nonpositive id. |
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 fallback to a default nominal or accounting integration mapping is applied.
- 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
No direct narrow getter caller was found. The Stock table already supplies nominal_code and displays it as the Nominal Code or Ledger Account Number.
CRM2
No direct CRM2 browser caller was found for this exact endpoint; the Stocks module uses mapped Stock reads and writes.
Related endpoints
Stock_nominalSetwrites the literal code.Account_getDetailsreads a local account record rather than this stock scalar.