Skip to main content
Ready-to-use rule recipes for the most common reward behaviors. Each pattern assumes you have a program (8f14e45f-ceea-4e70-9df8-2a7d1b3c9f01) and an asset (a3bb189e-8bf9-4c8b-9be0-6b5d2f4e7a02) set up.
Each recipe below is standalone and uses the program’s default rule set. When a recipe shows multiple rules with stop_after_match, create them in the order listed so Scrip numbers them from most specific to catch-all. If you combine multiple rate recipes in one program, separate tracking and earning rules into rule sets (see Cashback card). Use an asset with scale: 2 for decimal cashback amounts and scale: 0 for whole points.

Category multipliers

A credit card that pays different rates by purchase category. The category comes from the merchant category code (MCC), the four-digit code a card network assigns to each kind of business. Your backend sends it on the event as mcc. Each category is its own rule in the same set, ordered from most specific to least. stop_after_match on the category rules prevents a dining purchase from also earning the 1% base rate in that set.
How it works: The three rules evaluate in the order they were created. A dining purchase matches the first rule and stops the rest of that set. It never sees the grocery or base rules. A non-category purchase skips dining and grocery, then falls through to the 1% catch-all. The catch-all has no stop_after_match because there is nothing later in the set to block. A purchase event with "amount": 85.00 and "mcc": "5812" credits 4.25 from dining_5pct and nothing else. The same purchase with "mcc": "5999" credits 0.85 from base_1pct.
The CEL in operator works well for short lists (5-20 entries). For hundreds of merchants, move classification into your backend and pass a flag like event.is_dining: true instead.

Sign-up bonus

“Spend $4,000 in the first 3 months, earn 60,000 points.” This is the most common card acquisition offer. It combines three checks: the participant must still be within their intro window, their cumulative spend must cross the threshold, and the bonus can only pay out once. duration_days against participant.enrolled_at enforces the time window, a counter snapshot detects the threshold crossing, and a TAG prevents double-claiming.
How it works: Both rules run only while the participant is within 90 days of enrollment and has not yet claimed the bonus. When a purchase pushes intro_spend across $4,000, signup_bonus adds the signup_bonus_claimed tag and credits 60,000 points. Later purchases see the tag and skip both rules. For a participant who enrolled 30 days ago with intro_spend at 3,900, a purchase with "amount": 150.00 raises intro_spend to 4,050, adds the signup_bonus_claimed tag, and credits 60,000 points.
participant.enrolled_at is the enrollment timestamp Scrip records when the participant joins the program, available as a CEL timestamp with no backend attribute needed. If you prefer calendar months, track the deadline as an attribute and compare directly: participant.attribute.intro_deadline != null && now < timestamp(participant.attribute.intro_deadline).

Streak challenge

A fitness app awards a bonus after 7 qualifying check-ins. The first check-in starts the streak; later check-ins count when they arrive at least 24 hours and less than 48 hours after the last counted check-in. The rules store that time in participant.attribute.last_checkin. The gap is duration_hours(now - timestamp(participant.attribute.last_checkin)), where now is the check-in’s event_timestamp. Your backend sends a plain checkin event.
How it works:
  • First check-in or 48+ hour gap: start_or_reset_streak starts a new streak at 1 and records last_checkin.
  • At least 24 hours and under 48 hours: continue_streak adds 1 to streak and updates last_checkin. When that increment brings streak to 7, streak_reward_7 credits 100 points.
  • Under 24 hours: None of the three rules match, so streak and last_checkin stay unchanged.
A check-in 30 hours after the previous one, with streak at 6, raises streak to 7 and credits 100.
Counter values in conditions reflect the event-start snapshot (before the current event’s actions execute), so streak_reward_7 checks participant.counter.streak + 1.0 == 7.0.

Referral credit

A new user completes their first ride, and both they and the friend who referred them earn $10. One rule credits both participants from a single event: the referee is credited as the event participant, and the referrer is credited through a dynamic target.
How it works: On the first referral_completed event, the rule tags the referee with referral_used, credits $10 to the referee, and credits $10 to the referrer identified by event.referrer_id. The event.referrer_id != participant.external_id check blocks self-referrals, and !participant.tag.referral_used makes any duplicate referral_completed event skip. For a multi-step flow that tracks invites and signups and pays on the first qualifying purchase, see the email referral program.
The referrer must already be enrolled in the program; otherwise, the event fails.

One-time welcome reward

