> ## Documentation Index
> Fetch the complete documentation index at: https://docs.breeze.baby/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Withdraw Instructions

> Generates raw Solana instructions for withdrawing funds from a strategy. Use this endpoint for advanced use cases where you need more control over transaction construction.



## OpenAPI

````yaml POST /withdraw/ix
openapi: 3.1.0
info:
  title: Breeze API
  description: >-
    A comprehensive API for managing yield farming operations, funds, and user
    authentication
  contact:
    name: Breeze Team
    email: support@breeze.baby
  license:
    name: ''
  version: 1.0.0
servers:
  - url: https://api.breeze.baby
    description: Production server
security: []
tags:
  - name: Admin
    description: Administrative operations
  - name: Deposits
    description: Deposit operations
  - name: Withdrawals
    description: Withdrawal operations
  - name: User Data
    description: User balance and yield data
  - name: Funds
    description: Fund management operations
  - name: Organization API Keys
    description: Organization API key management
  - name: Organization Management
    description: Organization configuration and settings
  - name: Partner Stats
    description: Partner statistics and analytics
  - name: Global Config
    description: Global configuration and supported assets
  - name: Yield Sources
    description: Yield source information and statistics
  - name: Close User Account
    description: Close user fund account operations
  - name: External APIs
    description: External API integrations and health checks
paths:
  /withdraw/ix:
    post:
      tags:
        - Withdrawals
      summary: Generate withdraw instructions
      description: >-
        Generates raw Solana instructions for withdrawing funds from a strategy.
        Use this endpoint for advanced use cases where you need more control
        over transaction construction.
      operationId: process_for_withdraw_with_instruction
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StructuredInputForWithdraw'
        required: true
      responses:
        '200':
          description: Withdraw instruction prepared successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WithdrawInstructionResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - api_key: []
components:
  schemas:
    StructuredInputForWithdraw:
      type: object
      required:
        - params
      properties:
        params:
          $ref: '#/components/schemas/InputForWithdraw'
    WithdrawInstructionResponse:
      type: object
      required:
        - withdraw_instructions
        - lookup_table
      properties:
        withdraw_instructions:
          type: array
          items:
            $ref: '#/components/schemas/SolanaInstruction'
          description: Array of Solana instructions for the withdraw operation
        lookup_table:
          type: string
          description: Address of the lookup table for the transaction
    ErrorResponse:
      type: object
      required:
        - message
      properties:
        message:
          type: string
          description: Error message description
    InputForWithdraw:
      type: object
      properties:
        all:
          type:
            - boolean
            - 'null'
          description: Whether to withdraw all funds
        amount:
          type:
            - integer
            - 'null'
          format: int64
          minimum: 0
          description: Amount to withdraw in raw token units
        base_asset:
          type:
            - string
            - 'null'
          description: Token mint address (e.g., USDC, WSOL)
        fund_id:
          type:
            - string
            - 'null'
        payer_key:
          type:
            - string
            - 'null'
          description: Optional payer public key for the transaction
        strategy_id:
          type:
            - string
            - 'null'
          description: Strategy identifier
        user_key:
          type:
            - string
            - 'null'
          description: User's wallet public key
        user_token_account:
          type:
            - string
            - 'null'
          description: Optional user token account address (defaults to user's ATA)
        create_wsol_ata:
          type:
            - boolean
            - 'null'
          description: >-
            If base asset is WSOL and user_token_account is not provided,
            prepend an ATA-create instruction. Defaults to true when omitted.
        unwrap_wsol_ata:
          type:
            - boolean
            - 'null'
          description: >-
            If base asset is WSOL, unwrap to SOL by syncing and closing the
            user's WSOL ATA at the end. Defaults to false when omitted.
        detect_wsol_ata:
          type:
            - boolean
            - 'null'
          description: >-
            If true, the API will do an RPC round-trip to detect whether the
            user's WSOL ATA exists. When enabled (and base asset is WSOL), this
            overrides the other WSOL ATA flags: if the WSOL ATA does not exist,
            create_wsol_ata=true and unwrap_wsol_ata=true; if the WSOL ATA
            exists, create_wsol_ata=false and unwrap_wsol_ata=false. Defaults to
            false when omitted.
        exclude_fees:
          type:
            - boolean
            - 'null'
          description: >-
            When true, excludes fees from the amount. So that you will be able
            get the real amount you have requested + fees that would have been
            subtracted from the user's yield. Defaults to false.
    SolanaInstruction:
      type: object
      required:
        - program_id
        - accounts
        - data
      properties:
        program_id:
          type: array
          items:
            type: integer
            format: uint8
            minimum: 0
            maximum: 255
          minItems: 32
          maxItems: 32
          description: 32-byte program ID as an array of integers
        accounts:
          type: array
          items:
            $ref: '#/components/schemas/SolanaAccountMeta'
          description: Array of account metadata for the instruction
        data:
          type: array
          items:
            type: integer
            format: uint8
            minimum: 0
            maximum: 255
          description: Instruction data as an array of bytes
    SolanaAccountMeta:
      type: object
      required:
        - pubkey
        - is_signer
        - is_writable
      properties:
        pubkey:
          type: array
          items:
            type: integer
            format: uint8
            minimum: 0
            maximum: 255
          minItems: 32
          maxItems: 32
          description: 32-byte public key as an array of integers
        is_signer:
          type: boolean
          description: Whether the account is a signer
        is_writable:
          type: boolean
          description: Whether the account is writable
  securitySchemes:
    api_key:
      type: apiKey
      in: header
      name: x-api-key

````