active_from and active_to window. The rules, budgets, windows, and configuration history you already use are the campaign. There is no separate resource to create.
Writing rules covers the window fields on a single rule. Use this page when a promotion has to coexist with the rates you already pay, has a spend cap, or has to be launched and retired as a unit.
Choose a shape
The first decision is how the campaign relates to your base rules.
Stacking is the safer default. Override only when the campaign rate is meant to be the whole rate.
Stack a bonus
Add acampaigns set after your earning set. Each campaign is one or more rules in that set with a window. This one adds 2% on dining for October:
Override the base rate
To pay a flat 5% on everything during launch week instead of the usual rates, put the rule in the earning set, first, withstop_after_match:
campaigns set, run either way. See Set-local stopping.
Windows
Both are compared to the event’s
event_timestamp, not the clock when Scrip processes it. That has three consequences:
- You can create campaign rules weeks ahead. They start and stop on their own.
- Retries and replays make the same decision as the original run.
- A backdated event can land inside a window that has already closed. Historical imports fire past campaigns unless you suspend or archive the rules first.
OUTSIDE_TIME_WINDOW, so you can confirm a campaign is dormant by reading any event’s trace.
Cap the spend
A budget on the campaign rule caps what it issues across all participants. A lifetime budget is the right shape for a one-off campaign: once the pool is spent, the rule keeps matching but its actions are skipped with reasonBUDGET_EXCEEDED, and the base rate still pays.
PREFUNDED asset and fund the program wallet with the pool. Credits fail when the wallet is empty. See Asset configuration.
Test before launch
Send the campaign rules as a draftrule_configuration to POST /v1/test-runs with scenario events stamped inside and outside the window. Set options.compare_live to see what the current configuration would have paid on the same events. Test runs roll back, so nothing is credited.
Check three things: an in-window event pays the campaign amount, an out-of-window event pays only the base rate, and for an override, the base rule is not reached inside the window. See Testing.
Launch as one change
When a campaign is more than one rule, publish them together with/rule-configuration/preview and /rule-configuration/apply so they go live in one version. The change is recorded as a revision you can diff or roll back later. See Managing rule configuration.
Because windows do the scheduling, apply the change whenever it is convenient. The rules stay dormant until active_from.
During the campaign
Name the campaign in each CREDIT’s
description. It appears on participant statements and journal entries, which is how finance and support tell campaign credits from base earning.
After the campaign
The window closes on its own. The rules stay in the configuration as a record of what ran. Archive them once you no longer need them in the active list, or leave them; a rule outside its window costs one skipped evaluation per matching event. To run the same campaign again,PATCH the window on the existing rule or apply a new revision with fresh dates. To undo a campaign that was configured wrong, roll back to the revision before it was applied.
Time-windowed rules
The window fields and how they read the event timestamp.
Rule sets
Set order, positions, and set-local stopping.
Test a full configuration
Run the draft against in-window and out-of-window events.