Double-entry accounting
Every transaction creates a journal entry with two or more postings that sum to zero:PREFUNDED assets, the source is the program wallet instead of SYSTEM_ISSUANCE:
Accounts and buckets
A ledger entity is anything that holds its own balances: a participant, a group, or a program wallet. An account is a ledger entity’s holding of one asset in one bucket. Scrip’s system accounts hold the other side of issuance, breakage, and redemption. The ledger tracks value by writing postings against these accounts. A participant with one asset has up to three accounts: one each forAVAILABLE, HELD, and DEFERRED. Scrip creates an account the first time a posting touches that bucket, so a participant with three assets has up to nine accounts.
Every balance has three buckets.
Responses use lowercase object keys. A bucket you send in a request body or filter by is an
UPPER_SNAKE value. Amounts are decimal strings in both directions.
Credits land in AVAILABLE by default. Debits, holds, forfeits, and redemptions draw from it. A HOLD moves value from AVAILABLE to HELD, and a RELEASE moves it back. Forfeits can also draw from HELD. Pending rewards, which a rule credits before a later event confirms them, go straight into HELD.
A credit to AVAILABLE on a LOT-mode asset with a future matures_in or matures_at lands in DEFERRED instead. Deferred value cannot be spent, held, or debited. Usually within a few minutes after the maturity date, Scrip moves it to AVAILABLE and records a MATURITY journal entry. You can also mature it early. See Vesting.
When you query a participant’s balances, the response breaks out each bucket for every asset:
Journal entries
A journal entry is a record of a single ledger operation. Scrip records one every time value moves: credits, debits, holds, releases, forfeits, and redemptions. Each journal entry contains two or more postings. A posting is a single line item that records a change to one account: which account, the signed amount (positive for credits, negative for debits), and which bucket. The postings in an entry sum to zero. You can list journal entries through the API:Action types
Every entry has oneaction_type, which names the operation that created it.
A manual adjustment, type
ADJUST on POST /v1/participants/{participant_id}/balances/operations or on the group endpoint, is recorded as a CREDIT or DEBIT entry with event_id and rule_id both null. Credits and debits from rules carry both IDs, so check those two fields to tell them apart. The API reference also lists ADJUSTMENT as an action_type value, but no operation creates it.
Filtering
The journal entries list endpoint accepts query parameters to narrow results.
Amount filters apply to raw signed posting values. Credits are positive, debits are negative.
Entity filters (
participant_id, external_id, group_id) are mutually exclusive.
An entry matches when one of its postings meets every entity, asset_id, bucket, and amount filter you send. It still returns all of its postings, so a participant_id filter also shows the other side of each movement.
Entry detail
Fetch one journal entry by ID:SYSTEM_ISSUANCE to a participant:
entity_type names whose account the posting touches. A posting on a participant, group, or program wallet also carries participant_id, group_id, or program_id.
System accounts
Every fund movement has an origin and a destination. For transfers between participants, both sides are participant accounts. When funds are minted, forfeited, or redeemed, the other side of the transaction is a system account.
These accounts make it possible to reconcile total points issued against points in circulation, points spent, and points lost.
Integrity
A journal entry never changes after Scrip records it, apart from gaining itsentry_hash when it is sealed. No API request edits or deletes an entry.
Scrip seals each entry into a hash chain for your organization, usually within a few seconds of recording it. The seal is a SHA-256 hash of the entry’s details, its postings, and the hash of the entry sealed before it. Changing any sealed entry would therefore break its hash and every hash after it.
A reversal is a new journal entry with opposite postings. A redemption reversal, for example, credits the participant and debits the redemption account. The original entry and its hash stay as they were.
Lots and expiration
Track each credit with its own expiration and maturity dates.
Change a balance directly
Adjust, hold, release, forfeit, and void pending rewards.
Reconcile with reports
Statements and liability reports built from these entries.