Receive Purchase Order
receive_purchase_orderReceive a delivery against an issued purchase order, line by line — the Receiving page. For each line give the units that arrived (partial is fine) and, for a short shipment, the units to record as missing. Received units go into stock at the item's default location or a location you name, with lot / expiry / serials for tracked items; cost layers, the receiving journal entry and backorder release happen as in the UI. Receiving more than was ordered needs confirmOverReceive=true and is only possible when the tenant allows over-receiving. The preview shows ordered, already received, receiving now and remaining per line, plus the base-unit quantity and cost that land in stock. Two-step: preview=true, then commit with the previewReceipt. Call get_purchase_order_receiving first for lineIds. Omit lines to receive everything still open on every line ("it all arrived") into each item's default location; tracked items still need their lot or serials, so name those lines. A draft order must be issued before it can be received.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"purchaseOrder": "<purchaseOrder>"
},
"name": "receive_purchase_order"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lines | No | Lines to receive (max 200). All lines commit together or not at all. Omit (or pass an empty list) to receive every remaining unit on every line. | |
| preview | No | Step 1 of the required two-step write: set true to validate and receive a structured preview plus a single-use previewReceipt. Nothing is received until the commit call. | |
| receiptInput | No | Echo the receiptInput returned by preview on commit and retries. It is hash-bound to the receipt; do not edit it. | |
| purchaseOrder | Yes | Purchase order id (GUID), document number (e.g. PO-2026-10-000118), or the short form people use for an open order: its last digits ("118", "PO 118"). | |
| idempotencyKey | No | Caller-generated idempotency key; required with previewReceipt to commit. | |
| previewReceipt | No | Step 2: the receipt returned by the preview call. Supply with a fresh idempotencyKey to commit. | |
| confirmOverReceive | No | Set true only after the user agreed to receive more than was ordered on a line. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | No | ||
| preview | No | ||
| warnings | No | ||
| expiresAt | No | ||
| statusAfter | No | ||
| actionItemId | No | ||
| confirmation | No | ||
| receiptInput | No | ||
| correlationId | No | ||
| linesReceived | No | ||
| approvalResult | No | ||
| idempotencyKey | No | ||
| previewReceipt | No | ||
| purchaseOrderId | No | ||
| idempotentReplay | No | ||
| linesMarkedMissing | No | ||
| purchaseOrderNumber | No |