---
title: "Generate a withdraw transaction"
method: POST
path: "/withdraw/tx"
tags: ["Withdrawals"]
---

# Generate a withdraw transaction

`POST /withdraw/tx`

Generates a base64-encoded, serialized unsigned Solana versioned transaction. `payer_key` is required for transaction generation.

## Request body

- WithdrawTransactionRequest — Public transaction request schema for `/withdraw/tx`, where `payer_key` is required even though `/withdraw/ix` defaults it to `user_key`.
  - `params` WithdrawTransactionParams, required
    - `all` boolean, nullable — Withdraw the complete position. Defaults to `false`.
    - `amount` integer, nullable — Amount in the token's smallest unit. Required unless `all` is `true`.
    - `base_asset` string, required — Base-asset mint address within the strategy.
    - `create_wsol_ata` boolean, nullable — Prepend an idempotent WSOL associated-token-account creation when needed.
    - `detect_wsol_ata` boolean, nullable — Detect whether the user's WSOL associated token account exists.
    - `exclude_fees` boolean, nullable — Exclude fees from the requested amount. Defaults to `false`.
    - `fund_id` string, nullable — Deprecated and rejected by the API. Use `strategy_id` + `base_asset`.
    - `payer_key` string, required — Transaction payer.
    - `strategy_id` string, required — Strategy identifier.
    - `unwrap_wsol_ata` boolean, nullable — Sync and close the user's WSOL associated token account after withdrawing.
    - `user_key` string, required — Withdrawing wallet address.
    - `user_token_account` string, nullable — Destination token account. Defaults to the user's associated token account.

## Response `200`

Base64-encoded serialized transaction

- string

## Other responses

- `400` — Invalid withdraw request
- `401` — Missing API key
- `404` — Invalid, inactive, or expired API key
- `500` — Internal server error

---

[API](https://skmtc.net/breeze-baby/apis/breeze-api.md) · [All operations](https://skmtc.net/breeze-baby/apis/breeze-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/breeze-baby/breeze-api/revisions/d0a18846aa92/schema)
