"loyalty" or "status") is an independent track with ordered levels (rank: 1, 2, 3, …).
Tiers advance automatically when a participant’s counters cross level thresholds, or are assigned directly by rules (SET_TIER) or the API. Optional lifecycle settings control how long a level lasts and how downgrades work.
Tiers and tier levels
A tier is a progression track containing ordered tier levels, where a higherrank is a higher level. Create a tier under a program:
lifecycle object to automate renewals and downgrades; see Retention modes. The API returns 201 Created with the tier, its levels, and status: "ACTIVE".
Tier fields
Level fields
Qualification
Qualification criteria move a participant up automatically after an event’s rules finish (or after a counterPATCH on the participant). This check only upgrades; moving down is handled by retention and the downgrade policy. If a SET_TIER rule action fires for the same tier in the same event, Scrip skips the automatic check so your rule takes control.
You can send the same criteria as a CEL string in
qualification_condition instead of qualification (send one, not both), such as "participant.counter.spend >= 2000 && participant.counter.nights >= 10". Scrip saves it as qualification and returns both fields.
On a tier with PERIODIC retention, each comparison uses how much was added to the counter during the tier’s periods, such as this year’s spend. On any other tier it uses the counter’s value.
Rules update the counters that qualification reads:
SET_TIER, after which counter PATCH calls on the group check for upgrades in programs where it already holds a tier.
More than one way to qualify
NestALL and ANY groups (up to 3 levels deep, at most 8 qualification paths per level) to offer multiple paths to a level. For example, Gold via 3,000 spend OR (2,000 spend AND 1,500 bonus points):
qualification_condition: participant.counter.spend >= 3000 || (participant.counter.spend >= 2000 && participant.counter.bonus_points >= 1500). When automatic qualification upgrades a participant, the participant.tier_changed webhook carries qualified_by naming the matching path.
Benefits
Each level can carry a freeformbenefits JSON object (multipliers, feature flags, access perks). Scrip stores and returns it on tier reads without interpreting it, and exposes it in CEL under participant.tiers.<key>.benefits. Always read benefit keys with get() and a default so participants with no tier (or without that benefit key) do not fail action expressions:
Retention modes
Configurelifecycle on the tier to control how long a level lasts and when downgrades run:
Periods
APERIODIC tier qualifies participants on what they do in a period, such as a year, a quarter, or a month. It can also count several periods together, such as the last 12 months. This tier counts each calendar year on its own:
period sets how long one period is and when it starts. periods sets how many periods in a row count together, and defaults to 1.
Send only the fields the
unit uses. A tier can count at most 366 days with DAY, 104 weeks with WEEK, 60 months with MONTH, or 5 years with YEAR.
What a periodic tier counts
APERIODIC tier compares each level’s threshold with how much was added to the counter during the tier’s periods. The counter’s own value is not used. On the calendar-year tier above, with Gold at 2,000 spend:
With
periods at 1, a level earned in one period lasts through the next. With a monthly period and periods at 12, a participant keeps a level while their last 12 complete months still meet its threshold.
Moving up and keeping a level count different periods:
For an event, the period in progress is the one its
event_timestamp falls in. Progress counts the same periods as moving up. At a check, a participant keeps any level they already qualify for by the moving-up count.
Nothing resets the counter, so one counter such as spend can serve a yearly tier and a quarterly tier at once. The tier ignores a reset_after, reset_period, or window set on the counter.
Each counter change counts in the period it happened in. A COUNTER action uses the event’s event_timestamp, so an event that arrives late still counts in its own period. A PATCH uses the time of the request. Setting a counter to a value (operation: "SET" on a COUNTER action, or set in a PATCH) counts as the change from the old value to the new one.
Period checks
At the start of each period, Scrip checks every participant enrolled in the program against the periods that ended. The downgrade policy decides the level of a participant who no longer qualifies for the one they hold. You do not schedule anything. A check runs at midnight in the period’stimezone on the period’s first day, or at 03:00 in a time zone where a clock change can skip or repeat midnight. It runs no rules and changes no counters.
- Upgrades: A check also moves a participant up when they qualify for a higher level than they hold, such as after you lower a threshold. Under
HOLD, a check changes no level. - Levels with
expires_at: A check skips a level whoseexpires_atis still to come. When that time arrives, the downgrade policy applies to what the participant qualifies for then, and a level they keep is checked each period from then on. To start existing members at a level before they have any activity to count, assign the level directly and setexpires_atto the date the level should last until. - Tier changes: A
PATCHthat changes aPERIODICtier’s levelqualificationor itslifecyclechecks every participant once, shortly after. On aDROP_ONEtier, that check skips a participant already checked in the current period. - Groups: Period checks cover participants only. A group’s level changes through events and
expires_at.
Activity refresh
Setretention: {"mode": "ACTIVITY_REFRESH", "duration": "365d"} (see Durations). Each processed event for an ACTIVE participant who holds a level restarts the timer; if duration elapses without activity, Scrip applies the downgrade policy.
The timer does not restart when a level was assigned via SET_TIER or PUT, when SET_TIER ran for the tier in the same event, or when no level defines qualification. A counter PATCH restarts the timer only when it upgrades the participant.
Downgrade policies
Optional fields on
downgrade_policy: grace_days (defer downgrade once) and min_level (floor an active participant never drops below; does not raise a participant with no level).
Grace periods
grace_days gives a participant extra time before a downgrade. When their level would go down, they keep it for grace_days more, and the level’s expires_at shows when the grace period ends. On a PERIODIC tier the days count from the period check, or the expires_at, that would lower the level. On an ACTIVITY_REFRESH tier they count from the level’s expires_at.
A participant who qualifies again before the grace period ends keeps the level. Otherwise the downgrade policy applies when it ends, with no second grace period.
Starting a grace period records no tier change and sends no webhook, and period checks skip the level until it ends. When a grace period that a period check started ends, no rules run.
Inactive participants
While a participant isSUSPENDED or CLOSED, their tier can only go down: automatic upgrades are skipped, SET_TIER fails with participant_inactive, and PUT / DELETE tier calls return 409 participant_inactive. Period checks and expires_at still lower or remove levels, and grace_days does not delay them. min_level still limits how far a level drops. At expires_at, a participant who would keep the same level loses it instead.
SET_TIER rule action
Rules can assign a tier directly withSET_TIER (for promotions, VIP overrides, or group tiers):
expires_in or expires_at (not both) to schedule a tier_expiration check at that time, or add target for a group. See SET_TIER.
Tier state in CEL
Access a participant’s tier in rule conditions viaparticipant.tiers.<tier_key>:
Every defined tier in the program has an entry (empty defaults when unassigned). On an event with no participant (such as a program-scoped automation),
participant.tiers is empty; use get() with a default object as shown in CEL helper functions. For groups, use groups.exists(g, g.tiers.loyalty.level == "gold").
Viewing tiers
level: "" and rank: 0 when unassigned). On PATCH, omitted fields stay unchanged, populated objects replace the whole object, and {} explicitly clears lifecycle or qualification.
Progress toward the next level
Reading a single tier includesprogress automatically; listing tiers includes it when you pass expand[]=progress (including unassigned tiers so you can show progress toward rank 1). Each entry in paths is one way to qualify for next_level, with value and remaining (for >= criteria):
PERIODIC tier, value is how much was added to the counter during the tier’s periods so far. On any other tier it is the counter’s current value. progress is omitted at the top level, when no higher level has automatic qualification, or when the tier is archived.
Tier transitions
Every tier change is logged in state history (GET /v1/participants/ext:user_123/activity/state-history?state_type=TIER; downgrade-to-base is recorded as DELETE with new_value: null) and emits a participant.tier_changed webhook event.
Assign a tier level directly
Assign or remove a level through the API (requires anACTIVE, enrolled participant and ACTIVE program):
expires_at is optional; omit it for no end date. DELETE on the same path removes the participant’s level (rank: 0) and returns 204.
Archiving tiers
Retire a tier by setting its status toARCHIVED (first archive or edit any ACTIVE or SUSPENDED rules referencing it, or PATCH returns 409 tier_referenced_by_rules):
SET_TIER actions without failing the event, stops automatic qualification and period checks, and rejects direct PUT / PATCH edits with 409 tier_archived (send {"status": "ACTIVE"} to restore). Existing participant levels remain readable, and any scheduled tier_expiration still runs.
Groups
Shared balances and group tiers.
SET_TIER
Every field of the tier action.
Counters
The counters that qualification reads.