Skip to main content
POST
/
api
/
v1
/
orders
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"
  }'
{
  "data": {
    "orderId": "01234567-89ab-7def-8123-456789abcdea"
  },
  "error": false
}

Create Order

Place a new trading order with various order types and execution options.

Endpoint

POST /api/v1/orders

Parameters

X-API-Key
string
required
RSA public key identifier for authentication
X-API-Signature
string
required
Base64-encoded RSA signature of the request payload. Payload format: POST:/api/v1/orders:sorted_body_params

Request Body

symbol
string
required
Trading instrument symbol (e.g., “OIL-BTC”)
instType
string
required
Instrument type: “perpetual”
side
string
required
Order side: “buy” or “sell”
orderType
string
required
Order type: “market”, “limit”, “stop”, “stoplimit”
qty
string
required
Order quantity as decimal string
px
string
Order price as decimal string (required for limit and stoplimit orders)
triggerPx
string
Stop trigger price as decimal string (required for stop and stoplimit orders)
timeInForce
string
default:"gtc"
Time in force: “gtc” (Good Till Canceled), “ioc” (Immediate or Cancel), “gtd” (Good Till Date)
unit
string
default:"btc"
Price unit: “sats” or “btc”
cancelAt
integer
Cancel timestamp in milliseconds (for GTD orders)

Example Requests

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"
  }'

Response

{
  "data": {
    "orderId": "01234567-89ab-7def-8123-456789abcdea"
  },
  "error": false
}
data
object
Order creation response

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
I