LOT-mode assets track every credit separately.
Use lots when points expire after a fixed window, when rewards should vest before they become spendable, or when reports need to show which program issued the value a participant redeemed. Lots are also what let rewards stay pending until a later event confirms them, such as a delivery or a card settlement; see Pending rewards.
SIMPLE-mode assets do not create lots. See Asset configuration for when to choose each mode, and SIMPLE vs LOT mode for a feature comparison.
How lots work
When aLOT-mode asset is credited, a new lot is created:
Lot lifecycle
A lot is open while it has value left, in one of three statuses. Only anAVAILABLE lot can be spent. The diagram shows the usual moves between them.
A lot in any of the three can close. A closed lot has one of two final statuses:
A lot expires from whichever status it is in. A pending reward that was never confirmed and a deferred lot that has not matured both expire at
expires_at, like an available one.
Expiration
Setexpires_in or expires_at on a CREDIT action to give lots a deadline. Send one of the two, not both.
Either field can be a
${{ }} expression that resolves to a value of its own kind.
After a set time
A duration counts from the moment the lot is created, which is when the event is processed, not the event’sevent_timestamp:
event_timestamp is seconds and does not matter. For backfilled events it does: an event stamped last March but imported today gets a lot that expires 365 days from today. When the expiry must follow the occurrence date, compute it in your backend and send it on the event instead.
A duration is a number and a unit, such as 90d, and you can combine units, as in 36h30m. Use w for weeks, d for days, h for hours, m for minutes, and s for seconds. m always means minutes. Months and years are not supported, so write 90d for about three months. See Durations.
On a fixed date
A fixed timestamp sets the same deadline for all lots created by that rule:On a date from the event
A${{ }} expression sets a per-event deadline. In expires_at it must resolve to an RFC 3339 timestamp, and in expires_in to a duration. Use it for a deadline that follows the purchase date, or for an exact calendar policy such as “expires on the same day six months later”. Your backend computes the timestamp and sends it on the event:
What happens at expiration
Atexpires_at, the lot stops counting toward anything that spends or holds value, so its credits cannot be spent from that moment. Usually within a few minutes, Scrip then marks the lot EXPIRED, moves its remaining value to breakage with an EXPIRATION journal entry, and sends a balance.expired webhook event.
Until then, available in the balances response still includes the expired value, so a balance read in those minutes can show credits that can no longer be spent. spendable_available in the lots list already leaves it out.
To see when outstanding value will expire across a program or asset, for breakage estimation or forecasting, use the expiration schedule report. It shows expired value under expiring_before_window until that value moves to breakage.
Vesting
Setmatures_in or matures_at on a CREDIT action to create a vesting period. A lot credited with a future maturity lands in DEFERRED and cannot be spent, held, or debited.
After the maturity date passes, Scrip moves the lot to AVAILABLE, usually within a few minutes, and sends a balance.matured webhook event with the amount that became spendable. The lot cannot be spent until that move. Use the webhook event to refresh the participant’s balance instead of polling.
DEFERRED as a bucket. It is available as a filter in query endpoints (status=DEFERRED on the lots list, bucket=DEFERRED on journal entries).
To make a participant’s deferred value spendable before its date, mature it early.
Vesting starts from a date known when the credit is made. When a later event decides, such as a delivery or a loan closing, use pending rewards. The confirmation can set matures_in or matures_at too, so confirmed rewards wait for a date such as the end of a billing cycle.
Oldest-first spending
When debiting aLOT-mode asset, Scrip spends the oldest eligible lots first:
Viewing lots
Inspect a participant’s lots for a specific asset:
The response is a page of lots plus an
availability summary:
journal_entry_id is the credit that first issued the lot’s value, and event_id is the event whose rules made that credit. A lot split by a hold, release, or transfer keeps both. event_id is absent for a credit no event made, such as a manual adjustment, and journal_entry_id is absent when Scrip cannot trace that credit.
availability covers the whole asset, whatever filters you pass.
Lot-aware operations
Hold, release, and forfeit operations onLOT-mode assets are lot-aware:
When an operation moves only part of a lot, the original lot keeps its
id and the amount left behind. The amount that moves becomes a new lot with its own id and the same created_at, expires_at, and matures_at.
Confirming a pending reward with a CREDIT for the whole pending amount keeps the lot’s id and created_at. A confirmation for less than the pending amount closes the pending lot as CONSUMED and records the confirmed amount as a new lot. Either way, the lot’s expiration and maturity come from the confirming credit.
These operations return a lots_processed array. Each item gives a lot’s id and the amount the operation took from it:
SIMPLE vs LOT mode
The asset’sinventory_mode determines whether credits are tracked individually or as a running total.
Use
SIMPLE when a balance can be one pool that never expires or vests. Use LOT when credits expire or vest, when rewards stay pending until a later event confirms them, when spending order matters, or when you report which program issued redeemed value.
Setting
expires_in, expires_at, matures_in, or matures_at on a credit requires a LOT-mode asset. Using these fields on a SIMPLE-mode asset is rejected by validation (400 validation_error on rules, or 422 invalid_inventory_mode on balance adjustments).Keep rewards pending
Make rewards spendable when a later event confirms them.
Change a balance directly
Hold, release, forfeit, and mature lots by hand.
Forecast expiration
See when outstanding value will expire.