Create Order
Place a new trading order with various order types and execution options.
Endpoint
Parameters
RSA public key identifier for authentication
Base64-encoded RSA signature of the request payload. Payload format: POST:/api/v1/orders:sorted_body_params
Request Body
Trading instrument symbol (e.g., “GOLD-BTC”)
Instrument type: “perpetual”
Order side: “buy” or “sell”
Order type: “market”, “limit”, “stop”, “stoplimit”
Order quantity as decimal string
Order price as decimal string (required for limit and stoplimit orders)
Stop trigger price as decimal string (required for stop and stoplimit orders)
Time in force: “gtc” (Good Till Canceled), “ioc” (Immediate or Cancel), “gtd” (Good Till Date)
Price unit: “sats” or “btc”
Cancel timestamp in milliseconds (for GTD orders)
If true, the order will only be placed as a maker order. It will not execute immediately against existing orders in the book; if it would, the order is cancelled instead.
Example Requests
Market Order
Limit Order
Stop Limit Order
Python
JavaScript
curl -X POST "https://api.roxom.com/api/v1/orders" \
-H "X-API-Key: your_api_key_here" \
-H "X-API-Signature: your_rsa_signature_here" \
-H "Content-Type: application/json" \
-d '{
"symbol": "OIL-BTC",
"instType": "perpetual",
"orderType": "market",
"side": "buy",
"qty": "12",
"unit": "BTC",
"postOnly": true,
}'
Response
{
"data" : {
"orderId" : "01234567-89ab-7def-8123-456789abcdea"
},
"error" : false
}
Order creation response UUID v7 string identifying the created order
Order Validation
Before placing orders, ensure they meet symbol requirements:
For LIMIT and STOP_LIMIT orders:
Price must be within min/max range
Price must be divisible by tick size
For BUY orders: price ≤ current ask × 1.1
For SELL orders: price ≥ current bid × 0.9
For all orders:
Quantity must be within min/max range
Quantity must be divisible by step size
Notional value (price × quantity) must exceed minimum
For order placement:
BUY orders: require sufficient quote asset balance
SELL orders: require sufficient base asset balance
Margin orders: require sufficient margin available
Error Handling
{
"error" : {
"code" : 400 ,
"message" : "Insufficient balance" ,
"details" : "Available balance: 0.005 BTC, required: 0.01 BTC"
},
"timestamp" : "2024-01-15T10:30:00Z" ,
"requestId" : "req_def456"
}
{
"error" : {
"code" : 400 ,
"message" : "Price outside allowed range" ,
"details" : "Price must be between 40000.00 and 50000.00"
},
"timestamp" : "2024-01-15T10:30:00Z" ,
"requestId" : "req_ghi789"
}
{
"error" : {
"code" : 400 ,
"message" : "Market not available" ,
"details" : "Trading is currently halted for BTC-USD"
},
"timestamp" : "2024-01-15T10:30:00Z" ,
"requestId" : "req_jkl012"
}
Best Practices
Small Orders : Execute faster with less market impact
Large Orders : Consider breaking into smaller chunks
Iceberg Orders : Hide large order sizes from the market
Limit Orders : Set competitive prices for better fill rates
Market Orders : Use for immediate execution, accept slippage
Stop Orders : Set appropriate buffer from current price
Always set stop losses for positions
Use position sizing appropriate for your risk tolerance
Monitor order status and market conditions