Skip to main content

Get Sales Order Line Items

GET 

/api/v2/sales-orders/:salesOrder/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.

Required scope: orders:read

Grant this scope to your token under Settings → Developer → Personal Access Tokens.

Unmapped channel lines (product_id is null) include a listing object describing the raw sales-channel listing (Amazon, Shopify, eBay, WooCommerce) used by the "Link Line Item to Product" modal. For Amazon lines whose seller SKU matches a synced AmazonProduct, the listing object also includes the internal id and integration_instance_id, which the UI uses to deep-link to the Amazon product detail page.

Each line item includes bundle_proration_basis ("cost" | "price" | "quantity" | null). For bundle component lines this indicates the methodology used to prorate the bundle’s price across its components: "cost" — proportional to component unit costs (used when all components have unit_cost > 0); "price" — proportional to component prices (fallback when any component is missing a cost but all have price > 0); "quantity" — equal split per component quantity (last-resort fallback). Null for non-component lines and for legacy component lines expanded before this feature (those were price-based).

Each line item also carries immutable order-line provenance: channel_product_external_id (string|null) is the sales-channel listing identifier the line came in as, snapshotted the first time the line is mapped to a product listing — it is never overwritten by a later remap, and survives deletion of the convenience listing pointer. sales_channel_product_id (int|null) is reserved for the forthcoming sales_channel_products supertype and is null until that phase ships. Lines that have not yet been mapped report both as null.

Authentication: Requires Bearer token.

Allocation lock: allocation_locked (bool) is true when the line is tied to a fulfillment order beyond open+unsubmitted — submitted to a carrier, or a channel-imported/manual/pickup fulfillment. When true, allocation_locked_reason (string) explains why the line can no longer be allocated/re-allocated (e.g. add stock to reconcile an imported fulfillment). The UI disables the "Allocate" action and shows the reason.

Request

Responses

OK