money-bill-transferWithdrawal Flow

Learn the withdrawal flow end to end, with both CLI and direct HTTP examples.

Hako withdrawals are authorization-based. Your integration creates a withdrawal action, your user signs the typed-data payload returned by the API, and Hako submits and processes the on-chain request on the user's behalf. This means the partner flow is centered around signing and authorization rather than broadcasting a user transaction directly.

circle-info

This page is intentionally workflow-first. For the full request and response contract, use the published API page or CLI example Githubarrow-up-right.

Flow At A Glance

spinner

1. Get Withdrawal Quote

Use POST /v1/quotes/withdraw if you want a route, fee, and timing estimate before creating a live action.

curl -sS -X POST "$HAKO_API/quotes/withdraw" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $PARTNER_KEY" \
  -d '{
    "strategyId": "stable_vault",
    "fromAccount": "0x1111111111111111111111111111111111111111",
    "mode": "amount",
    "amount": "1",
    "withdrawTo": {
      "account": "0x2222222222222222222222222222222222222222",
      "network": "base",
      "assetId": "USDC"
    }
  }'

Response excerpt:

CLI:

Notes:

  • withdrawTo.network and withdrawTo.assetId define the payout target.

2. Create Withdrawal Action

Use POST /v1/action/withdraw to create the live withdrawal action.

Response excerpt:

CLI:

Important points:

  • network is the destination payout network.

  • if receiver is omitted, it defaults to address

3. Sign The Typed Data

The authorization field returned by POST /v1/action/withdraw is a JSON string. Parse it and sign it as EIP-712 typed data.

The typed data uses primaryType: WithdrawalAuthorization.

4. Authorize Action

Use POST /v1/action/:actionId/authorize after you have the user signature.

Response excerpt:

Important points:

  • withdrawals do not use /report

  • re-authorize can safely return the same tx hash again

  • if the payload expired, create a new action and sign again

  • if the withdrawal nonce changed, create a new action and sign again

5. Track Status

Poll GET /v1/action/:actionId until the action is final.

CLI:

Status
Meaning

NEW

Action created, waiting for authorization

PROCESSING

Authorization accepted and Hako is processing the withdrawal

COMPLETING

Payout execution is in progress

PAYOUT_COMPLETED

The payout leg is done, but final home-vault accounting is still open

COMPLETED

Final success

FAILED

Terminal failure

CANCELLED

Terminal cancellation

circle-exclamation

Last updated