Sales Orders
Show Sales Order
Returns core sales order data for the V2 show page. Includes essential fields, addresses, channel info, totals, counts, custom fields, financial lines, tags, discounts, credits, RMAs, and purchase orders.
Update Sales Order
Updates a sales order. Accepts a partial payload — only the provided fields are applied.
Get Sales Order Line Items
Returns line items with full product details, inventory, allocations, and warehouse info. Pre-loads realtime inventory for all products in a single query. Loaded in parallel with show().
Get Customer Details
Returns customer details for the customer drawer. Includes total orders, lifetime value, recent orders, and all addresses. Loaded on-demand when the user clicks the customer name.
Get Activity Log
Returns paginated activity log for the sales order, including activities on the order, its lines, and fulfillments.
Get Inventory Movements
Returns paginated inventory movements for the sales order. Includes movements from order lines, fulfillments, fulfillment lines, and related adjustments.
Get Allocations
Returns paginated inventory allocations for all lines in the sales order.
Get Channel Items
Fetches raw marketplace order item data for the channel tab. Returns original order item data from the sales channel (Amazon order items, Shopify line items, etc.) keyed by marketplace order item ID.
Update Channel Mappings
Updates the sales channel line ID mappings for sales order lines. Set sales_channel_line_id to null to unlink a line from its channel item.
Get Sales Order Financials (Proforma)
Recalculates and returns proforma (on-the-fly) line-level financials for a single sales order. The endpoint runs SalesOrderLineFinancialManager::calculate() for the order before responding, so figures always reflect current FIFO cost assignments — including the bundle cost-based revenue correction (SKU-7157).
Get Backorder Detail for Line
Returns lazy-loaded backorder detail for a sales order line. Includes release sources (what freed up stock), PO coverage info, and remaining backorder breakdown. Called on badge click — not on list load.
Get Next Backorder Schedule
Returns the next scheduled fill_backorders runs (up to 3) for countdown display. Optionally filtered by supplier to find schedules relevant to a specific product's supplier.
Create PO from Backorder
Creates a draft purchase order from a backordered sales order line. Uses the line's product's primary supplier and the shortage quantity (planned allocations without PO coverage).
List Sales Orders (V2 Datatable)
Paginated sales order listing for the Vue 3 datatable (Spatie QueryBuilder).
Export Sales Orders
Exports the sales order datatable as an XLSX or CSV file download.
Download Import Template
Downloads an XLSX import template with headers, sample data, a field guide, and reference data from the tenant's account.
Validate Import
Validates mapped import rows and returns a grouped preview. No side effects — safe to call repeatedly.
Import Sales Orders
Executes the import — creates or updates sales orders from validated/grouped data (the output of the Validate Import endpoint).
Bulk Close Sales Orders
Bulk closes one or more sales orders by transitioning their order_status to `closed`.
List Order Shipments
Lists ALL shipments (SalesOrderFulfillments) for a sales order, used by the order's Fulfillment tab. Includes VOIDED shipments (SKU-8019): a voided shipment carries a non-null `voided_at` (plus `void_reason` and `voided_by`) and `status=canceled` — it was reversed and its fulfillment order reopened, but is kept for history. The UI buckets voided shipments into a read-only 'Voided' filter and excludes them from the active lifecycle counts. Each shipment exposes its `fulfillment_lines`, warehouse, shipping method, tracking, and provider-sync timestamps.