SET Crypto API Suite · Wallets and balances
Set a treasury rule
PUT/v1/wallets/{id}/treasury
The treasury rule: keep a USDC balance in the wallet and sweep it to the customer's own US bank accounts on a schedule, at a threshold, or both, split across up to five accounts. Each part is an ordinary withdrawal (own bank, ACH, with SET's fee as on any withdrawal) with its own wallet_withdrawal.* events.
Path parameters
idstringrequired- The wallet's id.
Body
schedule"daily" | "weekly" | "monthly"- Daily, Mondays or the 1st, at 15:00 UTC.
thresholddecimal string- Sweep once the USDC balance reaches this (checked every 10 minutes). At least a schedule or a threshold.
keepdecimal string- Stays in the wallet after a sweep; the threshold must exceed it.
keepSharedecimal string- A percent of what is above
keepthat also stays in the wallet as USDC, from0to99.99; the rest is swept by the split. Default0. allocations[{ bankAccount, share }]required- 1–5 of the same customer's own US bank accounts; shares in percent (two decimals) summing to 100.
Notes
- With
keepShare, what the share kept on earlier sweeps stays kept: only new money abovekeepis split again. For example,keep: "500.00"andkeepShare: "20"on a balance of 1,500.00 sweep 800.00 and keep 700.00. - The rule is the customer's own standing instruction, set with its own key. SET's operator cannot set, change or run it.
- A sweep waits while any withdrawal from the wallet is in flight. Each part must meet the cash-out minimum with at least 1.00 reaching the bank, or nothing is swept. The cent left by splitting goes to the first account.
lastResult:swept,partial,below_minimum,in_flight,initiation_required,nothing_to_sweeporfailed:<code>.
Errors
400 schedule_invalid400 threshold_invalid400 allocations_invalid400 bank_account_invalid400 treasury_rule_invalid400 keep_share_invalid403 operator_cannot_withdraw404 wallet_unknown401 api_key_required401 api_key_invalid401 api_key_wrong_mode401 api_key_expired403 scope_missing403 platform_api_paused429 rate_limited503 api_disabled