POST /v1/participants/{participant_id}/balances/operations. The path accepts a participant id or ext: plus your external_id. The body’s type chooses the operation:
Each type accepts the fields in its table below, plus
idempotency_key. A field the type does not accept returns 400 with code validation_error. The response lists each such field in fields with reason not_allowed, and nothing is posted. Groups take ADJUST, HOLD, RELEASE, and FORFEIT at POST /v1/groups/{group_id}/balances/operations; see Group balances.
Adjust
Credit or debit a participant’s balance:
Amounts must be positive. Use
direction to choose a credit or a debit. DEBIT fails if the available balance is insufficient, unless allow_negative is set to true. If amount has more decimal places than the asset’s scale, the request is rejected with 422 invalid_scale and param amount. Round in your client before sending it.
The API returns 200 with the journal entry and the balance after the change. In this response, type is the direction:
action_type CREDIT or DEBIT to match direction. To tell a manual adjustment from a rule’s credit or debit, check event_id and rule_id. Both are null on an adjustment, and both are set on an entry a rule created. See Action types.
Expiration and maturity on credits
A manualCREDIT for a LOT-mode asset can set expiration with expires_in (a duration) or expires_at (an RFC 3339 timestamp), and maturity with matures_in or matures_at. This applies to participant and group adjustments. Send one field of each pair, not both.
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.
Durations in one request count from the same request time. If you set both expiration and maturity, the resolved maturity must be before the expiration. An equal or later maturity returns 400 invalid_lot_lifecycle_order. A future maturity places the credit in DEFERRED until it matures.
Scrip rejects these fields on a DEBIT or a credit to HELD with 400 invalid_lot_lifecycle, and on a SIMPLE-mode asset with 422 invalid_inventory_mode.
On a retry, send the same idempotency key and the same duration or timestamp strings. Scrip compares the strings you sent and returns the original journal entry without recalculating durations. See Idempotency.
Negative balances
Setallow_negative to true on a DEBIT to let the balance go below zero. This is useful when you need to recover value that a participant has already spent:
- Refund clawbacks. A cardholder earned cashback on a purchase that was later refunded. The cashback has already been redeemed, so the available balance is zero. A negative-balance debit records the debt.
- Chargeback recovery. A payment is disputed and reversed, but the associated reward points were already used. The debit brings the balance negative until the participant earns enough to offset it.
- Corrections. An incorrect credit was issued and the participant has already spent part of it. A negative-balance debit corrects the ledger without waiting for funds to replenish.
LOT-mode assets, the debit spends whatever lots are available first. The rest becomes an overdraft: the balance goes negative by the part no lot covered, and later credits bring it back toward zero. The lots list reports it as overdraft_offset; see Viewing lots.
allow_negative also works in rule actions. This lets your rules engine handle clawbacks automatically, for example debiting cashback when a refund event arrives, even if the participant’s balance is zero.
allow_negative only applies to adjustments and rule-based debits. Transfers and redemptions always require sufficient funds.Hold
Reserve funds by moving them fromAVAILABLE to HELD:
- Fraud review (set funds aside pending investigation)
- Pending approvals (hold until manual review completes)
RELEASE or FORFEIT that would take them returns 409 reservation_conflict. A hold is also not a pending reward, which a rule credits straight into HELD.
A hold fails if the participant does not have enough
AVAILABLE balance, and an archived asset refuses new holds. A hold or release keeps each lot’s identity and dates; see Lot-aware operations.
The API returns 200 with the amount moved, the lots it came from, and the balance after the hold:
RELEASE, FORFEIT, VOID_PENDING, and MATURE return the same fields, with operation set to the type. lots_processed appears only for LOT-mode assets.
Release
Move held funds back toAVAILABLE:
A release clears
reference_id from the lots it returns to AVAILABLE, so filtering lots by that reference_id no longer finds them. The HOLD journal entry keeps the reference_id, and so does a RELEASE entry made with one. A release works on an archived asset, so existing holds can be unwound.
Forfeit
Remove funds permanently from a participant’s balance:
Forfeited funds move to the
SYSTEM_BREAKAGE account and cannot be recovered. FORFEIT takes no reference_id. It works on an archived asset and on a CLOSED participant, so you can clear a closed account’s balance. To set value aside without destroying it, use HOLD.
Void pending rewards
Cancel pending rewards, the lots a rule credited directly intoHELD, by reference_id. The value returns to the original source account:
Use void pending when an order or a card authorization is cancelled before it is confirmed. It cancels pending rewards credited directly into
HELD and returns the value to the program wallet for PREFUNDED assets or SYSTEM_ISSUANCE for UNLIMITED assets.
Void pending only processes lots that were created directly in
HELD via CREDIT. Lots moved to HELD via a HOLD operation (participant funds) are excluded for safety: returning those to the source would effectively confiscate participant value. Use release to return participant-held funds to AVAILABLE.amount when the issuer processor reverses only part of an authorization. amount is the rewards to cancel, not the purchase amount that was reversed. See how to calculate amount.
amount_processed in the response shows how much was voided. The amount in the balance.voided webhook event matches it. Both can be less than the amount you sent.
Scrip voids the newest pending rewards first because a partial reversal usually undoes the most recent authorization for the reference. A lot that is only partly voided keeps its reference_id, expires_at, and matures_at. The settlement or a later void still finds it.
VOID_PENDING takes no lot_ids, earned_from, or earned_to.
If no pending rewards match the reference_id, for example because it is unknown, already settled, or already voided, the request still returns 200. amount_processed is zero and the response has no journal_entry_id. Check amount_processed to confirm that something was voided. Void pending works on an archived asset.
Mature early
Make deferred value spendable before its maturity date, for example when you waive a return window for a customer. ADEFERRED lot normally moves to AVAILABLE shortly after its matures_at; see Vesting. This request moves it now:
MATURE takes reason in place of description. Scrip records the same MATURITY journal entry and balance.matured webhook event as a scheduled maturity, and brings each lot’s matures_at forward to the time of the request. The response has operation MATURE.
Early maturity is available for participants only, not groups.
For rules-driven pending rewards (including card authorization and settlement, partial authorization reversals, and out-of-order settlement events), see Pending rewards.
Idempotency
Every balance operation accepts an idempotency key. A retry that sends the same key moves no value a second time. Pass it either as anidempotency_key field in the body or as the standard Idempotency-Key HTTP header. The two are equivalent. If both are provided they must match; mismatched values return a 400 (header_body_mismatch) rather than silently picking one. Header values must be 1-255 printable ASCII characters.
Replaying the same key with identical parameters returns the original result without creating new postings, with the header Idempotent-Replayed: true. The same key with different parameters returns 409 (idempotency_conflict). Balance-operation keys do not expire, because Scrip stores each one with the ledger record of the operation. See Idempotency in the API reference for the full contract.
Inactive participants
ASUSPENDED or CLOSED participant cannot earn or spend. Their events are accepted and their rules run. A balance, counter, or tier action fails the event with participant_inactive when the event’s participant, or the participant the action changes, is inactive. The failed event keeps none of its changes, tags included. See Inactive participants and events.
For a SUSPENDED or CLOSED participant, ADJUST, HOLD, RELEASE, MATURE, and VOID_PENDING return 409 participant_inactive. FORFEIT also works on a CLOSED participant, so you can clear the remaining balance after you close an account. It returns 409 participant_inactive for a SUSPENDED participant.
Lots and expiration
Which lots a hold, release, or forfeit moves.
Ledger
How each operation is recorded.