Self-custody wallets: API guide
Status: current as of 2026-11-18.
How to open a self-custody wallet, have its owners accept it, collect bank payments into it, pay from it and sign each payment, including with your own server's key. SET's software does not sign for you: SET checks and proposes each payment, and the owners sign it.
Switched on per deployment; ask SET. While self-custody wallets are off for your account, each call below answers
503 self_custody_disabled.GET /v1/capabilitiesanswersselfCustodyWallets.
1. Choose the owners
GET /v1/wallets/owner_candidates lists your account's members with the admin or finance role, who may own a wallet: each member's id (pmb_…) and role only, and which of them is you (you, in the SET Console).
2. Open the wallet
POST /v1/wallets with custody: "self":
{
"customer": "cus_…",
"chain": "base",
"custody": "self",
"owners": { "members": ["pmb_…", "pmb_…"], "publicKeys": ["MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE…"], "threshold": 2 },
"limits": { "assets": ["usdc"], "perPayment": "5000.00", "perDay": "20000.00" }
}| Field | What |
|---|---|
chain | base, ethereum, arbitrum, polygon or solana |
owners.members | 1 to 10 team member ids. At least one person always owns the wallet |
owners.publicKeys | Optional: up to 3 of your servers' P-256 public keys, base64 SPKI or PEM. Never a private key |
owners.threshold | Optional: how many owners must sign each payment |
limits.assets | usdc or eurc; default usdc |
limits.perPayment, limits.perDay | Decimal strings, or null for none. perDay counts the last 24 hours |
It answers 201 with state pending_acceptance and no address. GET /v1/wallets?custody=self lists your self-custody wallets; GET /v1/wallets/swl_… reads one: its owners, who has accepted, its limits and what SET read back, with balances read on chain now.
3. Each owner accepts, in the console
Each person named accepts in their own signed-in SET Console (Crypto › Wallets, Accept). The call behind the button is POST /v1/wallets/swl_…/acceptance, which needs the approve scope. An API key cannot accept for a person (403 acceptance_needs_a_person). After the last acceptance SET creates the wallet and reads it back: state active with an address, or frozen with none if the read-back differs.
4. Collect into it
Bank payments settle into an active self-custody wallet:
POST /v1/virtual_accountswithsettleTo: { "wallet": "swl_…" }POST /v1/payment_setups, waybalance, withwallet: "swl_…"
A chain the provider does not deliver bank payments to is refused.
5. Pay from it
One payment to an address. POST /v1/wallets/swl_…/payments with { asset, amount, destination, externalId? }. destination is an address on the wallet's own chain. SET checks the wallet's limits (422 policy_refused), your restrictions and screening, then proposes the payment and answers 201 with state awaiting_signature and intent.signingPayload: the bytes each owner signs. A repeated externalId answers the payment already made.
A payout to a recipient. POST /v1/payouts with { wallet: "swl_…", recipient, amount, externalId? }, or POST /v1/payout_batches with { wallet: "swl_…", items } (1 to 100). Each payout is one payment of its own to sign. A batch answers each item's payment or error.
- A wallet recipient is paid at its own address on the wallet's network; a recipient on another network answers
409 recipient_network_mismatch. - A bank recipient is paid through its own
activeCash-Out Address on the wallet's chain (a multichain address counts on Base and Ethereum), opened for the wallet's own customer, in a stablecoin the owners allowed. Without one, the payout answers409 cash_out_address_missing: open one withPOST /v1/cash_out_addresses. The Travel Rule data for the bank leg (originator: the customer's own self-custodied wallet; beneficiary: the recipient) is checked and sealed before anything is proposed, and submitted once for the drain when the payment arrives at the Cash-Out Address from the wallet's address for the exact amount. The answer addscashOutAddressandtravelRule: { held, submittedFor }(submittedForis the drain, once submitted). - Any other recipient answers
409 recipient_not_payable_from_self_wallet.
Every destination, the recipient's wallet or its Cash-Out Address, is screened against OFAC's list before the payment is proposed; a destination screening refuses answers 403 destination_refused (in a batch, that item's error), and nothing is proposed for it. The wallet's limits and your restrictions apply as for a payment.
GET /v1/wallets/swl_…/payments lists the wallet's payments and GET /v1/wallets/swl_…/payments/swp_… reads one again from the provider. While a payment waits for signatures, each read carries fresh bytes to sign.
6. Sign
Owners who are people sign in the SET Console: Crypto › Wallets, Review and sign. The page shows what the signed bytes say first and refuses to sign anything it cannot describe.
An owner that is your server signs through the API:
- Generate a P-256 key pair on your own server or in your KMS. Give SET only the public key, in
owners.publicKeys, when you open the wallet. - For each payment, read
intent.signingPayload.bytesBase64and decode it from base64. - Sign those exact bytes with ECDSA P-256 (SHA-256).
- Post the base64 signature, with
intent.signingPayload.timestamp, toPOST /v1/wallets/swl_…/payments/swp_…/signatureswithin 5 minutes:{ "signature": "…", "timestamp": 1795000000000 }. This needs a key with the approve scope.
SET passes the signature to the wallet provider unchanged. The provider checks it against your public key, checks the signer is an owner, and counts it toward the threshold.
A sketch in Node.js:
import { createPrivateKey, sign } from "node:crypto";
// Your P-256 private key, from your own store. It never leaves your server.
const key = createPrivateKey(process.env.WALLET_OWNER_KEY_PEM);
export function signPayment(signingPayload) {
const bytes = Buffer.from(signingPayload.bytesBase64, "base64");
const signature = sign("sha256", bytes, { key, dsaEncoding: "der" }).toString("base64");
return { signature, timestamp: signingPayload.timestamp };
}The signature is DER-encoded here, the form the wallet provider's own signing examples produce. SET's reference names the algorithm (ECDSA P-256 with SHA-256) but not the encoding, so confirm it on staging before you rely on it.
Recovery bundle
GET /v1/wallets/swl_…/recovery_bundle (read scope) answers object: "wallet_recovery_bundle": the address (only once active), chain, caip2, chainId, provider (appId, walletId, ownerQuorumId, policyId), owners (threshold, members with acceptedAt, publicKeys), limits and recovery.
model.typeisprovider_server_walletandsmartContractisfalse: this is not a Safe, so no Safe or EIP-712 payload is given.recovery.moveFunds: a transfer request to the wallet provider signed by at leastthresholdowners; through SET,POST /v1/wallets/{id}/paymentsand the owners' signatures.recovery.exportPrivateKey: the provider's export of the private key, authorized by the owner quorum and restricted by the provider to the wallet's owners.availableThroughSetisfalse.recovery.dependsOnSet: every request to the provider for this wallet also needs the provider app's id and secret, which SET holds. SET can relay a request the owners signed but cannot authorize a movement or an export, and offers no export relay in this release.
The bundle holds no secret. 404 wallet_unknown for a wallet that is not one of yours; 503 self_custody_disabled while self-custody wallets are off.
Payment states
| State | Meaning |
|---|---|
awaiting_signature | Proposed; waiting for enough owners to sign |
processing | The wallet provider is carrying it out |
executed | The wallet provider says it was carried out |
confirmed | SET read the USDC transfer on chain. Today on Base only; other networks stay executed until SET reads their chain |
failed, rejected, expired, dismissed | Ended without paying, as the wallet provider reports it. None of these counts toward perDay |
Balances
A wallet's balances cover USDC on Base, Ethereum, Arbitrum, Polygon and Solana, read on chain as SET Payouts reads them. EURC answers balance: null with a note.
Errors
Every error is JSON: { "error": "<code>", "message": "<text>" }. Read error; the message is for people and can change.
| Status | Code | When |
|---|---|---|
| 503 | self_custody_disabled | Self-custody wallets are not switched on for this deployment |
| 409 | self_custody_winding_down | Opening a wallet while they are winding down; existing wallets keep every way out |
| 403 | scope_missing | Accepting or signing without the approve scope |
| 403 | acceptance_needs_a_person | An API key tried to accept ownership |
| 403 | not_an_owner | The signed-in member is not named as an owner |
| 404 | customer_unknown, wallet_unknown, payment_unknown, recipient_unknown | No such object on your account |
| 409 | customer_closed | The customer is closed |
| 400 | owners_invalid | owners.members is not 1 to 10 team member ids |
| 400 | public_keys_invalid | owners.publicKeys is not up to 3 distinct P-256 public keys |
| 400 | limits_invalid | perPayment or perDay is not a decimal string above 0, or null |
| 409 | wallet_not_active | Paying from a wallet that is not active |
| 400 | asset_invalid | An asset the owners did not allow |
| 400 | amount_invalid | Not a decimal string above 0 |
| 400 | destination_invalid | Not an address on the wallet's chain, or the wallet itself |
| 422 | policy_refused | Over perPayment, or over perDay in the last 24 hours |
| 403 | destination_refused | The destination (a wallet, or a bank recipient's Cash-Out Address) was refused by sanctions screening |
| 400 | external_id_invalid | externalId is not 1 to 64 letters, digits, dots, colons, underscores or hyphens |
| 400 | items_invalid | A batch of no items or more than 100 |
| 400 | recipient_invalid | Not a recipient id (rcp_…) |
| 409 | recipient_disabled | The recipient is disabled |
| 409 | recipient_not_payable_from_self_wallet | Neither a wallet recipient nor a bank recipient |
| 409 | cash_out_address_missing | A bank recipient with no active Cash-Out Address on the wallet's chain for this wallet's customer, in a stablecoin the owners allowed |
| 409 | recipient_network_mismatch | The recipient is paid on another network |
| 409 | payment_not_waiting | Signing a payment that no longer waits for signatures |
| 400 | signature_invalid, timestamp_invalid | Not a base64 signature, or not the payload's own timestamp in milliseconds |
| 410 | signature_expired | The bytes were signed more than 5 minutes ago; read the payment again and sign the fresh bytes |
| 503 | provider_unavailable | The wallet provider could not be reached; nothing was created |
| 502 | provider_refused | The wallet provider refused the request; nothing was created |
Sources
Written on 2026-11-18 from the wallet's self-custody wallet documentation, its OpenAPI entries and its routes (spec 21), and checked against the wallet's OpenAPI document at release ec5f2ac6 (2026-11-18). The recovery bundle and bank payouts through a Cash-Out Address were added from the wallet's routes and OpenAPI document at release 22a44bcb (2026-11-18). Every call on this page is in the SET Crypto API Suite's OpenAPI document, and the /v1 calls are in the SET API's.
Related
Changes
- 2026-11-18: OpenAPI, Postman and docs re-synced from the wallet at; Crypto Suite /v1 calls follow the wallet's marks.
- 2026-11-18: Docs: three OpenAPI documents (SET API, SET Direct Deposit, SET Crypto API Suite).