Goods Received
Read legacy delivered-line links
/a/PurchasesInDelivered_get
Fetch stored delivery-link rows for one receipt-entry ID.
When to use this endpoint
Fetch stored delivery-link rows for one receipt-entry ID.
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.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
pi_id | Integer | Yes | Receipt-entry ID (pi_entry_id), not receipt header ID. intval must be positive. |
Example request
FM_api('PurchasesInDelivered_get', ['pi_id'=>'701']);
Example response
[]
When present, each row is selected with * from purchases_in_delivered. The representative schema contains id, po_entry_id, pi_entry_id, qty, cdate and last_edited; this response is not the modern receipt-line payload.
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: pi_id"} | Omitted/invalid/below 1, checked before login. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- Filters only pi_entry_id. No header/PO existence, user, active/deleted, status or quantity filter; no ordering or pagination.
- No match returns []; a failed read can return false. It does not calculate outstanding quantities or create delivery links. Modern receipt creation writes purchases_in_entries instead of this legacy link table.
See it in Fieldmotion
CRM1
No production CRM1 caller was found; receipt viewing uses GoodsReceivedEntries_get.
CRM2
No production CRM2 caller was found; receipt layouts use mapped receipt lines.
Related endpoints
PurchasesInDelivered_getOutstanding— legacy PO lookup, not a delivery balance calculation.GoodsReceivedEntry_getRequestedDetails— current receipt-line aliases.