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