Cancel an order
Authorization: requires orders:write API-key scope AND the per-user
orders.edit permission (SoD parity with the Cognito-JWT path; the api-v1
wrapper used to gate on scope alone, which let any junior staff with a
orders:write API key bypass the role check the human-user path enforces).
System-actor calls without an identifiable principal are denied per
AICPA SoC2 CC6.1.
Cancels a sales order. The order must not be fulfilled, partially fulfilled, already cancelled, paid-in-full while fulfilled, have active shipments, or have open RMAs. If the order generated child drop-ship purchase orders (auto-created on confirm via the drop-ship cascade), the cascade behavior is enforced atomically:
- If any child PO has received goods (purchase_receipts exist), HTTP 409
dropship_po_received_blocks_so_cancel. Operator must process a vendor return or close-short the PO first, then retry. - If any child PO was sent to the vendor but has no receipts, HTTP 409
dropship_po_sent_blocks_so_cancel. Operator must contact the vendor and cancel the PO manually first, then retry. - Otherwise (every child PO is draft/open, no receipts, sent_at IS NULL),
all child POs are cancelled atomically inside the same transaction as
the SO cancel. The response surfaces
cascaded_drop_ship_pos[]listing each child PO auto-cancelled by the cascade.
If the order has child work orders (auto-created via the manufactured-line
cascade, work_orders.source_order_id = parent SO id), the same atomic
cascade behavior applies:
- If any child WO has status
completedorclosed, HTTP 409manufactured_wo_completed_blocks_so_cancel. The build has happened; operator must process an RMA or scrap the finished goods first. - If any child WO has status
in_progress, HTTP 409manufactured_wo_in_progress_blocks_so_cancel. The shop floor has started work; operator must contact production and cancel the WO manually first (race window with material consumption). - Otherwise (every child WO is
draftorreleased), all child WOs are cancelled atomically inside the same transaction as the SO cancel. The canonicalcancelWorkOrderreverses any issued material to stock and releases the source serial back toavailable. The response surfacescascaded_work_orders[]listing each child WO auto-cancelled by the cascade.
NEW-GAP: body.skip_marketplace_sync flag is not yet implemented in the canonical cancelOrder handler. Will be added via NEW-GAP-API-CANONICAL-MARKETPLACE-SYNC-OPT-OUT.
Authorizations
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
Client-generated unique key for idempotent POST/PATCH/DELETE operations. Alias for the Idempotency parameter. Max 255 chars. On retry with the same key, the original response is returned without re-executing the operation. Keys expire after 24 hours.
255Path Parameters
Response
Cancelled order; response may include cascaded_drop_ship_pos[] listing
child drop-ship POs auto-cancelled by the cascade and cascaded_work_orders[]
listing child work orders auto-cancelled by the cascade.
An Arcus ERP order document. One table holds quotes, sales_orders, invoices, returns, and purchase_orders -- always filter by document_type. entity_id is always from the API key (Layer 1 isolation).
order quote, sales_order, invoice, return, purchase_order draft, confirmed, partially_fulfilled, fulfilled, cancelled, voided, awaiting_ach_clearance, on_hold unpaid, partially_paid, paid, overpaid, refunded, partially_refunded, voided unfulfilled, partially_fulfilled, fulfilled Derived (display-only): SUM(list_price * qty) over non-kit lines. The gross baseline of the gross-to-net bridge (List price minus pricing_savings equals subtotal). Never part of order_total.
Derived (display-only): SUM(pricing_rule_adjustment * qty) over non-kit lines (positive magnitude). Per-unit pricing-rule savings already baked into subtotal via sell_rate (ASC 606 transaction price); shown as an informational List-to-Subtotal bridge, never subtracted from order_total.
SSOT: utils/ar-helpers.mjs::updateARBalance. Do not write directly.
ship, pick_up, local_delivery order, manual, proforma, correction 
