Skip to main content
POST
Runs a direct ledger operation (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: ADJUST returns the journal entry, direction (type), bucket, and updated balance; all other operation types return operation, amount_processed, lots_processed (for LOT-mode assets), and the updated balance.
  • Status and idempotency: All operations require an ACTIVE participant except FORFEIT, which is also allowed on CLOSED participants (409 participant_inactive otherwise). Operation idempotency keys are stored permanently with the ledger record and do not expire.
For each operation’s fields, responses, and examples, see the Balance operations guide.

Authorizations

Authorization
string
header
default:sk_...
required

Send your API key as Authorization: Bearer <key>.

Headers

Idempotency-Key
string

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.

Maximum string length: 255

Path Parameters

participant_id
string
required

The participant's id, or ext: followed by the participant's external_id.

Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}|ext:.{1,255})$

Body

application/json

The operation and its fields

A balance operation on a participant. type selects the operation and accepted fields.

amount
string
required

The positive amount to add or remove, in the asset's units.

Minimum string length: 1
Example:

"100.00"

asset_id
string<uuid>
required

The asset to operate on.

Example:

"a3bb189e-8bf9-4c8b-9be0-6b5d2f4e7a02"

description
string
required

Why you are adjusting the balance. Scrip records it in the journal entry.

Required string length: 1 - 500
Example:

"Customer service credit"

direction
enum<string>
required

Whether to credit or debit the balance (ADJUST only).

Available options:
CREDIT,
DEBIT
Example:

"CREDIT"

program_id
string<uuid>
required

The program the operation belongs to.

Example:

"8f14e45f-ceea-4e70-9df8-2a7d1b3c9f01"

type
enum<string>
required

The operation to run: ADJUST.

Available options:
ADJUST
Example:

"ADJUST"

allow_negative
boolean

When true on a DEBIT adjustment, allows the balance to go negative.

Example:

false

bucket
enum<string>

The balance bucket to adjust. Defaults to AVAILABLE.

Available options:
AVAILABLE,
HELD
Example:

"AVAILABLE"

expires_at
string<date-time>

Expiration timestamp for a credited lot (RFC 3339, LOT assets with direction: CREDIT only). Mutually exclusive with expires_in. Not supported with bucket: HELD.

Required string length: 1 - 255
Example:

"2027-12-31T23:59:59Z"

expires_in
string

Expiration duration from now for a credited lot, such as "90d" (LOT assets with direction: CREDIT only). Units are w, d, h, m and s. Mutually exclusive with expires_at. Not supported with bucket: HELD.

Required string length: 1 - 255
Example:

"90d"

idempotency_key
string

Unique key for this operation. You can send it in the Idempotency-Key header instead. When you send both, they must match.

Required string length: 1 - 255
Example:

"order-1001-completed"

matures_at
string<date-time>

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.

Required string length: 1 - 255
Example:

"2027-12-31T23:59:59Z"

matures_in
string

Vesting duration from now when a credited lot becomes spendable, such as "7d" (LOT assets with direction: CREDIT only). A future value puts the credit in DEFERRED. Mutually exclusive with matures_at. Not supported with bucket: HELD.

Required string length: 1 - 255
Example:

"7d"

Response

Operation applied

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.

amount
string
required

Amount adjusted

Example:

"100.00"

bucket
enum<string>
required

The balance bucket that was adjusted.

Available options:
AVAILABLE,
HELD,
DEFERRED
Example:

"AVAILABLE"

journal_entry_id
string<uuid>
required

Ledger journal entry created by this adjustment

Example:

"657a0312-1aaa-4ba7-842b-edfbb39edf14"

type
enum<string>
required

Whether the adjustment was a credit or debit

Available options:
CREDIT,
DEBIT
Example:

"CREDIT"

asset_id
string<uuid>

The asset that was adjusted.

Example:

"a3bb189e-8bf9-4c8b-9be0-6b5d2f4e7a02"

balance
object

Balance after the adjustment

message
string

Confirmation message

Example:

"Balance adjusted successfully"

program_id
string<uuid>

The program the adjustment belongs to.

Example:

"8f14e45f-ceea-4e70-9df8-2a7d1b3c9f01"