When to use this endpoint

Read general job stock and stock selections stored in form-table cells without changing stock balances.

Authentication and permissions

Authenticate with signed API-key fields or a logged-in CRM session. These calls use the authenticated account’s data; the handler has no additional job-page, department, assignee or client-admin permission check unless stated below.

Parameters

ParameterTypeRequiredDescription
idInteger stringYesJob ID, converted with intval; the result must be positive. This selects a physical job ID, not an app ID or job reference.

Example request

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

Example response

{"general":[{"id":1088,"amt":2}],"fieldspecific":[]}

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 is absent or converts to a nonpositive integer.
{"error":"Requested job does not exist"}No active job matches, or its query fails.

Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.

Behaviour and edge cases

  • general is JSON-decoded stock_used; blank/malformed JSON can yield null instead of an array. Stored item properties/types are preserved rather than enriched from the stock catalog.
  • fieldspecific concatenates each stock entry under a decoded cell’s stock key for subform fields of type stock or stock-single. It does not read main-form stock fields.
  • Table IDs come from subform_values; current form definitions determine positional stock columns. Missing/empty tables or absent definitions are skipped. No item deduplication, summing or catalog active filter is performed.
  • The form’s do_not_add_stock_to_job_costs setting does not hide rows here: cost exclusion and stock visibility are separate. The same item can appear in general and fieldspecific; do not blindly add both as independent usage.
  • No stock allocation, price/cost refresh, audit, paging or write runs.

See it in Fieldmotion

CRM1

No direct CRM1 caller was found in the reviewed source. Use this focused API request when the full job editor payload is unnecessary.

CRM2

No direct CRM2 caller was found in the reviewed source. For batched job fields, see Jobs_getById.

Related endpoints

  • Jobs_getStock returns only saved general stock blobs for multiple jobs, without job IDs or table-cell extraction.
  • Jobs_getById returns stock_used/subform_values as encoded stored JSON rather than this composite.