Order
object type
A selling Order — the cart IS the open state (no Cart construct); orderType selects the FSM profile; lines embed with captured prices in integer minor units; the tax slots are pipeline-written at place over the master data; ecom place reserves stock, POS place does not — a layaway place reserves BOTH channels for the term; a special_order place NEVER reserves (goods are not on-hand — arrival reserves the claim).
Fields
| Field | Type | Notes |
|---|---|---|
id | ID ID! | The record’s id — a UUID the platform assigned when the record was created; every reference to this record uses it. |
sysId | String String! | The group-scoped human-facing system id (SO-…). |
type | String String! | The kind of record — always Order here. |
caption | String String! | The record’s display name — what people see it called. |
status | String String! | The FSM state: open | held | placed | completed | voided | abandoned | cancelled | draft | sent | accepted | expired | accruing | paid_in_full | defaulted | sourcing | ready. The orderType profile selects the instance's FSM — states beyond its profile are unreachable for it. |
parentId | ID ID! | pos → the selling LogicalFacility; ecom → the Organization — fixed at birth by origin, never reparented; rootId = the org group either way. |
rootId | ID ID! | The org-group family root. |
createdAt | String String! | When the record was created, as a UTC timestamp. |
updatedAt | String String! | When the record last changed, as a UTC timestamp. |
revisionNum | Int Int! | How many times this record has been edited; the first save is 0. |
revision | ID ID! | The OCC revision token — supply it on every mutation of this record; rotates on every write. |
refCaptions | RefCaption [RefCaption!]! | The server-composed captions of this record's declared references (the referenced-caption rule) — one row per referenced id; see RefCaption. |
organizationId | ID ID! | The selling Organization — IMMUTABLE at birth; ACTIVE-gated at create. |
channel | OrderChannel OrderChannel! | The selling channel — IMMUTABLE; decides the parent + the reserve arm. |
orderType | OrderType OrderType! | The birth discriminator — IMMUTABLE; selects the FSM profile. ALL FOUR profiles buildable: sale + draft/quote + layaway + special_order. |
validUntil | String | The draft/quote validity window end — REQUIRED on quote, OPTIONAL on draft, absent elsewhere; accept past it refuses CONFLICT/EXPIRED (the at-USE gate); once set the scheduler strand fires the draft|sent → expired rows on schedule. |
termEndsAt | String | The layaway TERM end: the instant the scheduler fires placed|accruing → defaulted (claims released; deposits stay recorded — settlement is the operator's follow-up). OPTIONAL (absent ⇒ no scheduled default), layaway-only, FUTURE-dated, editable while live (a termEndsAt-ONLY edit stays legal at placed|accruing — the term is schedule, not content). |
convertedOrderId | ID | The conversion ref — the placed sale Order this draft/quote MINTED at accept; accepted-state only. |
sourceDocumentId | ID | The conversion back-ref — the draft/quote this sale was converted FROM (stamped at the mint birth); sale-profile only. |
reorderOfOrderId | ID | The reorder provenance ref — the sale-profile source Order this order was reordered FROM (stamped SERVER-SIDE by reorderOrder at the clone birth, never caller-writable; prices re-captured FRESH at the mint, never copied); sale-profile only. Distinct from sourceDocumentId: conversion CONSUMES its doc, a reorder consumes nothing. |
logicalFacilityId | ID ID! | The selling/fulfilling LF — pricing capture + the ecom reserve ride its InventoryItems (per-line sourcing =). |
currency | String String! | The order currency — the org defaultCurrency snapshot, FIXED at create. |
customer | OrderCustomer | Optional inline customer capture. |
shipTo | OrderShipTo | The document-level ship-to destination: stamped by the agent checkout when a COMPLETE shipping address arrives (the Fulfillment's shipTo at ship is the same shape); absent otherwise. |
fulfillmentOption | OrderFulfillmentOption | The SELECTED fulfillment option snapshot + its fee: the channel's rate card or pickup choice as picked (words · fee in minor units · transit days · the pickup location); the fee is a SEPARATE quote line — the accept adds it to the sale. |
agentCheckout | OrderAgentCheckout | THE AGENT CHECKOUT BLOCK: present ⟺ this Order is a UCP checkout session — the AgentChannel · the platform profile URL (absent on a staff test drive) · the platform's destination id · the buyer names as given · the captured consent decisions. |
exemptionCertificateId | ID | Optional ExemptionCertificate ref — at-USE validity gated at place. |
discounts | OrderDiscount [OrderDiscount!]! | Order-level pre-tax discounts — allocated to lines pro-rata by discounted subtotal, largest remainder (exact). |
paymentState | String String! | The payment rollup — stamped from net tendered vs total at every tender post. |
fulfillmentState | String String! | The fulfillment rollup — born unfulfilled; transitioned by the events. |
recognitionState | String String! | The recognition rollup — born deferred (deposits-until-delivery); conversion = the delivery events. |
taxJurisdictionId | ID | The ORIGIN jurisdiction captured at place; absent pre-place or when the PFL is unclassified (the disclosed nexus-none arm). |
subtotalMinor | Int Int! | Σ line bases in minor units. |
discountTotalMinor | Int Int! | Everything taken off pre-tax (line discounts + the order-level reduction), minor units. |
taxTotalMinor | Int Int! | Σ line tax in minor units — 0 until place; INSIDE the captured prices under an inclusive (vat_gst) regime (disclosed, not double-counted). |
totalMinor | Int Int! | The order total in minor units — exclusive regimes add tax; inclusive regimes carry it inside the captured prices. |
fulfillmentFeeMinor | Int | The fulfillment fee folded into the money at COMMIT: the agent checkout's selected option fee restated as a money rollup on the MINTED sale (totalMinor = Σ line totals + this + its tax); absent on drafts and on every non-agent sale. |
fulfillmentFeeTaxMinor | Int | The tax on the fulfillment fee (taxed as a standard good at the origin — the lean), INSIDE taxTotalMinor; present ⟺ fulfillmentFeeMinor. |
tenderedNetMinor | Int | Σ signed applied minor over the order tenders; absent = no tender yet. balance due = totalMinor − this. |
tipTotalMinor | Int | Σ tips captured at tender; absent = none. |
paymentIds | ID [ID!] | The Payment attempts spawned by card tenders (append-at-mint, the bounded by-order path; ≤ 32 doubles as the attempts cap; declined attempts keep their slot); absent = none. |
refundIds | ID [ID!] | The Refund attempts spawned by refundReturn(original_tender) (append-at-mint, the paymentIds law; ≤ 64 doubles as the attempts cap; failed attempts keep their slot, audit truth); absent = none. |
disputeIds | ID [ID!] | The Disputes webhook-born against this order’s payments (append-at-mint, ≤ 32; terminal disputes keep their slot); absent = none. |
invoiceIds | ID [ID!] | The Invoices issued from this order. The bounded order→invoice enumeration the settlement/recognition attribution reads; absent = none. |
couponIds | ID [ID!] | The Coupons ATTACHED to this order. A trigger coupon's promotion evaluates ONLY while attached; PLACE re-validates every member and refuses a non-applied one. Absent = none. |
loyalty | OrderLoyalty | The loyalty attach. Earn commits at PLACE on the FINAL post-ALL-step-2-reductions discounted taxable base (position 5 included; storedValue lines excluded); the redemption emits source=loyalty LINE entries at position 4. SALE-profile only; absent = none. |
employee | OrderEmployee | The employee-discount attach. The position-5 evaluation emits source=employee LINE entries (the LAST pre-tax reduction); EVERY orderType may carry it (the coupon posture — a pure reduction mints nothing); the User re-validates FRESH at PLACE. Absent = none. |
sourcingSagaId | ID | The special_order_sourcing Saga stamped at launch; special_order-profile only. |
commissionAgentUserIds | ID [ID!] | The commission custody stamp: the DISTINCT union of attributed agents + manager-on-all holders whose entries minted — the deterministic clawback walk-list (the resolvedInventoryItemIds custody class). |
affiliateId | ID | The affiliate custody stamp: the attributed Affiliate — the clawback walk key (entries ride AFFLEDGER#<affiliateId>). |
lines | OrderLine [OrderLine!]! | The embedded lines (0..45 — an empty open cart is legal, place refuses it); lineNo frozen at placed. |