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.
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
Get FNSKU product mapping activity log for an integration instance.
Get Inventory Movements
Returns paginated inventory movements generated by this warehouse transfer (both ship-out and receive-in movements).
Get Allocations
Returns inventory allocations linked to this warehouse transfer.
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 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).