Goods Received
Create an empty legacy receipt line
/a/GoodsReceivedEntry_new
Allocate a blank receipt-line record against a purchase order.
When to use this endpoint
Allocate a blank receipt-line record against a purchase order.
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 |
|---|---|---|---|
po_id | Integer | Yes | Presence required, then intval must be positive. The purchase order must exist and be active; approval and supplier matching are not checked. |
Example request
FM_api('GoodsReceivedEntry_new', ['po_id'=>'482']);
Example response
{"ok":1,"id":"701"}
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: po_id"} | po_id omitted. |
{"error":"no po_id supplied"} | po_id integer-coerces below 1. |
{"error":"purchase order does not exist"} | PO is missing/deleted; no line is created. |
{"error":"goods receipt write failed"} | Insert/history persistence failed; transaction rolls back. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- Only po_id, cdate and last_edited are inserted. grn_id, poe_id, stock and quantity remain table defaults; this is not an actual receipt against a header.
- The active PO is locked. Insert, creation history and cache invalidation use a checked transaction; a failed read/write/history/commit returns an error and does not leave a line.
- GoodsReceivedEntries_get expects a header ID; passing this new line ID does not retrieve the line. Use the mapped line reader with id.
Side effects
- Transactional blank purchases_in_entries row and creation history, with receipt-line cache invalidation. No stock/inventory movement, header linkage or PO status change.
See it in Fieldmotion
CRM1
No direct CRM1 caller was found. CRM1 uses the legacy GoodsReceived_newNote, GoodsReceivedEntries_get and GoodsReceivedNote_* workflow instead.
CRM2
No CRM2 caller was found. CRM2 receipt creation uses GoodReceived_createData and its entry widget.
Related endpoints
GoodsReceivedEntry_createData— mapped line creation with grnID/stock/qty.GoodsReceivedEntry_getRequestedDetails— read by line ID.