Skip to content

Sales order fields

Sales orders combine a header, one or more item lines, computed money fields, fulfillment state, and provider sync state. Snapshot fields keep old orders readable when related records are renamed.

header fieldsline fieldsstatus values

FieldTypeDefaultMeaning
orderNumbervarchar(32)autoHuman-readable order number, unique per organization.
customerIduuidrequiredCustomer the order is for.
customerNamevarchar(255)snapshotCustomer name copied onto the order.
customerProjectIduuidnullOptional project link.
statusconstrained varcharopenStored status: open or done.
priorityRankintegernullQueue rank for open-order allocation.
orderDatedatetodayDate the order was taken.
shipDatedatenullDelivery deadline used by planning and allocation.
requestedDatedatenullDate the customer asked for — stored/API only (used as the Xero invoice due date); not shown on the order detail grid.
shippedAttimestamptznullSet when delivery ships the final remaining quantity. Closing a partial by cancelling the remaining items does not change it.
ship* fieldsvarcharcustomer defaultShip-to address lines, city, region, postcode, country.
billing* fieldsvarcharcustomer defaultBill-to address lines, city, region, postcode, country.
shippingFeeDescriptionvarchar(255)nullLabel for the shipping charge.
shippingFeeAmountnumeric(12,2)0Shipping charge.
shippingFeeTaxAmountnumeric(12,2)0Tax on the shipping charge.
subtotalAmountnumeric(12,2)computedSubtotal before tax: item line subtotals plus shipping fee.
taxAmountnumeric(12,2)computedOrder tax total.
totalAmountnumeric(12,2)computedOrder total.
notestextnullFree-text notes.
versioninteger1Optimistic concurrency version.
FieldTypeDefaultMeaning
itemIduuidrequiredProduct or material sold.
itemNamevarcharsnapshotItem name copied onto the line.
itemSkuvarcharsnapshotSKU copied onto the line.
unitNamevarcharsnapshotSales unit copied onto the line. Falls back to the stocking unit when the item has no different sales unit.
quantitynumeric(12,4)requiredOrdered sales quantity. Must use no more than four meaningful decimal places and be between 0.0001 and 99,999,999.9999; trailing zeroes are allowed.
shippedQuantitynumeric(12,4)0Sales quantity delivered so far.
cancelledQuantitynumeric(12,4)0Sales quantity cancelled from a partially shipped order. Shipped plus cancelled cannot exceed ordered quantity.
stockingUnitNamevarcharsnapshotStocking unit copied onto the line for fulfillment and inventory.
salesToStockFactornumeric(12,4)snapshotStocking units in one sales unit. Must be between 0.0001 and 99,999,999.9999.
stockQuantitynumeric(12,4)derived snapshotOrdered quantity converted to stocking units. Must remain between 0.0001 and 99,999,999.9999.
stockShippedQuantitynumeric(12,4)0Delivered quantity in stocking units.
stockCancelledQuantitynumeric(12,4)0Cancelled quantity in stocking units.
listUnitPricenumeric(10,2)base priceList price used for discount comparison.
unitPricenumeric(10,2)requiredPrice charged per sales unit.
discountPercentnumeric(5,2)0Discount from list price to unit price.
suggestedUnitPricenumeric(10,2)resolvedPricing engine suggestion.
pricingSourceTypeconstrained varcharbase_pricebase_price or schedule_break.
pricingScheduleNamevarcharnullWinning schedule snapshot.
pricingBreakLabelvarcharnullWinning quantity break snapshot.
isPriceOverriddenbooleanfalseTrue when the suggested price was changed.
taxRateIduuidnullTax rate id.
taxRateNamevarcharsnapshotTax rate name copied onto the line.
taxRatePercentnumeric0Tax percent copied onto the line.
lineSubtotalnumeric(12,2)computedSales quantity times price per sales unit.
lineTaxAmountnumeric(12,2)computedTax on the line subtotal.
lineTotalnumeric(12,2)computedLine subtotal plus tax.
sortOrderinteger0Display order.

Each saved order line is unique by item within the order.

The line snapshots both quantity bases. Customer-facing order, delivery, BOL, pricing, and invoice values use the sales fields. Availability, allocation, manufacturing, lots, and stock consumption use the stock fields. Changing the item’s sales unit later does not reinterpret an existing line. See Sales vs. stock units.

AreaValues
Stored order statusopen, done
Derived delivery stateNot shipped, Partially shipped, Shipped
Sales item fulfillmentavailable, expected, not_available, complete
Ingredient fulfillmentnot_needed, not_applicable, in_stock, expected, not_available, picked
Production fulfillmentnot_applicable, make, not_started, in_progress, done, blocked
Allocation statusready, waiting_production, partial, short
Pricing sourcebase_price, schedule_break

The sales order read model exposes provider invoice sync fields with legacy xero* names, including invoice id, invoice number, push status, push error, pushed time, retry count, email status, and emailed time.

Use the UI wording connected accounting provider when describing the action. The active provider can be Xero or QuickBooks depending on setup.

Orders with cancelled remaining quantities cannot be pushed to accounting until shipped-only invoicing is supported.