Goods returns
Read the CRM1 return-note header
/a/GoodsReturnedNote_get
Read one return header enriched with supplier address, received-note and purchase-order fields.
When to use this endpoint
Used when CRM1 opens a return note. Fetch GoodsReturnedEntries_get separately for its lines and costs; this call does not include a line list or a computed grand total.
Authentication and permissions
Authenticate with signed API-key fields or a logged-in CRM session. Session CSRF and account/IP restrictions still apply. These handlers add no goods-return, finance, department, owner or page-role permission check.
Records belong to the authenticated tenant. CRM1 shows this workflow when the employer features bit 262144 is enabled; CRM2 uses features2.goodsReturnedNotes. These are UI gates, not checks performed by these handlers.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | Integer-converted value | Yes | Return-header ID; presence is required, but positivity is not validated. Blank/zero/negative normally finds no row. |
Example request
FM_api('GoodsReturnedNote_get', ['id'=>642]);
Example response
{"grt_id":"642","grt_notes":"Damaged packaging","grt_date":"2026-10-07 10:30:00","delivery_net":"12.50","delivery_tax":"2.50","delivery_taxcode":"20","name":"Example supplier","street_address1":"10 Example Road","street_address2":"","town":"Dublin","county":"Dublin","postcode":"D01 EX00","tax_id":"","reference":"Supplier order reference","po_id":"420","po_num":"420","date_approved":"2026-09-30 09:00:00","grn_date":"2026-10-01 09:00:00","grn_notes":"Received goods"}
A single object, not an array or {data:...} wrapper. Raw database scalar types are preserved. grt_date is the return header date; grn_date is the received date. Missing joined suppliers/received notes/POs leave their selected fields null.
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":"no return note id supplied"} | id absent. |
false | No header or a failed query. There is no typed not-found error. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- Left-joins supplier, purchases_in and purchase_orders without filtering their deletion/archive state. The header can still be returned when a related row is missing.
- Selected fields are exactly those in the example; supplier ID, mapped customValues, line rows and stock balances are not included. reference and po_num belong to the linked purchase order, not the supplier or a generated return-note number. Supplier reference is a different database field, ref_number, and is not selected here.
- No pagination, sorting, field projection or search; extra parameters are ignored. Delivery figures are stored values, not a tax-rate calculation or line-derived total.
Side effects
- Read only. No stock or total recalculation.
See it in Fieldmotion
CRM1
pageGoodsReturnedNote reads this header to display supplier/PO/received information, populate notes and delivery fields, then separately calls GoodsReturnedEntries_get.
CRM2
CRM2 reads through Layout_getValue → GoodReturned_getLayoutDetails instead of this joined legacy object.