Skip to main content
POST
Create withdrawal

Authorizations

Authorization
string
header
required

Scoped API key from the Totalis app settings. Each key acts for one account, yours or a maker's, and holds only scopes that account can use. Each operation lists the scopes it requires.

Headers

Idempotency-Key
string<uuid>
required

Lowercase UUIDv7 naming this command, unique per caller and route. A retry with the same key and body returns the original result; the same key with a different body returns 409 IDEMPOTENCY_KEY_REUSED.

Pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$

Body

application/json

The whole withdrawal in one request: pay amount from the embedded wallet to destination, topping the wallet up from the vault first when it cannot cover the amount. The owner signs the vault Exit for the shortfall and the USDC payout together; Totalis relays both, in order, and pays the gas.

destination
string
required

External address that receives the USDC.

Pattern: ^0x[0-9a-f]{40}$
amount
string<uint128-decimal>
required

Total amount to send, in atomic USDC (6 decimals); must be greater than zero.

Maximum string length: 39
Pattern: ^(0|[1-9][0-9]*)$
payout_authorization
object
required

The embedded wallet's USDC EIP-3009 TransferWithAuthorization of exactly amount to destination. Its nonce is not sent: sign keccak256(abi.encode(keccak256("TOTALIS_PAYOUT_NONCE_V1"), chainId, vault, account, uint128(Idempotency-Key))), where account is the embedded wallet and Idempotency-Key is this request's key read as 16 bytes. The signature is therefore bound to this request and cannot start a second withdrawal. Choose the Idempotency-Key before you sign.

vault_withdrawal
object

Signed Exit moving the exact shortfall (amount minus spendable wallet USDC) from the vault back to the embedded wallet. Required when there is a shortfall and forbidden when there is none; a mismatch returns 409 STATE_CONFLICT with retry REFRESH: re-read balances and sign again.

Response

Admitted, not yet paid: Totalis tops your wallet up from the vault if needed, relays the payout and pays the gas. Follow WITHDRAWAL_UPDATED on the account stream until PAYOUT_COMMITTED or FAILED. A retry with the same Idempotency-Key and body returns the withdrawal as it stands.

withdrawal_id
string<uuid>
required

Server-assigned ID of this withdrawal.

Pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
account
string
required

Embedded wallet that pays out.

Pattern: ^0x[0-9a-f]{40}$
destination
string
required

External address that receives the USDC.

Pattern: ^0x[0-9a-f]{40}$
amount
string<uint128-decimal>
required

Total amount sent to destination, in atomic USDC (6 decimals).

Maximum string length: 39
Pattern: ^(0|[1-9][0-9]*)$
shortfall_amount
string<uint128-decimal>
required

Part of amount first withdrawn from the vault to the wallet, in atomic USDC; "0" when the wallet already covered it.

Maximum string length: 39
Pattern: ^(0|[1-9][0-9]*)$
status
enum<string>
required

VAULT_WITHDRAWAL_QUEUED: the vault top-up is queued and the payout waits for it; PAYOUT_SUBMITTED: the payout is queued or relayed; PAYOUT_COMMITTED: destination received amount (terminal); FAILED: the withdrawal stopped and nothing left the Totalis balance: a vault top-up that committed stays in the wallet (terminal).

Available options:
VAULT_WITHDRAWAL_QUEUED,
PAYOUT_SUBMITTED,
PAYOUT_COMMITTED,
FAILED
vault_operation_id
string | null
required

Operation of the vault top-up; null when there is no shortfall.

Pattern: ^0x[0-9a-f]{64}$
payout_operation_id
string | null
required

Operation of the relayed payout; null until the vault top-up commits.

Pattern: ^0x[0-9a-f]{64}$
payout_transaction_hash
string | null
required

HyperEVM transaction of the payout; null until it is broadcast.

Pattern: ^0x[0-9a-f]{64}$
updated_at
string<date-time>
required

When the withdrawal last changed, RFC3339 UTC.

Maximum string length: 30
Pattern: ^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}([.][0-9]{1,9})?Z$