Order Item

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:

MetricParametersDescription
orderOrderDatetransform, operatororderOrderDate for orderItem
orderSubtotaltransform, operatororderSubtotal for orderItem
orderTaxableSubtotaltransform, operatororderTaxableSubtotal for orderItem
orderTotaltransform, operatororderTotal for orderItem
orderNetSalestransform, operatororderNetSales for orderItem
orderTotalUnitstransform, operator, productUrlListorderTotalUnits for orderItem
orderTotalTaxDiscountsAndFeestransform, operatororderTotalTaxDiscountsAndFees for orderItem
orderTotalAverageCosttransform, operatororderTotalAverageCost for orderItem
orderGrossIncometransform, operatororderGrossIncome for orderItem
orderGrossMargintransform, operatororderGrossMargin for orderItem
orderShipmentPendingValuetransform, operatororderShipmentPendingValue for orderItem
productNeqPerUnittransform, operatorproductNeqPerUnit for orderItem
productLastPurchaseLandedCostPerUnittransform, operatorproductLastPurchaseLandedCostPerUnit for orderItem
productLastPurchasePricetransform, operatorproductLastPurchasePrice for orderItem
productAverageGrossSalesPerUnittransform, operator, dateRange, facilityUrlListproductAverageGrossSalesPerUnit for orderItem
productAverageUnitsPerSaletransform, operator, dateRange, facilityUrlListproductAverageUnitsPerSale for orderItem
productCogsSalestransform, operator, dateRange, facilityUrlListproductCogsSales for orderItem
productCountSalestransform, operator, dateRange, facilityUrlListproductCountSales for orderItem
productGrossSalestransform, operator, dateRange, facilityUrlListproductGrossSales for orderItem
productMarginSalestransform, operator, dateRange, facilityUrlListproductMarginSales for orderItem
productUnitSalestransform, operator, dateRange, facilityUrlListproductUnitSales for orderItem
productUnitSalesForSalesVelocitytransform, operator, dateRange, facilityUrlListproductUnitSalesForSalesVelocity for orderItem
productReorderQuantityToOrdertransform, operator, facilityUrlList, facilityUrl, reservedSublocationFacilityUrlListproductReorderQuantityToOrder for orderItem
productReorderQuantityToOrderEditabletransform, operator, facilityUrlList, facilityUrl, reservedSublocationFacilityUrlListproductReorderQuantityToOrderEditable for orderItem
productReplenishmentQuantityToOrdertransform, operator, facilityUrlList, facilityUrl, reservedSublocationFacilityUrlListproductReplenishmentQuantityToOrder for orderItem
productReplenishmentQuantityToOrderEditabletransform, operator, facilityUrlList, facilityUrl, reservedSublocationFacilityUrlListproductReplenishmentQuantityToOrderEditable for orderItem
productStocktransform, operator, aggregate, count, facilityUrlList, includeBom, includeSupplier, lotIdSearch, stockTypeproductStock for orderItem
productStockOnHandtransform, operator, aggregate, count, facilityUrlList, includeBom, includeSupplier, lotIdSearch, reservedSublocationFacilityUrlListproductStockOnHand for orderItem
productStockReservedtransform, operator, aggregate, count, facilityUrlList, includeBom, lotIdSearch, reservationTypeproductStockReserved for orderItem
productStockOnOrdertransform, operator, aggregate, count, facilityUrlList, includeBom, lotIdSearchproductStockOnOrder for orderItem
productStockAvailabletransform, operator, aggregate, count, facilityUrlList, includeBom, includeSupplier, lotIdSearch, reservedSublocationFacilityUrlListproductStockAvailable for orderItem
productStockRemainingtransform, operator, aggregate, count, facilityUrlList, includeBom, includeSupplier, lotIdSearchproductStockRemaining for orderItem
productAverageCosttransform, operatorproductAverageCost for orderItem
productValuationtransform, operator, facilityUrlList, lotIdSearchproductValuation for orderItem
countNoneCount of items in the result set

Common Parameters:

  • operator - Aggregation function: sum, mean, min, max
  • transform - Mathematical transformation: abs
  • dateRange - Filter to specific date range
  • facilityUrlList - Filter to specific facilities

GroupBy Dimensions

Group metrics by these dimensions:

DimensionDescription
orderOrderDateorderOrderDate for orderItem
orderReceiveDateorderReceiveDate for orderItem
orderShipDateorderShipDate for orderItem
orderStatusorderStatus for orderItem
orderTypeType of order
orderFulfillmentorderFulfillment for orderItem
orderShippingServiceorderShippingService for orderItem
orderSaleSourceorderSaleSource for orderItem
orderCustomerorderCustomer for orderItem
orderCustomerPartyIdorderCustomerPartyId for orderItem
orderEligibleToShiporderEligibleToShip for orderItem
orderSupplierorderSupplier for orderItem
orderSupplierPartyIdorderSupplierPartyId for orderItem
orderOriginorderOrigin for orderItem
orderDestinationorderDestination for orderItem
orderProcessingSublocationorderProcessingSublocation for orderItem
orderTermsorderTerms for orderItem
orderDueDateorderDueDate for orderItem
orderPriceLevelorderPriceLevel for orderItem
orderBillToStateRegionorderBillToStateRegion for orderItem
orderBillToCountryorderBillToCountry for orderItem
orderBillToCountryIso3166Alpha2orderBillToCountryIso3166Alpha2 for orderItem
orderShipToStateRegionorderShipToStateRegion for orderItem
orderShipToCountryorderShipToCountry for orderItem
orderShipToCountryIso3166Alpha2orderShipToCountryIso3166Alpha2 for orderItem
orderShipFromStateRegionorderShipFromStateRegion for orderItem
orderShipFromCountryorderShipFromCountry for orderItem
orderShipFromCountryIso3166Alpha2orderShipFromCountryIso3166Alpha2 for orderItem
productCategoryproductCategory for orderItem
productSupplier1productSupplier1 for orderItem
productSupplier2productSupplier2 for orderItem
productSupplier3productSupplier3 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 formatter argument 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

Label: Allocated adjustments
Sortable: No


allocatedMiscellaneous

Label: Allocated miscellaneous
Sortable: No


averageCost

Label: COGS (estimated)
Sortable: No


averageCostPerUnit

Label: COGS per unit (estimated)
Sortable: No


averageCostPerUnitShipped

Label: Shipped average cost per unit (estimated)
Sortable: No


averageCostShipped

Label: Shipped valuation (estimated)
Sortable: No


cbm

Label: CBM subtotal
Sortable: No


class

Label: Class
Sortable: No


cost

Label: Std accounting cost amount
Sortable: No


descriptionItemNote

Label: Description / item note
Sortable: No


discount

Label: Discount
Sortable: No


extendedProductListPrice

Label: Extended product list price
Sortable: No


grossIncome

Label: Gross income (estimated)
Sortable: No


incomeAfterAdjustments

Label: Income after adjustments (estimated)
Sortable: No


incomeAfterAdjustmentsPerUnit

Label: Income after adjustments per unit (estimated)
Sortable: No


itemIndex

Label: Item index
Sortable: No


itemNote

Label: Item note
Sortable: No


landedCost

Label: Landed cost (estimated)
Sortable: No


landedCostPerUnit

Label: Landed cost per unit (estimated)
Sortable: No


marginPercentage

Label: Margin percentage (estimated)
Sortable: No


nativeNeq

Label: Native NEQ subtotal
Sortable: No


nativeWeight

Label: Native Weight subtotal
Sortable: No


neq

Label: NEQ subtotal
Sortable: No


packing

Label: Packing
Sortable: No


pricePerUnit

Label: Price per unit
Sortable: No


productCaseOrCaseEquivalentReceived

Label: Product case equivalents received
Sortable: No


productReorderVariance

Label: Product reorder variance
Sortable: No


productUnitsOrdered

Label: Product units ordered
Sortable: No


productUnitsPacked

Label: Product units packed
Sortable: No


productUnitsPackedShippedOrReceived

Label: Product units packed, shipped, or received
Sortable: No


productUnitsPackedShippedOrReceivedLessReturns

Label: Product units packed, shipped, or received less returns
Sortable: No


productUnitsReceived

Label: Product units received
Sortable: No


productUnitsRemainingToBePackedShippedOrReceived

Label: Product units remaining to be packed, shipped, or received
Sortable: No


productUnitsRemainingToBeShipped

Label: Product units remaining to be shipped
Sortable: No


productUnitsReturned

Label: Product units returned
Sortable: No


productUnitsShipped

Label: Product units shipped
Sortable: No


productUnitsVariance

Label: Product units variance
Sortable: No


quantity

Label: Quantity
Sortable: No


quantityCaseOrCaseEquivalent

Label: Quantity, case or case equivalent
Sortable: No


quantityCaseStock

Label: Quantity, case stock
Sortable: No


quantityOpenStock

Label: Quantity, open stock
Sortable: No


shortCode

Label: Short code
Sortable: No


subtotal

Label: Amount
Sortable: No


supplierProductId

Label: Supplier product ID
Sortable: No


supplierProductIdOrProductId

Label: Supplier product ID or product ID
Sortable: No


unitListPrice

Label: List price
Sortable: No


unitPrice

Label: Unit price
Sortable: No


units

Label: Units
Sortable: No


unitsPerCase

Label: Units per case
Sortable: No


warning

Label: Warning
Type: ##iconWithTooltip
Sortable: No


weight

Label: Weight subtotal
Sortable: No


Relations

product

  • Related Collection: product
  • Label: Product

TODO: Add relation description

Filters

No filters available.