xMatix
Sign in Request demo
xMatix
PRODUCTS
SalesField SalesCRMRewardsClaimsInventoryProcurementWarehouse ManagementField ServiceServiceSupportTelephony & MessagingFinance & AccountingPayrollExpense ManagementCommercePortalsAnalytics & ReportingData StudioMobile AppSee all products →
PLATFORM
Platform overviewApp BuilderAutomationIntegrationsSecurity & GovernanceChange ManagementDevelopers
SENSE AI
Sense AI overviewSense AssistSense ControlSense VisionAI StudioTrust & governanceIn Claude & ChatGPTUse cases
SOLUTIONS
FMCG & DistributionManufacturing & Dealer NetworksAutomotive & DealershipsPharma & HealthcareConsumer DurablesAgri-InputsBuilding MaterialsService NetworksWarehousing & 3PLFinancial AccountingERP SoftwareIndia GST ComplianceUAE VAT & e-InvoicingSaudi ZATCA & VATAll solutions →
RESOURCES
Knowledge CenterDeveloper & CLIBlogGuidesWhat is xMatix?Company facts
COMPANY
AboutCareersPartnersEventsContactAuthorsLegal
Sign in Request demo
Home/Docs/Entity Reference/Order Line — entity reference
REFERENCE · Last reviewed

Order Line — entity reference

One item position of a sales Order (OrderId plus ItemId and Quantity) carrying its own pricing, discount, tax and inventory context. Each processing stage keeps a cumulative counter that the platform rolls up from the child documents — FulfilmentOrderQuantity from inventory-fulfilment order lines, FulfilmentAllocatedQuantity from allocation lines, PickedQuantity and the three picking counters from picking lines, InvoiceQuantity (split into AllocatedInvoicedQuantity and OTCInvoicedQuantity) from invoice lines, DeliveryQuantity from delivery lines, ReturnedQuantity from credit-note lines — and every Pending field is calculated as Quantity minus the relevant counter minus CancelledQuantity. The money fields are calculated too, not stored input: BaseAmount, then NetDiscount and NetSchemeDiscount, then Amount and GrossAmount. RequestedQuantity is virtual and exists only as the per-line argument of the order's Selective actions.

Fields

