# 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](/types/#scalars) `ID!` | The record’s id — a UUID the platform assigned when the record was created; every reference to this record uses it. |
| `sysId` | [String](/types/#scalars) `String!` | The group-scoped human-facing system id (SO-…). |
| `type` | [String](/types/#scalars) `String!` | The kind of record — always `Order` here. |
| `caption` | [String](/types/#scalars) `String!` | The record’s display name — what people see it called. |
| `status` | [String](/types/#scalars) `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](/types/#scalars) `ID!` | pos → the selling LogicalFacility; ecom → the Organization — fixed at birth by origin, never reparented; rootId = the org group either way. |
| `rootId` | [ID](/types/#scalars) `ID!` | The org-group family root. |
| `createdAt` | [String](/types/#scalars) `String!` | When the record was created, as a UTC timestamp. |
| `updatedAt` | [String](/types/#scalars) `String!` | When the record last changed, as a UTC timestamp. |
| `revisionNum` | [Int](/types/#scalars) `Int!` | How many times this record has been edited; the first save is 0. |
| `revision` | [ID](/types/#scalars) `ID!` | The OCC revision token — supply it on every mutation of this record; rotates on every write. |
| `refCaptions` | [RefCaption](/types/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](/types/#scalars) `ID!` | The selling Organization — IMMUTABLE at birth; ACTIVE-gated at create. |
| `channel` | [OrderChannel](/types/OrderChannel/) `OrderChannel!` | The selling channel — IMMUTABLE; decides the parent + the reserve arm. |
| `orderType` | [OrderType](/types/OrderType/) `OrderType!` | The birth discriminator — IMMUTABLE; selects the FSM profile. ALL FOUR profiles buildable: sale + draft/quote + layaway + special_order. |
| `validUntil` | [String](/types/#scalars) | 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](/types/#scalars) | 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](/types/#scalars) | The conversion ref — the placed sale Order this draft/quote MINTED at accept; accepted-state only. |
| `sourceDocumentId` | [ID](/types/#scalars) | The conversion back-ref — the draft/quote this sale was converted FROM (stamped at the mint birth); sale-profile only. |
| `reorderOfOrderId` | [ID](/types/#scalars) | 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](/types/#scalars) `ID!` | The selling/fulfilling LF — pricing capture + the ecom reserve ride its InventoryItems (per-line sourcing =). |
| `currency` | [String](/types/#scalars) `String!` | The order currency — the org defaultCurrency snapshot, FIXED at create. |
| `customer` | [OrderCustomer](/types/OrderCustomer/) | Optional inline customer capture. |
| `shipTo` | [OrderShipTo](/types/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](/types/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](/types/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](/types/#scalars) | Optional ExemptionCertificate ref — at-USE validity gated at place. |
| `discounts` | [OrderDiscount](/types/OrderDiscount/) `[OrderDiscount!]!` | Order-level pre-tax discounts — allocated to lines pro-rata by discounted subtotal, largest remainder (exact). |
| `paymentState` | [String](/types/#scalars) `String!` | The payment rollup — stamped from net tendered vs total at every tender post. |
| `fulfillmentState` | [String](/types/#scalars) `String!` | The fulfillment rollup — born unfulfilled; transitioned by the events. |
| `recognitionState` | [String](/types/#scalars) `String!` | The recognition rollup — born deferred (deposits-until-delivery); conversion = the delivery events. |
| `taxJurisdictionId` | [ID](/types/#scalars) | The ORIGIN jurisdiction captured at place; absent pre-place or when the PFL is unclassified (the disclosed nexus-none arm). |
| `subtotalMinor` | [Int](/types/#scalars) `Int!` | Σ line bases in minor units. |
| `discountTotalMinor` | [Int](/types/#scalars) `Int!` | Everything taken off pre-tax (line discounts + the order-level reduction), minor units. |
| `taxTotalMinor` | [Int](/types/#scalars) `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](/types/#scalars) `Int!` | The order total in minor units — exclusive regimes add tax; inclusive regimes carry it inside the captured prices. |
| `fulfillmentFeeMinor` | [Int](/types/#scalars) | 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](/types/#scalars) | The tax on the fulfillment fee (taxed as a standard good at the origin — the lean), INSIDE taxTotalMinor; present ⟺ fulfillmentFeeMinor. |
| `tenderedNetMinor` | [Int](/types/#scalars) | Σ signed applied minor over the order tenders; absent = no tender yet. balance due = totalMinor − this. |
| `tipTotalMinor` | [Int](/types/#scalars) | Σ tips captured at tender; absent = none. |
| `paymentIds` | [ID](/types/#scalars) `[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](/types/#scalars) `[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](/types/#scalars) `[ID!]` | The Disputes webhook-born against this order’s payments (append-at-mint, ≤ 32; terminal disputes keep their slot); absent = none. |
| `invoiceIds` | [ID](/types/#scalars) `[ID!]` | The Invoices issued from this order. The bounded order→invoice enumeration the settlement/recognition attribution reads; absent = none. |
| `couponIds` | [ID](/types/#scalars) `[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](/types/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](/types/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](/types/#scalars) | The special_order_sourcing Saga stamped at launch; special_order-profile only. |
| `commissionAgentUserIds` | [ID](/types/#scalars) `[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](/types/#scalars) | The affiliate custody stamp: the attributed Affiliate — the clawback walk key (entries ride AFFLEDGER#<affiliateId>). |
| `lines` | [OrderLine](/types/OrderLine/) `[OrderLine!]!` | The embedded lines (0..45 — an empty open cart is legal, place refuses it); lineNo frozen at placed. |

## Used by

- [acceptOrder](/reference/order/acceptOrder/)
- [applyOrderCoupon](/reference/selling/applyOrderCoupon/)
- [applyOrderEmployeeDiscount](/reference/selling/applyOrderEmployeeDiscount/)
- [applyOrderLoyalty](/reference/selling/applyOrderLoyalty/)
- [cancelOrder](/reference/order/cancelOrder/)
- [createOrder](/reference/order/createOrder/)
- [holdOrder](/reference/order/holdOrder/)
- [order](/reference/order/order/)
- [placeOrder](/reference/order/placeOrder/)
- [removeOrderCoupon](/reference/selling/removeOrderCoupon/)
- [removeOrderEmployeeDiscount](/reference/selling/removeOrderEmployeeDiscount/)
- [removeOrderLoyalty](/reference/selling/removeOrderLoyalty/)
- [reorderOrder](/reference/selling/reorderOrder/)
- [resumeOrder](/reference/order/resumeOrder/)
- [sendOrder](/reference/order/sendOrder/)
- [updateOrder](/reference/order/updateOrder/)
- [voidOrder](/reference/order/voidOrder/)
