curl --request POST \
--url https://api.scrip.dev/v1/participants/{participant_id}/balances/operations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": "100",
"asset_id": "a3bb189e-8bf9-4c8b-9be0-6b5d2f4e7a02",
"description": "Customer service credit",
"direction": "CREDIT",
"program_id": "8f14e45f-ceea-4e70-9df8-2a7d1b3c9f01",
"type": "ADJUST"
}
'{
"amount": "100",
"asset_id": "a3bb189e-8bf9-4c8b-9be0-6b5d2f4e7a02",
"balance": {
"available": "1500",
"deferred": "0",
"held": "200"
},
"bucket": "AVAILABLE",
"journal_entry_id": "657a0312-1aaa-4ba7-842b-edfbb39edf14",
"message": "Balance adjusted successfully",
"program_id": "8f14e45f-ceea-4e70-9df8-2a7d1b3c9f01",
"type": "CREDIT"
}Apply a balance operation
Adjust, hold, release, forfeit, void pending, or mature a participant’s balance in one asset.
curl --request POST \
--url https://api.scrip.dev/v1/participants/{participant_id}/balances/operations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": "100",
"asset_id": "a3bb189e-8bf9-4c8b-9be0-6b5d2f4e7a02",
"description": "Customer service credit",
"direction": "CREDIT",
"program_id": "8f14e45f-ceea-4e70-9df8-2a7d1b3c9f01",
"type": "ADJUST"
}
'{
"amount": "100",
"asset_id": "a3bb189e-8bf9-4c8b-9be0-6b5d2f4e7a02",
"balance": {
"available": "1500",
"deferred": "0",
"held": "200"
},
"bucket": "AVAILABLE",
"journal_entry_id": "657a0312-1aaa-4ba7-842b-edfbb39edf14",
"message": "Balance adjusted successfully",
"program_id": "8f14e45f-ceea-4e70-9df8-2a7d1b3c9f01",
"type": "CREDIT"
}ADJUST, HOLD, RELEASE, FORFEIT, VOID_PENDING, or MATURE) on a participant’s balance in one asset. The type field selects which fields the request accepts; passing fields not allowed for that type returns 400 validation_error with reason: not_allowed in fields.
- Response shape:
ADJUSTreturns the journal entry, direction (type),bucket, and updated balance; all other operation types returnoperation,amount_processed,lots_processed(forLOT-mode assets), and the updated balance. - Status and idempotency: All operations require an
ACTIVEparticipant exceptFORFEIT, which is also allowed onCLOSEDparticipants (409 participant_inactiveotherwise). Operation idempotency keys are stored permanently with the ledger record and do not expire.
Authorizations
Headers
Unique key (1-255 printable ASCII characters) to make retries safe. Repeating the same request with the same key returns the original result; reusing the key with different fields returns 409 idempotency_conflict. When the body also accepts idempotency_key, supply either or both with the same value.
255Path Parameters
Body
The operation and its fields
- ADJUST operation
- HOLD operation
- RELEASE operation
- FORFEIT operation
- VOID_PENDING operation
- MATURE operation
- MATURE operation
A balance operation on a participant. type selects the operation and accepted fields.
Vesting timestamp when a credited lot becomes spendable (RFC 3339, LOT assets with direction: CREDIT only). A future value puts the credit in DEFERRED. Mutually exclusive with matures_in. Not supported with bucket: HELD.
1 - 255"2027-12-31T23:59:59Z"
Response
Operation applied
- Option 1
- Option 2
The result of a balance operation. ADJUST returns the adjustment's journal entry, direction and bucket; every other type returns the amount processed, the lots touched and the balance after.