AlmondTill/G3N API

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

FieldTypeNotes
idID ID!The record’s id — a UUID the platform assigned when the record was created; every reference to this record uses it.
sysIdString String!The group-scoped human-facing system id (SO-…).
typeString String!The kind of record — always Order here.
captionString String!The record’s display name — what people see it called.
statusString 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.
parentIdID ID!pos → the selling LogicalFacility; ecom → the Organization — fixed at birth by origin, never reparented; rootId = the org group either way.
rootIdID ID!The org-group family root.
createdAtString String!When the record was created, as a UTC timestamp.
updatedAtString String!When the record last changed, as a UTC timestamp.
revisionNumInt Int!How many times this record has been edited; the first save is 0.
revisionID ID!The OCC revision token — supply it on every mutation of this record; rotates on every write.
refCaptionsRefCaption [RefCaption!]!The server-composed captions of this record's declared references (the referenced-caption rule) — one row per referenced id; see RefCaption.
organizationIdID ID!The selling Organization — IMMUTABLE at birth; ACTIVE-gated at create.
channelOrderChannel OrderChannel!The selling channel — IMMUTABLE; decides the parent + the reserve arm.
orderTypeOrderType OrderType!The birth discriminator — IMMUTABLE; selects the FSM profile. ALL FOUR profiles buildable: sale + draft/quote + layaway + special_order.
validUntilStringThe 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.
termEndsAtStringThe 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).
convertedOrderIdIDThe conversion ref — the placed sale Order this draft/quote MINTED at accept; accepted-state only.
sourceDocumentIdIDThe conversion back-ref — the draft/quote this sale was converted FROM (stamped at the mint birth); sale-profile only.
reorderOfOrderIdIDThe 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.
logicalFacilityIdID ID!The selling/fulfilling LF — pricing capture + the ecom reserve ride its InventoryItems (per-line sourcing =).
currencyString String!The order currency — the org defaultCurrency snapshot, FIXED at create.
customerOrderCustomerOptional inline customer capture.
shipToOrderShipToThe 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.
fulfillmentOptionOrderFulfillmentOptionThe 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.
agentCheckoutOrderAgentCheckoutTHE 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.
exemptionCertificateIdIDOptional ExemptionCertificate ref — at-USE validity gated at place.
discountsOrderDiscount [OrderDiscount!]!Order-level pre-tax discounts — allocated to lines pro-rata by discounted subtotal, largest remainder (exact).
paymentStateString String!The payment rollup — stamped from net tendered vs total at every tender post.
fulfillmentStateString String!The fulfillment rollup — born unfulfilled; transitioned by the events.
recognitionStateString String!The recognition rollup — born deferred (deposits-until-delivery); conversion = the delivery events.
taxJurisdictionIdIDThe ORIGIN jurisdiction captured at place; absent pre-place or when the PFL is unclassified (the disclosed nexus-none arm).
subtotalMinorInt Int!Σ line bases in minor units.
discountTotalMinorInt Int!Everything taken off pre-tax (line discounts + the order-level reduction), minor units.
taxTotalMinorInt Int!Σ line tax in minor units — 0 until place; INSIDE the captured prices under an inclusive (vat_gst) regime (disclosed, not double-counted).
totalMinorInt Int!The order total in minor units — exclusive regimes add tax; inclusive regimes carry it inside the captured prices.
fulfillmentFeeMinorIntThe 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.
fulfillmentFeeTaxMinorIntThe tax on the fulfillment fee (taxed as a standard good at the origin — the lean), INSIDE taxTotalMinor; present ⟺ fulfillmentFeeMinor.
tenderedNetMinorIntΣ signed applied minor over the order tenders; absent = no tender yet. balance due = totalMinor − this.
tipTotalMinorIntΣ tips captured at tender; absent = none.
paymentIdsID [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.
refundIdsID [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.
disputeIdsID [ID!]The Disputes webhook-born against this order’s payments (append-at-mint, ≤ 32; terminal disputes keep their slot); absent = none.
invoiceIdsID [ID!]The Invoices issued from this order. The bounded order→invoice enumeration the settlement/recognition attribution reads; absent = none.
couponIdsID [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.
loyaltyOrderLoyaltyThe 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.
employeeOrderEmployeeThe 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.
sourcingSagaIdIDThe special_order_sourcing Saga stamped at launch; special_order-profile only.
commissionAgentUserIdsID [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).
affiliateIdIDThe affiliate custody stamp: the attributed Affiliate — the clawback walk key (entries ride AFFLEDGER#<affiliateId>).
linesOrderLine [OrderLine!]!The embedded lines (0..45 — an empty open cart is legal, place refuses it); lineNo frozen at placed.

Used by