When to use this endpoint

Select receipt header aliases for integration or lookup use.

Authentication and permissions

Authenticate with signed API-key fields or a logged-in CRM session. Session CSRF, account-active and IP restrictions still apply. These handlers add no receipt-specific page, finance, department or record-owner permission check.

Records are scoped to the authenticated tenant. CRM1 displays Goods Received with employer feature bit 262144; CRM2 checks features2.goodsReceivedNotes. Those screen gates are not enforced by these handlers. Mobile receipt routes run separately through the mobile intermediary and have different permission and ownership checks.

Mapped handlers require both a logged-in user and a tenant context before loading the tenant field map.

Parameters

ParameterTypeRequiredDescription
id, idsInteger or native arrayNoid takes precedence. Values are integer-coerced; an empty ID array adds no ID restriction and can return every row.
fieldsNative array of aliasesNoDefaults to all map aliases, except GoodReceived_getLayoutDetails defaults to an empty list. id is always included; unknown fields are ignored. JSON-encoded text is not decoded here.
Mapped field aliasesScalar or native arrayNoAdditional filters are ANDed. Text equality lowercases the column and trims/lowercases the input; numeric filters use intval. Native arrays become IN filters; empty numeric arrays match nothing.
orderAlias or native arrayNoDetail ordering accepts alias strings or objects such as [{id:"cDate",dir:"desc"}]. Unknown aliases are ignored; no default order.
advanceSearchNative rule arrayNoNative structured filter rules using mapped field aliases and allowlisted conditions. Raw where clauses and malformed rule shapes are rejected.

Example request

FM_api('GoodReceived_getRequestedDetails', ['id'=>'531', 'fields'=>['id','supplierID','notes']]);

Example response

[{"id":"531","supplierID":"84","notes":"Delivery received"}]

Database-backed scalar aliases remain strings/null. Stored JSON is decoded when traversed; whole-column values already selected by alias can remain JSON text.

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.

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

Behaviour and edge cases

  • This is an unpaginated row list, not a DataTables envelope. Missing IDs are omitted; no match returns []. Database read failures are also collapsed to [], so an empty result is not proof of an absent record.
  • No active/deleted or parent-existence filter is added for purchases_in or purchases_in_entries. Neither table is in the shared soft-delete table list. Request native arrays for fields, IDs and nested controls.
  • Direct mapped filters intersect. Without a filter the method can read the whole tenant table. limit/start/length do not paginate detail reads.
  • Mapped readers reject raw advanced-search SQL, malformed native controls and unsafe sort directions using the same allowlisted query guards as stock/goods returns.
  • Header aliases include id, cDate, lastEdited, createdBy, supplierID, poID, notes, targetType, targetID, target, jobID, suppInvoice, suppDNN, purchaseOrders and customValues. target returns {id,type} alongside its component aliases when requested.

See it in Fieldmotion

CRM1

No direct CRM1 caller was found. CRM1 uses the legacy GoodsReceived_newNote, GoodsReceivedEntries_get and GoodsReceivedNote_* workflow instead.

CRM2

CRM2 Goods Returned uses this reader as a Goods Received lookup. In a return form, select its linked receipt and inspect the goodReceived lookup request.

Related endpoints