1. Set up your environment
Grab your API key from the Scrip dashboard and set it as an environment variable:2. Create your Program & Asset
A Program is the top-level container for your rules and participants. An Asset is the unit of value you’re tracking (points, credits, etc.). First create a program, then create an asset inside it.id from the response. It’s the program_id you’ll pass in every subsequent call.
scale controls decimal precision. 0 means whole numbers only (10 points, not 10.5). This quickstart uses SIMPLE mode because it only needs a running balance.
Use LOT mode instead if this asset needs expiration, vesting, auth/settlement matching, or issuer attribution for multi-program settlement. inventory_mode is immutable after creation. Copy the id from this response; it’s the asset_id for the next step.
3. Define a Rule
Rules tell Scrip when to give out points. We’ll create a rule that gives 10 points for every event where thetype is "purchase".
4. Send an Event
Send a purchase event for a user. Theexternal_id is whatever ID you use for this user in your own system.
You don’t need to create the participant first. Scrip creates and enrolls them automatically when their first event arrives.
event_timestamp is required: it records when the event actually happened, which is what time-based rules evaluate against. The idempotency_key prevents duplicate processing. If you retry this request with the same key, Scrip returns the original response instead of crediting points again.
5. Verify the Balance
Events process asynchronously, so give it a moment. Then checkuser_123’s balance.
First, look up the participant by their external_id to get the Scrip-assigned id:
id to fetch their balances:
Next Steps
Now that you’ve seen the core loop, dive deeper:- Writing Rules: Use CEL to build complex logic (e.g., “double points for VIPs”).
- State Management: Use counters and tags to track user progress over time.
- Redemptions: Let users spend those points on rewards.