Skip to main content
POST
/
api
/
v1
/
trade
/
create
Create Order
curl --request POST \
  --url https://api.example.com/api/v1/trade/create \
  --header 'Content-Type: application/json' \
  --data '
{
  "symbol": "<string>",
  "type": "<string>",
  "quantity": 123,
  "leverage": 123,
  "slippage": 123,
  "takeProfit": 123,
  "stopLoss": 123
}
'
{
  "message": "Order created successfully",
  "orderId": "ord_1234567890abcdef"
}
Creates a new trading order for the authenticated user. The order is processed asynchronously through a Redis stream and responds within 3 seconds with the order creation result.

Authentication

This endpoint requires authentication via JWT token in the Authorization header.
Authorization: Bearer <your_jwt_token>

Request Body

symbol
string
required
The trading symbol (e.g., “BTCUSD”, “ETHUSD”, “EURUSD”)
type
string
required
The order type (e.g., “BUY”, “SELL”)
quantity
number
required
The quantity/volume to trade
leverage
number
required
The leverage multiplier for the trade (e.g., 1, 10, 50, 100)
slippage
number
Maximum allowed price slippage for the order execution
takeProfit
number
Take profit price level - order will automatically close when this price is reached
stopLoss
number
Stop loss price level - order will automatically close when this price is reached to limit losses

Response

message
string
Success message confirming the order creation
orderId
string
Unique identifier for the created order

Error Responses

error
string
Error message describing what went wrong

Status Codes

  • 200 - Order created successfully
  • 400 - Missing required parameters or invalid order data
  • 401 - Unauthorized - invalid or expired token
  • 408 - Request timeout - order creation took longer than 3 seconds
  • 500 - Internal server error

Examples

Create a Basic Buy Order

curl -X POST https://api.exness.com/api/v1/trade/create \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
  -H "Content-Type: application/json" \
  -d '{
    "symbol": "BTCUSD",
    "type": "BUY",
    "quantity": 0.5,
    "leverage": 10
  }'
{
  "message": "Order created successfully",
  "orderId": "ord_1234567890abcdef"
}

Create Order with Take Profit and Stop Loss

curl -X POST https://api.exness.com/api/v1/trade/create \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
  -H "Content-Type: application/json" \
  -d '{
    "symbol": "ETHUSD",
    "type": "SELL",
    "quantity": 2.0,
    "leverage": 20,
    "slippage": 0.5,
    "takeProfit": 1800.00,
    "stopLoss": 1950.00
  }'
{
  "message": "Order created successfully",
  "orderId": "ord_fedcba0987654321"
}

Error: Missing Required Parameters

curl -X POST https://api.exness.com/api/v1/trade/create \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
  -H "Content-Type: application/json" \
  -d '{
    "symbol": "BTCUSD",
    "quantity": 0.5
  }'
{
  "error": "Missing required parameters: symbol, type, quantity, leverage"
}

Error: Timeout

{
  "error": "Request timeout: No response received within 3 seconds",
  "message": "Order creation request timed out. The order may have been cancelled.",
  "timeout": true
}

Trading Workflow

  1. Authenticate - Obtain a JWT token via the authentication endpoint
  2. Create Order - Use this endpoint to open a new position
  3. Monitor Order - Use GET /api/v1/trade/orders to track open positions
  4. Close Order - Use POST /api/v1/trade/close when ready to close the position

Notes

  • Orders are processed asynchronously through a Redis stream
  • The endpoint will timeout after 3 seconds if no response is received
  • Optional parameters (slippage, takeProfit, stopLoss) are only included if valid numeric values are provided
  • Take profit and stop loss levels help automate risk management
  • The userId is automatically extracted from the JWT token

Build docs developers (and LLMs) love