Order Item
Overview
Order Items are the line items on orders, specifying which products are being ordered, in what quantities, at what prices, and with what delivery expectations. While the order represents the overall transaction with a customer or supplier, order items provide the product-level detail that drives fulfillment, purchasing, and financial calculations.
Each order item specifies a product, quantity, and unit price. For sales orders, the price is what the customer pays. For purchase orders, it's what you pay the supplier. The line total is calculated from quantity times price. These line totals sum together with any order-level adjustments (discounts or fees) to form the order total, which is the financial foundation of the transaction.
Order items can specify where products should be sourced or delivered. For sales orders, this might indicate which warehouse should fulfill the item. For purchase orders, it specifies which facility should receive the goods. For transfer orders, items specify origin and destination sublocations. This location information drives fulfillment planning and warehouse operations.
Lot control on order items is important for lot-tracked products. Sales order items can specify that products should come from a specific lot - for example, to ensure all items in a shipment have the same expiration date. Purchase order items can assign incoming goods to a specific lot ID. This lot-level control supports inventory management policies around expiration dates, quality control, and customer requirements.
Linked relationships connect order items to related transactions. Sales order items link to fulfillment order items, which link to shipment items, which link to invoice items. This creates a complete trace from initial order through fulfillment to billing. You can see exactly which shipment fulfilled which order line, and which invoice line billed it, supporting customer service and reconciliation.
Calculated fields on order items support operational decision-making. Available quantity shows how much stock is available to fulfill the item. Backordered quantity indicates shortfall. Reserved quantity shows what's already allocated. These calculations help fulfillment planners understand what can ship now versus what must wait for restocking.
Order item status tracking shows fulfillment progress. Items can be unfulfilled, partially fulfilled, or fully fulfilled based on related shipments. They can be uninvoiced, partially invoiced, or fully invoiced based on related invoices. These statuses drive workflow and reporting, helping operations teams prioritize work and customer service teams answer status questions.
GraphQL API
The orderItem collection provides access to orderItem data via the GraphQL API. All queries use the Relay connection specification with cursor-based pagination.
Query Name: orderItemViewConnection
Available Features:
- Cursor-based pagination (first/last/after/before)
- 1 relations to other collections
Query Examples
Basic Query
The orderItem collection is accessed via the orderItemViewConnection query, which returns a Relay-style connection with pagination support.
query {
orderItemViewConnection(first: 10) {
edges {
node {
allocatedAdjustments
allocatedMiscellaneous
averageCost
averageCostPerUnit
averageCostPerUnitShipped
}
}
pageInfo {
hasNextPage
endCursor
}
}
}Pagination
Use cursor-based pagination to retrieve large datasets:
# First page
query {
orderItemViewConnection(first: 50) {
edges {
node { supplierProductId }
}
pageInfo {
hasNextPage
endCursor
}
}
}
# Subsequent pages
query {
orderItemViewConnection(first: 50, after: "cursor-from-previous-page") {
edges {
node { supplierProductId }
}
pageInfo {
hasNextPage
endCursor
}
}
}Relations
Query related data (see Relations section for all available relations):
query {
orderItemViewConnection(first: 10) {
edges {
node {
supplierProductId
product {
title
productUrl
}
}
}
}
}Summary and Aggregation
This collection supports data aggregation and dimensional analysis through the summary field. You can calculate metrics (like totals, averages, counts) and group them by dimensions (like category, date, status).
For a comprehensive guide to using aggregations, see the Aggregation Concept Guide.
Query Structure
orderItemViewConnection(filters...) {
summary {
errorCode
errorMessage
groupBy {
# Group by dimensions (see table below)
}
metrics {
# Calculated metrics (see table below)
}
}
}Available Metrics
This collection provides 35 metrics that can be aggregated:
| Metric | Parameters | Description |
|---|---|---|
orderOrderDate | transform, operator | orderOrderDate for orderItem |
orderSubtotal | transform, operator | orderSubtotal for orderItem |
orderTaxableSubtotal | transform, operator | orderTaxableSubtotal for orderItem |
orderTotal | transform, operator | orderTotal for orderItem |
orderNetSales | transform, operator | orderNetSales for orderItem |
orderTotalUnits | transform, operator, productUrlList | orderTotalUnits for orderItem |
orderTotalTaxDiscountsAndFees | transform, operator | orderTotalTaxDiscountsAndFees for orderItem |
orderTotalAverageCost | transform, operator | orderTotalAverageCost for orderItem |
orderGrossIncome | transform, operator | orderGrossIncome for orderItem |
orderGrossMargin | transform, operator | orderGrossMargin for orderItem |
orderShipmentPendingValue | transform, operator | orderShipmentPendingValue for orderItem |
productNeqPerUnit | transform, operator | productNeqPerUnit for orderItem |
productLastPurchaseLandedCostPerUnit | transform, operator | productLastPurchaseLandedCostPerUnit for orderItem |
productLastPurchasePrice | transform, operator | productLastPurchasePrice for orderItem |
productAverageGrossSalesPerUnit | transform, operator, dateRange, facilityUrlList | productAverageGrossSalesPerUnit for orderItem |
productAverageUnitsPerSale | transform, operator, dateRange, facilityUrlList | productAverageUnitsPerSale for orderItem |
productCogsSales | transform, operator, dateRange, facilityUrlList | productCogsSales for orderItem |
productCountSales | transform, operator, dateRange, facilityUrlList | productCountSales for orderItem |
productGrossSales | transform, operator, dateRange, facilityUrlList | productGrossSales for orderItem |
productMarginSales | transform, operator, dateRange, facilityUrlList | productMarginSales for orderItem |
productUnitSales | transform, operator, dateRange, facilityUrlList | productUnitSales for orderItem |
productUnitSalesForSalesVelocity | transform, operator, dateRange, facilityUrlList | productUnitSalesForSalesVelocity for orderItem |
productReorderQuantityToOrder | transform, operator, facilityUrlList, facilityUrl, reservedSublocationFacilityUrlList | productReorderQuantityToOrder for orderItem |
productReorderQuantityToOrderEditable | transform, operator, facilityUrlList, facilityUrl, reservedSublocationFacilityUrlList | productReorderQuantityToOrderEditable for orderItem |
productReplenishmentQuantityToOrder | transform, operator, facilityUrlList, facilityUrl, reservedSublocationFacilityUrlList | productReplenishmentQuantityToOrder for orderItem |
productReplenishmentQuantityToOrderEditable | transform, operator, facilityUrlList, facilityUrl, reservedSublocationFacilityUrlList | productReplenishmentQuantityToOrderEditable for orderItem |
productStock | transform, operator, aggregate, count, facilityUrlList, includeBom, includeSupplier, lotIdSearch, stockType | productStock for orderItem |
productStockOnHand | transform, operator, aggregate, count, facilityUrlList, includeBom, includeSupplier, lotIdSearch, reservedSublocationFacilityUrlList | productStockOnHand for orderItem |
productStockReserved | transform, operator, aggregate, count, facilityUrlList, includeBom, lotIdSearch, reservationType | productStockReserved for orderItem |
productStockOnOrder | transform, operator, aggregate, count, facilityUrlList, includeBom, lotIdSearch | productStockOnOrder for orderItem |
productStockAvailable | transform, operator, aggregate, count, facilityUrlList, includeBom, includeSupplier, lotIdSearch, reservedSublocationFacilityUrlList | productStockAvailable for orderItem |
productStockRemaining | transform, operator, aggregate, count, facilityUrlList, includeBom, includeSupplier, lotIdSearch | productStockRemaining for orderItem |
productAverageCost | transform, operator | productAverageCost for orderItem |
productValuation | transform, operator, facilityUrlList, lotIdSearch | productValuation for orderItem |
count | None | Count of items in the result set |
Common Parameters:
operator- Aggregation function:sum,mean,min,maxtransform- Mathematical transformation:absdateRange- Filter to specific date rangefacilityUrlList- Filter to specific facilities
GroupBy Dimensions
Group metrics by these dimensions:
| Dimension | Description |
|---|---|
orderOrderDate | orderOrderDate for orderItem |
orderReceiveDate | orderReceiveDate for orderItem |
orderShipDate | orderShipDate for orderItem |
orderStatus | orderStatus for orderItem |
orderType | Type of order |
orderFulfillment | orderFulfillment for orderItem |
orderShippingService | orderShippingService for orderItem |
orderSaleSource | orderSaleSource for orderItem |
orderCustomer | orderCustomer for orderItem |
orderCustomerPartyId | orderCustomerPartyId for orderItem |
orderEligibleToShip | orderEligibleToShip for orderItem |
orderSupplier | orderSupplier for orderItem |
orderSupplierPartyId | orderSupplierPartyId for orderItem |
orderOrigin | orderOrigin for orderItem |
orderDestination | orderDestination for orderItem |
orderProcessingSublocation | orderProcessingSublocation for orderItem |
orderTerms | orderTerms for orderItem |
orderDueDate | orderDueDate for orderItem |
orderPriceLevel | orderPriceLevel for orderItem |
orderBillToStateRegion | orderBillToStateRegion for orderItem |
orderBillToCountry | orderBillToCountry for orderItem |
orderBillToCountryIso3166Alpha2 | orderBillToCountryIso3166Alpha2 for orderItem |
orderShipToStateRegion | orderShipToStateRegion for orderItem |
orderShipToCountry | orderShipToCountry for orderItem |
orderShipToCountryIso3166Alpha2 | orderShipToCountryIso3166Alpha2 for orderItem |
orderShipFromStateRegion | orderShipFromStateRegion for orderItem |
orderShipFromCountry | orderShipFromCountry for orderItem |
orderShipFromCountryIso3166Alpha2 | orderShipFromCountryIso3166Alpha2 for orderItem |
productCategory | productCategory for orderItem |
productSupplier1 | productSupplier1 for orderItem |
productSupplier2 | productSupplier2 for orderItem |
productSupplier3 | productSupplier3 for orderItem |
All dimensions accept a formatter parameter: "html", "none", "abbreviated", "blank-zero".
Examples
Example 1: Basic Aggregation
Calculate metrics for orderItem:
query {
orderItemViewConnection(first: 1) {
summary {
errorCode
errorMessage
groupBy {
# Add dimensions here
}
metrics {
totalCount: count
}
}
}
}Fields
This collection has 51 fields:
- 51 simple fields
- 0 enum fields (with predefined values)
- 0 parameterized fields (accept query options)
Note on Field Formatting: All scalar fields support the
formatterargument to control output format. Available options:"html","none","abbreviated","blank-zero". Some fields have a default formatter (shown below). See the Formatting guide for details.
Note on Sorting: Field sortability may vary depending on the UI context and query parameters used. Some parameter options explicitly disable sorting (marked with ⚠️ not sortable).
Simple Fields
These fields return values directly without additional options.
allocatedAdjustments
allocatedAdjustmentsLabel: Allocated adjustments
Sortable: No
allocatedMiscellaneous
allocatedMiscellaneousLabel: Allocated miscellaneous
Sortable: No
averageCost
averageCostLabel: COGS (estimated)
Sortable: No
averageCostPerUnit
averageCostPerUnitLabel: COGS per unit (estimated)
Sortable: No
averageCostPerUnitShipped
averageCostPerUnitShippedLabel: Shipped average cost per unit (estimated)
Sortable: No
averageCostShipped
averageCostShippedLabel: Shipped valuation (estimated)
Sortable: No
cbm
cbmLabel: CBM subtotal
Sortable: No
class
classLabel: Class
Sortable: No
cost
costLabel: Std accounting cost amount
Sortable: No
descriptionItemNote
descriptionItemNoteLabel: Description / item note
Sortable: No
discount
discountLabel: Discount
Sortable: No
extendedProductListPrice
extendedProductListPriceLabel: Extended product list price
Sortable: No
grossIncome
grossIncomeLabel: Gross income (estimated)
Sortable: No
incomeAfterAdjustments
incomeAfterAdjustmentsLabel: Income after adjustments (estimated)
Sortable: No
incomeAfterAdjustmentsPerUnit
incomeAfterAdjustmentsPerUnitLabel: Income after adjustments per unit (estimated)
Sortable: No
itemIndex
itemIndexLabel: Item index
Sortable: No
itemNote
itemNoteLabel: Item note
Sortable: No
landedCost
landedCostLabel: Landed cost (estimated)
Sortable: No
landedCostPerUnit
landedCostPerUnitLabel: Landed cost per unit (estimated)
Sortable: No
marginPercentage
marginPercentageLabel: Margin percentage (estimated)
Sortable: No
nativeNeq
nativeNeqLabel: Native NEQ subtotal
Sortable: No
nativeWeight
nativeWeightLabel: Native Weight subtotal
Sortable: No
neq
neqLabel: NEQ subtotal
Sortable: No
packing
packingLabel: Packing
Sortable: No
pricePerUnit
pricePerUnitLabel: Price per unit
Sortable: No
productCaseOrCaseEquivalentReceived
productCaseOrCaseEquivalentReceivedLabel: Product case equivalents received
Sortable: No
productReorderVariance
productReorderVarianceLabel: Product reorder variance
Sortable: No
productUnitsOrdered
productUnitsOrderedLabel: Product units ordered
Sortable: No
productUnitsPacked
productUnitsPackedLabel: Product units packed
Sortable: No
productUnitsPackedShippedOrReceived
productUnitsPackedShippedOrReceivedLabel: Product units packed, shipped, or received
Sortable: No
productUnitsPackedShippedOrReceivedLessReturns
productUnitsPackedShippedOrReceivedLessReturnsLabel: Product units packed, shipped, or received less returns
Sortable: No
productUnitsReceived
productUnitsReceivedLabel: Product units received
Sortable: No
productUnitsRemainingToBePackedShippedOrReceived
productUnitsRemainingToBePackedShippedOrReceivedLabel: Product units remaining to be packed, shipped, or received
Sortable: No
productUnitsRemainingToBeShipped
productUnitsRemainingToBeShippedLabel: Product units remaining to be shipped
Sortable: No
productUnitsReturned
productUnitsReturnedLabel: Product units returned
Sortable: No
productUnitsShipped
productUnitsShippedLabel: Product units shipped
Sortable: No
productUnitsVariance
productUnitsVarianceLabel: Product units variance
Sortable: No
quantity
quantityLabel: Quantity
Sortable: No
quantityCaseOrCaseEquivalent
quantityCaseOrCaseEquivalentLabel: Quantity, case or case equivalent
Sortable: No
quantityCaseStock
quantityCaseStockLabel: Quantity, case stock
Sortable: No
quantityOpenStock
quantityOpenStockLabel: Quantity, open stock
Sortable: No
shortCode
shortCodeLabel: Short code
Sortable: No
subtotal
subtotalLabel: Amount
Sortable: No
supplierProductId
supplierProductIdLabel: Supplier product ID
Sortable: No
supplierProductIdOrProductId
supplierProductIdOrProductIdLabel: Supplier product ID or product ID
Sortable: No
unitListPrice
unitListPriceLabel: List price
Sortable: No
unitPrice
unitPriceLabel: Unit price
Sortable: No
units
unitsLabel: Units
Sortable: No
unitsPerCase
unitsPerCaseLabel: Units per case
Sortable: No
warning
warningLabel: Warning
Type: ##iconWithTooltip
Sortable: No
weight
weightLabel: Weight subtotal
Sortable: No
Relations
product
- Related Collection: product
- Label: Product
TODO: Add relation description
Filters
No filters available.
