AlmondTill/G3N API

Promotion

object type

A Promotion — the rule-based discount engine that EMITS source=promo LINE discount entries at the step-2 position 3 (after manual + coupon; the pipeline math was position-complete from birth — the build ANIMATES the dormant slot, the pattern). Org restriction is JUNCTION-LESS: the scope axes (channels/LFs/orgs) gate WHERE it fires; productScope (the CollectionPredicate VERBATIM + inclusions/exclusions + a Collection ref) gates WHAT lines match — ABSENT productScope = ALL product lines (the sitewide sale; open_item lines never match); cartConditions gate WHEN. Windows are half-open [startAt, endAt) — an EVALUATION gate, never FSM states (advance scheduling = create active with a future startAt; absent endAt = evergreen). Resolution is STRICT no-stack (priority asc, id asc; combinableGroup opts IN; exclusive blocks its lines). Emissions are ABSOLUTE amount entries computed to replay VERBATIM in the pipeline; order-target effects pre-allocate largest-remainder over the MATCHED lines ONLY. Redemptions count per ORDER in the place/accept transaction; a capped-out promotion silently STOPS FIRING. At most 128 ACTIVE per org group.

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 (PM-…).
typeString String!The kind of record — always Promotion here.
captionString String!The record’s display name — what people see it called.
statusString String!The FSM state: active | inactive | doomed.
parentIdID ID!The parent org group; for a Promotion parentId === rootId.
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.
effectPromotionEffect PromotionEffect!The canned effect — wholesale-replace on edit; free_gift/free_shipping are the NAMED deferrals (create-refused VALIDATION/UNSUPPORTED).
scopePromotionScopeWHERE it fires.
productScopePromotionProductScopeWHAT product lines match.
cartConditionsPromotionCartConditionsWHEN it fires.
startAtString String!The half-open window start (UTC ISO-8601; kit-stamped NOW when omitted at create — the sale-price stamp law).
endAtStringThe half-open window end — ABSENT = evergreen (until deactivated); [startAt, endAt) is an EVALUATION gate.
priorityInt Int!Deterministic resolution ordinal.
exclusiveBoolean Boolean!An exclusive promotion applies only to promo-free lines and permanently blocks its lines.
combinableGroupStringMerchant-authored stacking tag — two promotions stack on a line IFF they share this value; absent = never combines.
maxDiscountPerLineMinorIntPer-promotion self-cap: Σ emission per LINE (minor units).
maxDiscountPerOrderMinorIntPer-promotion self-cap: Σ emission per ORDER (largest-remainder re-clamp to EXACTLY the cap).
totalRedemptionsCapIntTotal-redemption cap.
couponGatedBoolean Boolean!TRUE ⇒ evaluates ONLY while an attached, valid trigger Coupon references it — never auto-fires.
codeStringOptional mutable merchant reference code; uniqueness NOT enforced.

Used by