Remove a purchase order line item
Removes a line from a purchase order.
Added 2026-08-17 (campaign PO-LINE-EDIT). The internal application has
always had this verb; the public API had POST /items and
PATCH /items/{itemId} and no DELETE, so an API-key caller could add and
edit a line but could only “undo” an add by patching its quantity down.
Eligibility is stricter than for an edit, because a delete destroys the line’s identity rather than changing it:
draft: allowed.open: allowed ONLY while the line has zero received units (422line_has_receiptsotherwise — reduce the quantity to what arrived, or close the purchase order short).processing: never (422delete_blocked_on_processing) — the order carries inventory layers and a three-way-match baseline.fulfilled/cancelled/archived/expired, or any status this predicate has not ruled on: never.- While awaiting approval: never.
A line with dependent records (receipts, vendor-bill lines, inventory
transactions, serials, allocations, backorders, returns, package items,
landed-cost attributions, or child lines) is refused with 422
line_has_dependent_records and the body names the blocking relations in
blockers. Previously such a delete surfaced as an unstructured 500.
Side effects (THE ONE RULE — same canonical handler as the in-app
delete), all inside one transaction: unlinks any sales-order lines that
were drop-shipping this exact product through this purchase order,
decrements the on_purchase_order cache by the unreceived quantity,
recomputes the purchase-order header total, bumps revision_count on a
sent order, and emits Rule 13 broadcasts plus a po_item_removed (or
po_revised) activity entry.
purchasing:writeAuthorizations
API key issued per entity via Settings > Developers > API Keys.
Each key carries scopes (e.g. orders:read, products:write).
Bearer token format: Authorization: Bearer ark_live_ent_Test keys use ark_test_ent_. Both are issued per entity
via Settings > Developers > API Keys.
Headers
Optional idempotency key for safe retries (Stripe-style).
255Path Parameters
The purchase order id.
The PO line item (order_item) id to edit.