“Complete your first purchase and earn $25.” Unlike the sign-up bonus (which tracks cumulative spend over a time window), this fires on any single qualifying purchase. A TAG gates the condition so the bonus only pays out once.
How it works: Same TAG-gating pattern as the sign-up bonus. The first purchase passes !participant.tag.first_purchase_done, sets first_purchase_done, and earns the bonus. Every subsequent purchase sees the tag and the condition evaluates to false.

Introductory rate with expiration

A card that pays 5% for a participant’s first 90 days in the program, then drops to the standard 1%. Comparing now (the event’s event_timestamp) against participant.enrolled_at gives each participant their own 90-day intro window automatically, with no signup event or scheduled cleanup needed.
How it works: When a participant joins the program (either via POST /v1/participants or automatically on their first event), Scrip records participant.enrolled_at. During their first 90 days, purchases match intro_5pct first and stop_after_match skips base_1pct. Once duration_days(now - participant.enrolled_at) exceeds 90, intro_5pct stops matching and purchases fall through to base_1pct. A purchase with "amount": 100.00 credits 5.00 during the first 90 days and 1.00 after.
Unlike rule-level active_from and active_to dates (which apply the same calendar window to everyone), participant.enrolled_at anchors the 90-day window to each participant’s own enrollment date. If a rate boost is triggered mid-lifecycle by a custom event (such as activating a 7-day pass), use a TAG and a SCHEDULE_EVENT action to remove the tag after the delay.

Spend threshold unlock

A card that pays 1% normally, but bumps to 3% after the participant spends $2,500 in a calendar month. A calendar counter keeps each month’s spend, and a counter snapshot checks whether the pre-event total plus the current amount has crossed the line.
How it works: The threshold check uses (snapshot + event.amount) >= 2500.0 so the purchase that crosses the threshold earns at the higher rate. Once above 2500, every subsequent purchase that month also earns 3%. With monthly_spend at 2,400, a purchase with "amount": 200.00 credits 6.00 and raises monthly_spend to 2,600. "reset_period": {"type": "MONTH"} keeps one total per UTC calendar month, so a new month starts at 0 with no reset rule or automation. Add a timezone, such as "America/Chicago", to follow a local calendar. Each purchase counts toward the month of its event_timestamp, whatever order events process in. A purchase made on March 31 that arrives in April reads and adds to March’s total.

One-time bonus blast

Push an apology credit to a subset of participants right now: a one-time participants-scoped automation with no trigger_at fires as soon as Scrip picks it up, and a rule credits everyone who receives the event. The automation targets participants tagged checkout_outage and the rule defines the reward. Create the rule that consumes the event first, so it is in place when the blast fires:
Then create the automation:
How it works: Omitting trigger_at starts the automation within about 10 seconds (the 201 Created response sets trigger_at to the creation time). It delivers an apology_credit event to every participant tagged checkout_outage, outage_apology_credit credits the event_data amount (10), and the automation moves to COMPLETED when done. To rehearse the blast first, point participant_filter at a single test participant; see testing an automation.

Birthday reward

Give every participant 500 points on their birthday. A participant-state automation with an ATTRIBUTE_DATE schedule reads each participant’s birthday attribute and fires an individual event on that date each year; a rule pays the reward. The consuming rule:
The automation:
Set the attribute the schedule reads with a participant PATCH:
How it works: Each participant with a birthday attribute gets a subscription whose next_trigger_at recurs yearly (MM-DD) at midnight in trigger.timezone (UTC by default). Shortly after 00:00 UTC on March 15, user_123 receives a birthday event and earns 500 points. Scrip re-evaluates the automation about every five minutes, so participants who receive the attribute later pick up a subscription automatically.
The birthday attribute is set once and never removed: it is a permanent fact about the participant, not a flag to manage. The pattern has two pieces because rules only run when an event arrives: the automation turns the date into an event each year (the when), and the rule decides what that event is worth (the what).

Promotional window

Run a “Summer Double Points” campaign from June 1 to September 1. Set active_from and active_to on the rule and the engine handles the rest. No condition logic needed. You can create the rule weeks in advance. Events outside the window skip the rule automatically.
How it works: You can create the rule weeks before the campaign starts. It awards points only when the event matches its condition and its event_timestamp falls within the window. A purchase with "amount": 50.00 stamped 2027-07-04T12:00:00Z earns 1.00 from this rule, and the same purchase stamped 2027-09-01T00:00:00Z earns nothing from it. Campaigns covers stacking a windowed rule on the base rate, overriding it, and capping the spend.
active_from and active_to are compared against the event’s event_timestamp, not the wall-clock time at processing. Historical imports with an event_timestamp inside a past window do fire time-windowed rules, and event timestamps are supplied by the caller, so a backdated event can reach a window that has already closed on the calendar.

