When to use this endpoint

Decode the outer API response, then decode the returned string before reading the four keys.

Authentication and permissions

Authenticate with a signed API key or a logged-in CRM session on the account’s routed host. API keys act as their owner; session calls require dispatcher CSRF protection where configured. IDs address the authenticated tenant.

The handler checks that the tenant database context is defined rather than calling Core_requireLogin. Use normal authenticated dispatcher access; this is not a public or cross-tenant endpoint. No extra Stock page-action/CRM2 role check is added here.

Parameters

ParameterTypeRequiredDescription
idInteger-compatibleYesPositive stock catalogue ID. It is not a stock-container row ID, category ID or supplier ID.

Example request

$result = FM_api('Stock_getDetails', ['id'=>'18']);

Example response

"{\"manufacturer\":\"Example maker\",\"barcode\":\"12345\",\"manufacturer_part_no\":\"M-10\",\"supplier_part_no\":\"S-10\"}"

Application errors can use HTTP 200. Inspect error/warning fields; database numeric values can be strings unless this handler explicitly converts them.

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"}ID is absent or integer-converts 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

  • The wire response is a JSON string, not an object or row list. Each missing key defaults to an empty string; saved values are otherwise returned as stored.
  • Selects meta by ID without deleted/archive filtering. A nonexistent row yields four empty fields rather than a not-found error. No ordering, pagination or additional fields are supported.

Side effects

  • Read only; no normalization or timestamp change.

See it in Fieldmotion

CRM1

Open Stock in CRM1. The legacy grid is Stock_getDT and its editor/inline actions use legacy Stock routes. Inspect the exact function name in the browser Network panel. Click the manufacturer/barcode details cell; the caller JSON-parses this string.

CRM2

Open Stocks in CRM2. Stock layouts derive Stock_createData, Stock_updateData and Stock_getLayoutDetails through the shared helpers; the grid calls Stocks_getDataTable. Inspect the exact function name in Network requests. Layouts use metaManufacturer/metaBarcode/metaManufacturerPartNo/metaSupplierPartNo instead.

Related endpoints

  • Stock_setDetails — Save or clear manufacturing identifiers while preserving other stock metadata.
  • Stock_get — Read the full saved stock row, with selected manufacturing metadata flattened for the legacy editor.