Skip to main content
POST
/
v1
/
order
Create Order
curl --request POST \
  --url https://swap-api.flux.fun/v1/order \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "orderType": "MarketOrder",
  "order": {
    "quoteToken": {
      "type": "kalshi",
      "data": {
        "marketId": "KXBTC-24NOV30-T65000",
        "side": "yes"
      }
    },
    "baseToken": {
      "type": "kalshi",
      "data": {
        "marketId": "KXBTC-24NOV30-T65000",
        "side": "yes"
      }
    },
    "orderType": "BUY",
    "baseQuantity": "100",
    "minQuoteQuantityOut": "95",
    "maxQuoteQuantityIn": "105"
  },
  "chainId": 8453,
  "clientId": "order-123",
  "includeTokenTransfer": false,
  "userAddress": "0x...",
  "receiverAddress": "0x..."
}
'
{
  "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
orderType
enum<string>
required

Order type

Available options:
MarketOrder
Example:

"MarketOrder"

order
object
required

Market order details

chainId
number
required

Chain ID

Example:

8453

clientId
string
required

Client-side order ID

Example:

"order-123"

includeTokenTransfer
boolean

Include token transfer in the order

Example:

false

userAddress
string

User wallet address

Example:

"0x..."

receiverAddress
string

Receiver address for tokens

Example:

"0x..."

Response

Order created successfully

success
boolean
required
Example:

true

intent
object
required