Skip to main content
POST
/
api
/
v1
/
trading
/
place_order
Place Order
curl --request POST \
  --url https://api.example.com/api/v1/trading/place_order \
  --header 'Content-Type: application/json' \
  --data '
{
  "exchange": "<string>",
  "symbol": "<string>",
  "side": "<string>",
  "type": "<string>",
  "amount": "<string>",
  "price": "<string>"
}
'
{
  "status": "<string>",
  "data": {
    "order": {
      "order_id": "<string>",
      "position_id": "<string>",
      "exchange": "<string>",
      "symbol": "<string>",
      "side": "<string>",
      "type": "<string>",
      "amount": "<string>",
      "price": "<string>",
      "status": "<string>",
      "created_at": "<string>",
      "updated_at": "<string>"
    },
    "position": {
      "position_id": "<string>",
      "order_id": "<string>",
      "exchange": "<string>",
      "symbol": "<string>",
      "side": "<string>",
      "size": "<string>",
      "entry_price": "<string>",
      "status": "<string>",
      "opened_at": "<string>",
      "updated_at": "<string>"
    }
  }
}
Place a new trading order. The endpoint validates the request, performs risk checks, and creates both an order record and a corresponding position record in the database.
This endpoint executes real trades on live exchanges. Ensure you have validated your trading parameters and risk limits before placing orders.

Request Body

exchange
string
required
Exchange identifier (e.g., “binance”, “okx”)
symbol
string
required
Trading pair symbol (e.g., “BTC/USDT”, “ETH/USDT”)
side
string
required
Order side. Must be either:
  • BUY - Open a long position
  • SELL - Open a short position
type
string
default:"MARKET"
Order type. Supported values:
  • MARKET - Execute at current market price (default)
  • LIMIT - Execute at specified price or better
amount
string
required
Order amount as a decimal string. Must be greater than zero.Example: "0.5" for 0.5 units
price
string
Limit price as a decimal string. Required for LIMIT orders, ignored for MARKET orders. Must be greater than zero when specified.Example: "50000.00"

Response

status
string
Response status: "success" or "error"
data
object
Container for order and position data

Validation Errors

The endpoint returns 400 Bad Request for the following validation failures:
  • Invalid payload: Request body does not match expected schema
  • Amount validation: "amount must be greater than zero"
  • Side validation: "side must be BUY or SELL"
  • Type validation: "type must be MARKET or LIMIT"
  • Price validation: "price must be greater than zero for LIMIT orders"

Risk Checks

Before placing orders, ensure:
  • Exchange API keys are configured with appropriate permissions
  • Sufficient balance is available on the exchange
  • Order size complies with exchange minimum/maximum limits
  • Risk management parameters (daily loss cap, position size limits) are configured

Example Request

Market Order
curl -X POST https://api.neuratrade.com/api/v1/trading/place_order \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "exchange": "binance",
    "symbol": "BTC/USDT",
    "side": "BUY",
    "type": "MARKET",
    "amount": "0.01"
  }'
Limit Order
curl -X POST https://api.neuratrade.com/api/v1/trading/place_order \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "exchange": "binance",
    "symbol": "ETH/USDT",
    "side": "BUY",
    "type": "LIMIT",
    "amount": "0.5",
    "price": "3000.00"
  }'

Example Response

201 Created
{
  "status": "success",
  "data": {
    "order": {
      "order_id": "ord-20260303120000-1",
      "position_id": "pos-20260303120000-1",
      "exchange": "binance",
      "symbol": "BTC/USDT",
      "side": "BUY",
      "type": "MARKET",
      "amount": "0.01",
      "price": "0",
      "status": "OPEN",
      "created_at": "2026-03-03T12:00:00Z",
      "updated_at": "2026-03-03T12:00:00Z"
    },
    "position": {
      "position_id": "pos-20260303120000-1",
      "order_id": "ord-20260303120000-1",
      "exchange": "binance",
      "symbol": "BTC/USDT",
      "side": "BUY",
      "size": "0.01",
      "entry_price": "0",
      "status": "OPEN",
      "opened_at": "2026-03-03T12:00:00Z",
      "updated_at": "2026-03-03T12:00:00Z"
    }
  }
}
400 Validation Error
{
  "status": "error",
  "error": "amount must be greater than zero"
}

Build docs developers (and LLMs) love