FieldLabelTypeRequiredWhat it does
AllocatedInvoicedQuantityAllocated Invoiced QuantityNumberThe part of InvoiceQuantity that came from invoice lines carrying an InventoryFulfilmentAllocationLineId — quantity invoiced out of allocated stock. Its counterpart OTCInvoicedQuantity is the sum where that link is absent.
AmountAmountCalculated (calculated)Calculated as BaseAmount less NetSchemeDiscount and NetDiscount — unless ApplyPostTaxDiscount is set, in which case the discounts are held back for GrossAmount and Amount is simply BaseAmount. Rolls up into Order.LineSubTotal.
ApplyPostTaxDiscountApply Post Tax DiscountBooleanSwitches the discount base for the whole line. When false, discounts come off BaseAmount before tax; when true they are computed on BaseAmount plus TaxAmount and subtracted after tax, which changes NetDiscount, NetSchemeDiscount, Amount and GrossAmount together.
BaseAmountBase AmountCalculated (calculated)Calculated as (Quantity - CancelledQuantity) times the effective unit price, where UnitPrice2 takes precedence over UnitPrice whenever it is greater than zero. Every other money field on the line derives from it.
BenefitIndexBenefit IndexNumberPositional selector for the applied benefit when a scheme line offers several; it is passed to ApplyScheme as benefitIndex and cleared again by ResetScheme.
BillingFrequencyBilling FrequencyText
BillingTypeBilling TypePickListValues: Advance, Arrears.
BranchIdBranchText
CancelledQuantityCancelled QuantityNumberCumulative cancelled quantity, increased by CancelOrder and SelectiveCancelOrder by the line's pending fulfilment quantity (or by the requested amount). It is subtracted in BaseAmount and in every Pending* formula, so cancelling both stops further processing and reduces the line's value.
ChargeTypeCharge TypePickListValues: One Time, Recurring, Usage.
ContractDiscountContract DiscountPercent
ContractDiscountAmountContract Discount AmountCurrencyExplicit value of the third discount pair; it overrides the ContractDiscount percentage inside NetDiscount and is one of the fields copied across when order lines are generated from a quote or an opportunity.
ConversionRatioConversion RatioNumber
ConversionRatio1Conversion Ratio 1Number
CreatedByIdCreated ByLookup → UserAccountYes
CreatedDateTimeCreated DateDateAndTimeYes
DeliveryQuantityDelivery QuantityNumberCumulative delivered quantity, rolled up from delivery-order lines. It reduces PendingDeliveryQuantity and is also subtracted inside PendingPickingQuantity, so despatching picked stock closes the picking loop.
DiscountDiscountPercentRegular discount percentage. On insert a non-zero header Order.Discount overwrites it, and on save it is forced to zero whenever DiscountAmount is supplied — the explicit amount always wins.
Discount2Discount2DecimalYes
DiscountAmountDiscount AmountCurrencyExplicit regular discount value. Supplying it zeroes the Discount percentage on save and takes precedence over it inside NetDiscount.
DiscountAmount2Cash Discount AmountCurrencyExplicit value of the second, independent discount pair, labelled 'Cash Discount Amount'. Supplying it zeroes the Discount2 percentage on save and takes precedence over it inside NetDiscount, where it is added on top of the regular and contract discounts.
DiscountGroupRuleIdDiscount Group RuleLookup → DiscountGroupRule
ExcludeInAutoOrderExclude In Auto OrderBoolean
ExternalIdExternalText, unique
FulfilmentAllocatedQuantityFulfilment Allocated QuantityNumberCumulative quantity reserved against specific stock lots, rolled up from InventoryFulfilmentAllocationLine.Quantity. It is the base of PendingFulfilmentAllocationQuantity, of PendingPickingQuantity and of the allocation-backed invoicing path.
FulfilmentOrderQuantityFulfilment Order QuantityNumberCumulative quantity placed on inventory fulfilments, rolled up automatically from InventoryFulfilmentOrderLine.Quantity — the handler treats it as a system field, so it is never entered by hand. PendingFulfilmentOrderQuantity is Quantity minus this minus CancelledQuantity.
GrossAmountGross AmountCalculated (calculated)Calculated line total: Amount plus TaxAmount, minus the scheme and regular discounts when ApplyPostTaxDiscount is set (they were already removed inside Amount otherwise). Rolls up into Order.TotalOrderAmount and Order.TotalLineGrossAmount.
IdIdGuidYes
InventoryLedgerIdInventory LedgerLookup → InventoryLedgerSet once the line has been posted to the inventory ledger. PerformInventoryPosting selects exactly the lines where it is still empty, so it doubles as the already-posted marker and the action fails validation when no such line remains.
InventoryStockIdStockLookup → InventoryStockThe InventoryStock bucket resolved for this line's item, SKU, lot type and storage location. It is resolved on insert and re-resolved whenever any of those four fields change, and it is what StockAvailable and StockInHand read through.
InvoiceGroupInvoice GroupPickListValues: Product, Part, Insurance.
InvoiceQuantityInvoice QuantityDecimalCumulative invoiced quantity, rolled up from InvoiceLine.Quantity and split in the same pass into AllocatedInvoicedQuantity and OTCInvoicedQuantity depending on whether the invoice line carries an allocation line. PendingInvoiceQuantity is Quantity minus CancelledQuantity minus this.
IsILPostedIL PostedBoolean
IsILPostingApprovedIL Posting ApprovedBoolean
IsPriceBundledPrice BundledBooleanMarks the line as priced inside a bundle. Validation rejects saving such a line with a UnitPrice above zero, on the update path as well as on insert.
IsSchemeGeneratedScheme GeneratedBooleanTrue on lines the promotion engine created as a scheme benefit rather than lines a user entered. The engine excludes such lines when it aggregates the document to test scheme qualification, so generated benefit lines cannot themselves earn further benefits.
ItemAliasIdItem AliasLookup → ItemAlias
ItemAlternateIdItem AlternateLookup → ItemAlternate
ItemComponentIdItem ComponentLookup → ItemComponentThe package component definition this exploded line came from. It is the identifier supplied to ApplyPackageConfiguration when choosing and sizing the components of a configurable package line.
ItemIdItemLookup → ItemYes
ItemLotIdItem LotLookup → ItemLotA specific stock lot named on the line. When fulfilment is released, this value is copied onto the inventory fulfilment order line that is created, alongside the line's item, SKU and storage location.
ItemLotTypeIdItem Lot TypeLookup → ItemLotType
ItemNameItem NameText
ItemServiceContractIdItem Service ContractLookup → ItemServiceContract
LimitExpiryDaysLimit Expiry DaysLargeNumber
ModifiedByIdModified ByLookup → UserAccountYes
NameDocument NumberText
NetDiscountNet DiscountCalculated (calculated)Calculated total of the three discount pairs — regular (Discount / DiscountAmount), cash (Discount2 / DiscountAmount2) and contract (ContractDiscount / ContractDiscountAmount). Within each pair an explicit amount overrides the percentage, and a percentage is taken on BaseAmount, or on BaseAmount plus TaxAmount when ApplyPostTaxDiscount is set.
NetSchemeDiscountNet Scheme DiscountCalculated (calculated)Calculated promotion discount for the line: SchemeDiscountAmount when supplied, otherwise SchemeDiscount applied as a percentage of BaseAmount (or of BaseAmount plus TaxAmount when ApplyPostTaxDiscount is set). Held separately from NetDiscount so promotion value can be reported on its own.
OpportunityLineIdOpportunity LineLookup → OpportunityLine
OrderDiscountOrder DiscountCalculated (calculated)Calculated mirror of the parent Order.Discount, refreshed whenever the header discount changes. On insert a non-zero value is copied into the line's own Discount, and it is that copy — not this field — which feeds NetDiscount.
OrderIdOrderLookup → Order
OriginalItemIdOriginal ItemLookup
OTCInvoicedQuantityOTC Invoiced QuantityNumberOver-the-counter invoiced quantity: the part of InvoiceQuantity from invoice lines with no allocation line behind them. Credit notes raised against this line add back into it alongside InvoiceQuantity.
OwnerIdOwnerLookup → UserAccountYes
PackageOrderLineIdOrder LineLookup → OrderLineSelf-reference to the parent package line: component lines exploded from a package item point back at the line that owns them. Editing the parent's quantity recalculates the children, deleting the parent cascades to them, and changing Item or SKU on either a package line or a component is rejected.
PartnerAccountIdPartner AccountCalculated
PendingAllocatedInvoicedQuantityPending Allocated Invoiced QuantityCalculated (calculated)Calculated: for an inventory-tracked item it is FulfilmentAllocatedQuantity minus AllocatedInvoicedQuantity — reserved but not yet billed; for an item that does not track inventory it falls back to PendingInvoiceQuantity.
PendingDeliveryQuantityPending Delivery QuantityCalculated (calculated)
PendingFulfilmentAllocationQuantityPending Fulfilment Allocation QuantityCalculated (calculated)
PendingFulfilmentOrderQuantityPending Fulfilment Order QuantityCalculated (calculated)
PendingInvoiceQuantityPending Invoice QuantityCalculated (calculated)
PendingPickingQuantityPending Picking QuantityCalculated (calculated)
PickedQuantityPicked QuantityNumberCumulative quantity picked, rolled up from InventoryFulfilmentPickingLine.Quantity together with the three other picking counters. Note that PendingPickingQuantity is built from PickingRequestedQuantity rather than from this field.
PickingCancelQuantityPicking Cancel QuantityNumber
PickingRequestedQuantityPicking Requested QuantityNumberCumulative quantity requested on picking lines, rolled up from InventoryFulfilmentPickingLine.RequestedQuantity. PendingPickingQuantity subtracts it (and DeliveryQuantity) from FulfilmentAllocatedQuantity and adds back PickingCancelQuantity and PickingReturnQuantity, so requesting a pick immediately removes that quantity from the pickable pool and cancelling or returning it puts it back.
PickingReturnQuantityPicking Return QuantityNumber
PriceAsOnDatePrice As On DateDatePer-line pricing date, which takes precedence over the order's PriceAsOnDate when the engine picks the effective PriceListRule. Changing it, PriceListId or PriceListRuleId re-resolves the line's prices on save.
PriceListIdPrice ListLookup → PriceList
PriceListRuleIdPrice List RuleLookup → PriceListRule
PurchaseOrderLineIdPurchase Order LineLookup → PurchaseOrderLineLinks the line to the purchase order line it was generated from in the dealer flow. Inserting such a line, or changing its quantity, rolls that quantity up into the purchase order line's OrderQuantity.
QuantityQuantityNumberYesThe ordered quantity and the base for every stage counter — each Pending* field is Quantity minus what has already passed that stage minus CancelledQuantity. Reducing it below what has already been processed is rejected by the order service's quantity validation on update.
QuoteLineIdQuote LineLookup → QuoteLineBack-reference to the quote line this order line was copied from when the order was inserted with a QuoteId; the equivalent for the opportunity path is OpportunityLineId.
RecordTypeIdRecord TypeGuid, hidden
RequestedQuantityRequested QuantityDecimal
ReturnedQuantityReturned QuantityNumberCumulative quantity returned through credit notes, rolled up from CreditNoteLine.Quantity against this line. It does not appear in any Pending* formula, so a return does not by itself reopen the line for fulfilment or invoicing.
RNAExternalIdRNA ExternalText
RNAOrderExternalIdRNA Order ExternalText
SchemeBenefitIdScheme BenefitLookup → SchemeBenefit
SchemeDiscountScheme DiscountPercent
SchemeDiscountAmountScheme Discount AmountCurrency
SchemeLineIdScheme LineLookup → SchemeLineThe scheme line that was applied to this order line. It is the identifier the ApplyScheme action requires in its arguments, and that action rejects an id which does not reference an existing scheme line.
SchemeRewardPointsScheme Reward PointsLargeNumberReward points earned on this line from an applied scheme benefit. They are stamped onto the document's non-generated lines and are what the scheme ledger reads as its RewardPoints when the benefit is recorded.
SkipSchemeSkip SchemeBoolean
SKUIdSKULookup → SKU
StockAvailableStock AvailableCalculated (calculated)Calculated pass-through of the linked InventoryStock.Available, or zero when InventoryStockId is empty. It is free-to-promise quantity at the line's item, SKU, lot type and storage location, refreshed whenever any of those change.
StockInHandStock In HandCalculated (calculated)Calculated pass-through of the linked InventoryStock.InHand — the physical quantity held, which still includes stock reserved for other demand. Compare it with StockAvailable before promising a quantity.
StorageLocationIdStorage LocationLookup → StorageLocationStorage location the line draws from. It participates in resolving InventoryStockId, and it is carried onto the inventory fulfilment order line created when fulfilment is released.
Tax1Tax 1Currency
Tax1NameTax Name 1Text
Tax1RateTax Rate 1Currency
Tax1TypeTax Type 1Text
Tax2Tax 2Currency
Tax2NameTax Name 2Text
Tax2RateTax Rate 2Currency
Tax2TypeTax Type 2Text
Tax3Tax 3Currency
Tax3NameTax Name 3Text
Tax3RateTax Rate 3Currency
Tax3TypeTax Type 3Text
Tax4Tax 4Currency
Tax4NameTax Name 4Text
Tax4RateTax Rate 4Currency
Tax4TypeTax Type 4Text
Tax5Tax 5Currency
Tax5NameTax Name 5Text
Tax5RateTax Rate 5Currency
Tax5TypeTax Type 5Text
Tax6Tax 6Currency
Tax6NameTax Name 6Text
Tax6RateTax Rate 6Currency
Tax6TypeTax Type 6Text
TaxAmountTax AmountCurrencyTotal of the line's six tax slots; the handler treats it as a system field rather than user input. It feeds GrossAmount and rolls up into Order.TotalLineTaxAmount.
TaxGroupIdTax GroupLookup → TaxGroup
UIPropsUI PropsText
UnitPriceUnit PriceCurrencyYes
UnitPrice2Unit Price 2Currency
UOMUOMPickListValues: Pack, Each, Box, Barrel, Litres, MB, Minutes, Messages, kWh.
UOM1UOM 1PickListValues: Pack, Each, Box, Barrel, Litres, MB, Minutes, Messages, kWh.
UOMQuantityUOM QuantityDecimal
UOMQuantity1UOM Quantity 1Decimal
UpdatedDateTimeModified DateDateAndTimeYes

