Skip to main content
POST
Fund a program
Adds funds to a program’s wallet for a specific PREFUNDED asset. Pass the asset_id in the request body. This is how you set a budget. Every CREDIT action on this asset draws from the wallet, and credits fail when the wallet is empty. Only PREFUNDED assets can be funded. UNLIMITED assets mint value on demand, so funding one returns 400 with code validation_error.
For usage patterns and examples, see the Programs 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 within 24 hours replays the original response (Idempotent-Replayed: true).

Maximum string length: 255

Path Parameters

program_id
string<uuid>
required

The program's id.

Body

application/json

Funding details

Adds an amount of an asset to a program wallet.

amount
string
required

Decimal amount to add to the wallet

Minimum string length: 1
Example:

"10000.00"

asset_id
string<uuid>
required

The id of the PREFUNDED asset to fund

Example:

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

description
string

Reason for this funding

Maximum string length: 500
Example:

"Initial program funding for Q1"

Response

Funding successful

The result of funding or burning a program wallet: the journal entry and the available balance after.

available
string

Wallet balance after the operation

Example:

"10000.00"

journal_entry_id
string<uuid>

Ledger journal entry created by this operation

Example:

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

message
string

Confirmation message

Example:

"Program funded successfully"