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

# Withdraw

> Withdraw funds from your smart account to a destination address. The withdrawal will be processed asynchronously and you can track its status using the returned intent ID.



## OpenAPI

````yaml openapi.json post /v1/order/withdraw
openapi: 3.0.0
info:
  title: Swaps API
  description: The Swaps API documentation
  version: '1.0'
  contact: {}
servers:
  - url: https://swap-api.flux.fun
    description: Production
  - url: http://localhost:3000
    description: Development
security: []
tags: []
paths:
  /v1/order/withdraw:
    post:
      tags:
        - Orders
      summary: Withdraw
      description: >-
        Withdraw funds from your smart account to a destination address. The
        withdrawal will be processed asynchronously and you can track its status
        using the returned intent ID.
      operationId: OrdersController_createWithdrawIntent
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WithdrawActionDto'
      responses:
        '200':
          description: Withdrawal intent created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateOrderResponseDto'
        '400':
          description: Invalid withdrawal data
        '401':
          description: Unauthorized - JWT token required
      security:
        - api-key: []
          bearer: []
components:
  schemas:
    WithdrawActionDto:
      type: object
      properties:
        intentType:
          type: string
          description: Intent type
          enum:
            - Withdraw
          example: Withdraw
        destinationAddress:
          type: string
          description: Destination wallet address
          example: 0x...
        amount:
          type: string
          description: Amount to withdraw
          example: '1000000'
        tokenType:
          type: string
          description: Token type
          enum:
            - erc20
            - erc1155
          example: erc20
        tokenAddress:
          type: string
          example: 0x...
          description: Token contract address
        tokenId:
          type: string
          description: Token ID (required for ERC-1155 tokens)
          example: '123'
        clientId:
          type: string
          description: Client-side withdrawal ID
          example: withdraw-123
      required:
        - intentType
        - destinationAddress
        - amount
        - tokenType
        - tokenAddress
        - clientId
    CreateOrderResponseDto:
      type: object
      properties:
        success:
          type: boolean
          example: true
        intent:
          $ref: '#/components/schemas/IntentBasicResponseDto'
      required:
        - success
        - intent
    IntentBasicResponseDto:
      type: object
      properties:
        id:
          type: string
          example: intent_abc123xyz
          description: Unique order intent ID
        clientId:
          type: string
          example: client-order-123
          description: Client-provided order ID
          nullable: true
        action:
          type: object
          description: Order action details
          example:
            orderType: MarketOrder
            order:
              quoteToken:
                type: chain
                data:
                  tokenId: USDC
                  chainId: 8453
                  contractAddress: 0x...
              baseToken:
                type: kalshi
                data:
                  marketId: BTC-100K-2024
                  side: 'yes'
              orderType: BUY
              baseQuantity: '100'
              maxQuoteQuantityIn: '50.00'
            chainId: 8453
        createdAt:
          type: string
          example: '2024-01-12T10:00:00.000Z'
          description: When the order was created
      required:
        - id
        - clientId
        - action
        - createdAt
  securitySchemes:
    api-key:
      type: apiKey
      in: header
      name: x-api-key
    bearer:
      scheme: bearer
      bearerFormat: JWT
      type: http

````