Skip to main content
POST
/
v1
/
order
/
withdraw
Withdraw
curl --request POST \
  --url https://swap-api.flux.fun/v1/order/withdraw \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "intentType": "Withdraw",
  "destinationAddress": "0x...",
  "amount": "1000000",
  "tokenType": "erc20",
  "tokenAddress": "0x...",
  "clientId": "withdraw-123",
  "tokenId": "123"
}
'
{
  "success": true,
  "intent": {
    "id": "intent_abc123xyz",
    "clientId": "client-order-123",
    "action": {
      "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": "2024-01-12T10:00:00.000Z"
  }
}

Authorizations

x-api-key
string
header
required
Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
intentType
enum<string>
required

Intent type

Available options:
Withdraw
Example:

"Withdraw"

destinationAddress
string
required

Destination wallet address

Example:

"0x..."

amount
string
required

Amount to withdraw

Example:

"1000000"

tokenType
enum<string>
required

Token type

Available options:
erc20,
erc1155
Example:

"erc20"

tokenAddress
string
required

Token contract address

Example:

"0x..."

clientId
string
required

Client-side withdrawal ID

Example:

"withdraw-123"

tokenId
string

Token ID (required for ERC-1155 tokens)

Example:

"123"

Response

Withdrawal intent created

success
boolean
required
Example:

true

intent
object
required