E115: Delete purchase order
DELETE /api/purchase-orders/:id
Wipes a PO and all of its inventory effects. Triggered from the Purchase Order Detail page. For materials POs that had received goods, the cost cascade is unwound so downstream work-order and finished-goods costs return to their pre-receipt state.
Authentication
Standard tenant route. Requires Authorization: Bearer <firebase-id-token> and X-Org-Id: <org-id>. Access: Member.
Request
No body.
Response — 200 OK
{ "deletedId": "uuid" }
Echo of the deleted purchase order's id.
Errors
| HTTP | code | Condition |
|---|---|---|
| 404 | not_found | No such PO. |
| 409 | in_use | PO has receipts or is referenced downstream — issue a cancellation (status change + reverse ledger entries) instead of delete. |
Workflow
Calls W115 Delete purchase order.