Expiring points

Points that expire 12 months after they’re earned. Each purchase starts its own expiration clock. A January purchase expires in January of next year, not when the program year ends. LOT inventory mode creates a separate lot per CREDIT, each with its own countdown.
How it works: A January purchase expires in January of next year, a March purchase in March, and so on. A purchase with "amount": 42.00 that Scrip processes at 2027-01-15T10:30:00Z creates a lot of 42 points that expires at 2028-01-15T10:30:00Z. When a lot expires, the balance is automatically forfeited.
The asset must use inventory_mode: LOT for expiration to work. With a SIMPLE-mode asset, saving this rule returns a 400 validation_error. See Lots and expiration for details on oldest-first ordering and partial expiration.
"365d" counts from when each purchase is processed. For calendar-exact expiry (“expires on the same day next year”) or backfilled events, compute the date in your backend and pass it through the event: "expires_at": "${{ event.points_expires_at }}". See Expiration for both forms.

Milestone bonus (Nth action)

A coffee shop that gives a free drink every 10th purchase. A counter and the modulo operator handle the detection. Because conditions see the counter snapshot (pre-increment value), you check snapshot + 1 to detect the milestone at the right moment.
How it works: The tracking rule increments purchase_count on every purchase. The bonus rule adds 1 to the snapshot and checks if the result is divisible by 10. On the 10th, 20th, 30th purchase (and so on), the modulo evaluates to 0 and the bonus fires. With purchase_count at 9, the next purchase raises it to 10 and credits 50.
Scrip processes events for a given participant one at a time, so two simultaneous purchases for the same user cannot both see purchase_count == 9: the milestone bonus pays out once. For a one-time milestone (e.g., 100th purchase only), replace the modulo check with participant.counter.purchase_count + 1.0 == 100.0.

Capped reward per transaction

10% cashback on every purchase, but capped at $50 per transaction. math.least and math.greatest in CEL let you express the cap directly in the amount formula.
How it works: math.least(event.amount * 0.10, 50.0) evaluates both expressions and returns the smaller value. Below $500, the percentage is less than $50 so the participant gets the full 10%. At $500 and above, the cap kicks in. For a floor instead of a cap, use math.greatest:

Refunds

Clawing back rewards on returns has four distinct patterns (return rules, lot-level event reversals, exact clawbacks from event impact, and zero-floor caps). See the dedicated Refunds and clawbacks recipe guide.

Tiered earn rates

A hotel rewards program where Silver members earn 1.5x points per dollar, Gold earns 2x, and Platinum earns 3x. Members who have not reached Silver earn 1x. Participants advance automatically based on what they spend in each calendar year. Each tier level carries a points_multiplier benefit that a rule reads in its amount expression, so you don’t need separate rules per level. First, create the tier with its tier levels, qualification criteria, and a points_multiplier benefit on each level:
Create one rule to track spend and credit points at the participant’s current multiplier. The get() default gives members below Silver the base 1x rate.
How it works: purchase_points adds the purchase amount to spend and credits points using the current tier’s points_multiplier benefit. Members below Silver have no multiplier benefit, so get() returns 1.0. After all rules finish for the event, Scrip adds up the spend from the event’s calendar year and advances participants who reach a level’s threshold. A Gold member’s purchase with "amount": 200.00 credits 400 points. A participant below Silver earns 200.
Tier advancement happens after all participating rule sets finish for the current event. A purchase that takes the year’s spend past the Gold threshold qualifies the participant, but the current event still earns at the pre-advancement rate. The new multiplier applies starting with the next event.
Scrip checks every participant at the start of each calendar year, so you do not schedule anything. If a participant’s spend in the year that ended does not meet their level, they move to the highest level it does meet (DROP_TO_QUALIFYING). Nothing resets spend. The tier counts one year of it at a time. To count a quarter, a month, or the last 12 months, change period and periods. See Periods.

Refunds and clawbacks

Return rules, lot-level event reversals, exact clawbacks, and zero-floor debits.

Cashback card

Full end-to-end program combining categories, monthly caps, and refunds.

Test your rules

Run rule simulations before shipping changes to production.