Skip to main content
Version: v1.0.0(int)

W113: Get purchase order detail

Returns a single PO with everything the detail page needs to render in one round-trip. Triggered by clicking a PO in the list.

Steps

  1. Load the PO header. Call PurchaseOrders.getPoById. The L2 op returns the header plus the same computed expectedTotal and actualTotal fields described in W112.

  2. Load items with received-quantity rollup. Call PurchaseOrders.listItemsByPo. Each item carries a derived receivedQuantity summed from po_receipt_items so the page can show line-level progress.

  3. Batch-load related rows. Vendor, ship-to location, and the catalog rows (materials for materials POs, SKUs for FG POs) referenced by the items.

  4. Merge into a hydrated view. Single combined payload, ready for the page to render.

Returns

The PO header (with expectedTotal and actualTotal) plus items (with receivedQuantity), vendor, location, and referenced catalog rows.

Business rules

  • Single payload by design. All shared dropdown data (status types, etc.) comes from separate workflows; this one returns only the PO and its direct references.
  • Receipts themselves are a separate read. Use W123 (List receipts for a PO) or W124 (Get receipt detail) for the receipt-side data; this workflow does not embed receipts in the response.

Errors

  • NotFoundError. The PO was not found.