Submit Order
Submit a new trade order.
Endpoint
POST /api/v3/tradeOrder/submit
Description
Submits a new trade order to an exchange. Supports market, limit, and stop orders with various time-in-force options.
Authentication
Requires Bearer token authentication.
Authorization: Bearer {access_token}
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
tradingAccountId | string | Yes | Trading account to use |
instrumentId | string | Yes | Instrument to trade (e.g., BINANCE:BTC/USDT) |
orderSide | string | Yes | Order side (BUY, SELL) |
orderType | string | Yes | Order type (see below) |
quantity | string | Yes | Order quantity |
limitPrice | string | No* | Limit price (required for LIMIT orders) |
stopPrice | string | No* | Stop price (required for STOP orders) |
timeInForce | string | No | Time in force (default: GTC) |
orderQuantityType | string | No | Quantity type (BASE, QUOTE) |
quantityRounding | string | No | Rounding mode (DOWN, UP, NEAREST) |
*Required depending on order type.
Order Types
| Type | Description | Required Fields |
|---|---|---|
MARKET | Execute at market price | quantity |
LIMIT | Execute at limit price or better | quantity, limitPrice |
STOP_MARKET | Market order triggered at stop price | quantity, stopPrice |
STOP_LIMIT | Limit order triggered at stop price | quantity, limitPrice, stopPrice |
Time In Force Options
| Option | Description |
|---|---|
GTC | Good till cancelled |
IOC | Immediate or cancel |
FOK | Fill or kill |
Response
Returns the submitted trade order object.
| Field | Type | Description |
|---|---|---|
tradeOrderId | string | Unique order identifier |
tradingAccountId | string | Trading account ID |
venue | string | Exchange venue |
instrumentId | string | Instrument identifier |
orderSide | string | Order side |
orderType | string | Order type |
status | string | Order status (PENDING, OPEN, etc.) |
quantity | string | Order quantity |
limitPrice | string | Limit price (if applicable) |
executedQuantity | string | Quantity filled |
executedCost | string | Total execution cost |
createdAt | integer | Creation timestamp (milliseconds) |
Usage
import requests
headers = {"Authorization": f"Bearer {access_token}"}
# Market buy order
response = requests.post(
"https://cadenza-api-uat.algo724.com/api/v3/tradeOrder/submit",
headers=headers,
json={
"tradingAccountId": "550e8400-e29b-41d4-a716-446655440000",
"instrumentId": "BINANCE:BTC/USDT",
"orderSide": "BUY",
"orderType": "MARKET",
"quantity": "0.001"
}
)
order = response.json()["data"]
print(f"Order ID: {order['tradeOrderId']}")
# Limit sell order
response = requests.post(
"https://cadenza-api-uat.algo724.com/api/v3/tradeOrder/submit",
headers=headers,
json={
"tradingAccountId": "550e8400-e29b-41d4-a716-446655440000",
"instrumentId": "BINANCE:BTC/USDT",
"orderSide": "SELL",
"orderType": "LIMIT",
"quantity": "0.001",
"limitPrice": "55000.00",
"timeInForce": "GTC"
}
)
curl -X POST https://cadenza-api-uat.algo724.com/api/v3/tradeOrder/submit \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \
-H "Content-Type: application/json" \
-d '{
"tradingAccountId": "550e8400-e29b-41d4-a716-446655440000",
"instrumentId": "BINANCE:BTC/USDT",
"orderSide": "BUY",
"orderType": "LIMIT",
"quantity": "0.001",
"limitPrice": "50000.00"
}'
Example Response
{
"data": {
"tradeOrderId": "770e8400-e29b-41d4-a716-446655440002",
"tradingAccountId": "550e8400-e29b-41d4-a716-446655440000",
"venue": "BINANCE",
"instrumentId": "BINANCE:BTC/USDT",
"baseAsset": "BTC",
"quoteAsset": "USDT",
"orderSide": "BUY",
"orderType": "LIMIT",
"timeInForce": "GTC",
"status": "PENDING",
"limitPrice": "50000.00",
"quantity": "0.001",
"executedQuantity": "0",
"executedCost": "0",
"createdAt": 1703052635110,
"updatedAt": 1703052635110
},
"success": true,
"errno": 0,
"error": null
}
Error Responses
| HTTP Code | Error | Description |
|---|---|---|
| 400 | Invalid request | Invalid order parameters |
| 401 | Unauthorized | Invalid or expired access token |
| 403 | Forbidden | Trading account not authorized |
| 404 | Not found | Trading account or instrument not found |
Example Error
{
"data": null,
"success": false,
"errno": -111000,
"error": "Insufficient balance"
}
Notes
- Quantity precision must match instrument specifications (use
market.instrument.listto check) - Use the WebSocket API to subscribe to the trading account channel for real-time order updates
- Market orders execute immediately at the best available price
- Limit orders remain open until filled, cancelled, or expired