Actions

ActionLabelTypeWhat it does
BarcodeQuickAddBarcode ScannerUIActionScan barcodes to add order lines
CloneCloneServerAction (Clone)Create a copy of this record
DeleteDeleteDeleteDelete
DeleteInListDeleteDeleteDelete in a list page
EditEditEditEdit
EditHeaderEditEditInlineEdit
EditListRowEditEditEditListRow
ImportImportUIActionList-header action that opens the ImportSO layout to bring order lines in from a file rather than entering them one by one. It is a client-side layout action with no server action behind it; the imported rows go through the normal order-line save path.
NewInLineQuick AddNewInlineLabelled 'Quick Add': adds an order line inline in the grid rather than through the full line form. The line handler still applies all its defaults on save — item alias, unit conversion, prices, taxes, discounts, stock resolution, package explosion and scheme processing — exactly as for a full-form insert.
ProductCatalogueProduct CatalogueUIActionList-header button that opens the product catalogue layout for adding lines to the order. It names no server action, so pressing it runs nothing on the server.

Validations

ValidationApplies toError messageNotes
Quantity Cancelled Rule ValidationCancelledQuantity, ErrorQuantity cancelled cannot be greater than Quantity.Quantity cancelled cannot be greater than Quantity.
Quantity Rule ValidationQuantity, ErrorQuantity should not be less than 0Quantity should not be less than 0
Track Asset Quantity ValidationQuantity, Error, inactiveQuantity cannot be greater than 1 for asset-tracked items.When Track Asset is enabled on the Item, quantity cannot exceed 1.
Unit Price Rule ValidationUnitPrice, ErrorUnit Price can not be less than 0Unit Price can not be less than 0
Validate On Incorrect Item AliasItemAliasId, ErrorItem Alias is not valid.Item Alias is not valid.

Lookup filters

FilterLookup fieldNotes
Lot for Partner and BranchItemLotId
Lot Type for ItemItemLotTypeId
Sku For ItemSKUId