Skip to content
SETSimple Easy Transactions
SET DocsSET Crypto API Suite and SET API referenceCurrent as of 2026-11-21 · wallet release 7d8a79fb
Browse: SET Crypto API Suite

SET Crypto API Suite · Wallets and balances

Set a treasury rule

PUT/v1/wallets/{id}/treasury

Key scope: write

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

id stringrequired
The wallet's id.

Body

schedule "daily" | "weekly" | "monthly"
Daily, Mondays or the 1st, at 15:00 UTC.
threshold decimal string
Sweep once the USDC balance reaches this (checked every 10 minutes). At least a schedule or a threshold.
keep decimal string
Stays in the wallet after a sweep; the threshold must exceed it.
keepShare decimal string
A percent of what is above keep that also stays in the wallet as USDC, from 0 to 99.99; the rest is swept by the split. Default 0.
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 above keep is split again. For example, keep: "500.00" and keepShare: "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_sweep or failed:<code>.

Errors

  • 400 schedule_invalid
  • 400 threshold_invalid
  • 400 allocations_invalid
  • 400 bank_account_invalid
  • 400 treasury_rule_invalid
  • 400 keep_share_invalid
  • 403 operator_cannot_withdraw
  • 404 wallet_unknown
  • 401 api_key_required
  • 401 api_key_invalid
  • 401 api_key_wrong_mode
  • 401 api_key_expired
  • 403 scope_missing
  • 403 platform_api_paused
  • 429 rate_limited
  • 503 api_disabled

All codes: Errors.