Skip to main content

CLI Sub Accounts

Use the subaccounts command group (alias: sa) to operate merchant sub-accounts.

Commands

CommandDescription
zendfi subaccounts create --label <label>Create a sub-account
zendfi subaccounts listList all sub-accounts
zendfi subaccounts get <id>Get a sub-account by UUID or external ID
zendfi subaccounts balance <id>Get current SOL/USDC balances
zendfi subaccounts token <id>Mint a scoped delegation token
zendfi subaccounts freeze <id>Freeze sub-account and revoke active delegation tokens
zendfi subaccounts drain <id>Drain funds back to merchant wallet
zendfi subaccounts withdraw <id>Withdraw to external wallet
zendfi subaccounts withdraw-bank <id>Withdraw to bank with automated proxy-email OTP flow
zendfi subaccounts automation-token-mintMint bounded automation token for headless withdraw-bank
zendfi subaccounts automation-token-revoke <token-id>Revoke automation token
zendfi subaccounts close <id>Close sub-account

Create

zendfi subaccounts create \
  --label user_paschal_001 \
  --spend-limit 500 \
  --access-mode delegated

List

zendfi subaccounts list

Balance

zendfi subaccounts balance sa_xxxxx

Mint Delegation Token

zendfi subaccounts token sa_xxxxx \
  --scope withdraw_only \
  --spend-limit 100 \
  --ttl 900 \
  --whitelist 7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU \
  --single-use

Freeze

zendfi subaccounts freeze sa_xxxxx --reason "fraud-review"

Drain

zendfi subaccounts drain sa_xxxxx \
  --amount 25 \
  --token Usdc \
  --mode live \
  --passkey-file ./passkey-signature.json

Withdraw

zendfi subaccounts withdraw sa_xxxxx \
  --to 7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU \
  --amount 10 \
  --token Usdc \
  --mode live \
  --delegation-token satk_xxxxx \
  --passkey-file ./passkey-signature.json

Withdraw to Bank (One-Shot)

zendfi subaccounts withdraw-bank sa_xxxxx \
  --amount 25 \
  --bank-id 9PSB7A2A2LJZ3H6Q4G8XJ6A4 \
  --account-number 0123456789 \
  --mode live \
  --automation-token saatk_xxxxx \
  --delegation-token satk_xxxxx \
  --passkey-file ./passkey-signature.json
This command mirrors split proxy-email OTP automation. No manual OTP prompt is required. --automation-token and --delegation-token are mutually exclusive.

Mint Automation Token

zendfi subaccounts automation-token-mint \
  --subaccount-id sa_xxxxx \
  --ttl 3600 \
  --max-uses 25 \
  --total-limit 500 \
  --per-tx-limit 50 \
  --bank-ids 9PSB7A2A2LJZ3H6Q4G8XJ6A4 \
  --account-numbers 0123456789 \
  --mode live

Revoke Automation Token

zendfi subaccounts automation-token-revoke 0f8fad5b-d9cb-469f-a165-70867728950e

Close

zendfi subaccounts close sa_xxxxx

Passkey Signature File

Sensitive operations require --passkey-file JSON with this shape:
{
  "credential_id": "...",
  "authenticator_data": [1, 2, 3],
  "signature": [4, 5, 6],
  "client_data_json": [7, 8, 9]
}