E120: Update purchase order item
PATCH /api/purchase-order-items/:id
Edits a single PO line. Triggered from the Purchase Order Detail items section. Quantity (or material/SKU) changes rewrite the line's projected ORDER event — reverse + re-project at the new values; cost-only patches skip the ledger.
Authentication
Standard tenant route. Requires Authorization: Bearer <firebase-id-token> and X-Org-Id: <org-id>. Access: Member.
Request
{
"quantity": 120,
"unitCost": 12.00
}
Response — 200 OK
{
"id": "uuid",
"poId": "uuid",
"materialId": "uuid",
"skuId": null,
"quantity": 100,
"unitCost": 12.34
}
Errors
| HTTP | code | Condition |
|---|---|---|
| 404 | not_found | No such item. |
| 409 | conflict | A receipt exists against the PO — line items are locked. |
| 422 | validation_failed | Field shape invalid. |