Skip to main content
A program is the top-level container in Scrip. It holds your rule sets and rules, links to your assets, and scopes your participants. You might have one program for your entire rewards system or separate programs for distinct business lines, such as customer rewards and employee recognition, optionally organized into folders. Each program runs its own rules: a rule evaluates only the events sent to its program. A participant’s tags, counters, and attributes are not split by program, and neither is their balance in an asset linked to several programs. An event in one program can therefore change what another program’s rules read. See Multi-program balances.

Creating a program

A program only requires a name. You can set the enrollment policy and other options at creation or update them later.
The API returns 201 Created with the program:
The id is the program_id you pass when sending events, creating rules, and querying balances. Scrip also creates an initial default rule set for the program, and rules that omit rule_set_id are assigned to it.

Enrollment

A participant who already exists in your organization is enrolled in a program automatically the first time an event for them reaches that program. The on_unknown_participant setting controls what happens when an event arrives for a brand-new external_id: Most programs use CREATE for simplicity. Use REJECT when you need strict control over who can participate.

The program wallet

Every program has a wallet. How it’s used depends on the asset’s issuance policy:
  • UNLIMITED credits create new value directly. The wallet is bypassed. This is what most programs use.
  • PREFUNDED credits draw from the wallet. You fund it up front, and every credit to a participant debits the wallet. When the wallet is empty, credits fail. This is how you enforce a fixed budget.
If you’re using PREFUNDED assets, you manage the wallet with fund and burn. This request funds a PREFUNDED asset with the symbol PROMO and scale: 2:
The API returns 200 with the journal entry that recorded the funding and the wallet’s available balance after it:
Burn removes unused value from the wallet and returns the same fields:
Fund and burn apply only to PREFUNDED assets.

Linking assets

Assets exist at the organization level and must be linked to a program before rules in that program can issue them. You can link assets when creating the asset (program_id or program_ids), when creating the program (asset_ids), or afterward:
The API returns 200 with the asset, where program_ids lists every program the asset is linked to:
Participants then earn the same asset, into one balance, across every linked program. See Multi-program balances for when to share an asset this way.
Linking an asset to a program is permanent; there is no unlink endpoint.

Program state

Programs hold the same state types as participants: tags, counters, and attributes. Use program state for logic that is not tied to one participant, such as a bonus for only the first 1,000 claims. Rules write program state with an action whose target is {"type": "PROGRAM"} and read it in a condition as program.counter.<key> or program.tag.<name>. See State management for a complete example.

Program status

You can pause or retire a program by updating its status:

Redemption settings

pending_redemption_ttl caps how long a pending redemption holds the participant’s points. redemption_target_type sets where redeemed value goes: SYSTEM_REDEMPTION by default, or a group or program wallet named by redemption_target_entity_id. See Pending redemptions and Redemption targets.

Automations

Programs can have automations that generate events on a schedule, at a specific time, or in response to participant state changes. Automations are scoped to a program and managed via POST /v1/programs/{program_id}/automations. See Automations for details.

Create an asset

Choose how the value participants earn is tracked and issued.

Add participants

Create participants and manage their status.