Skip to main content

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

FieldTypeRequiredDescription
tradingAccountIdstringYesTrading account to use
instrumentIdstringYesInstrument to trade (e.g., BINANCE:BTC/USDT)
orderSidestringYesOrder side (BUY, SELL)
orderTypestringYesOrder type (see below)
quantitystringYesOrder quantity
limitPricestringNo*Limit price (required for LIMIT orders)
stopPricestringNo*Stop price (required for STOP orders)
timeInForcestringNoTime in force (default: GTC)
orderQuantityTypestringNoQuantity type (BASE, QUOTE)
quantityRoundingstringNoRounding mode (DOWN, UP, NEAREST)

*Required depending on order type.

Order Types

TypeDescriptionRequired Fields
MARKETExecute at market pricequantity
LIMITExecute at limit price or betterquantity, limitPrice
STOP_MARKETMarket order triggered at stop pricequantity, stopPrice
STOP_LIMITLimit order triggered at stop pricequantity, limitPrice, stopPrice

Time In Force Options

OptionDescription
GTCGood till cancelled
IOCImmediate or cancel
FOKFill or kill

Response

Returns the submitted trade order object.

FieldTypeDescription
tradeOrderIdstringUnique order identifier
tradingAccountIdstringTrading account ID
venuestringExchange venue
instrumentIdstringInstrument identifier
orderSidestringOrder side
orderTypestringOrder type
statusstringOrder status (PENDING, OPEN, etc.)
quantitystringOrder quantity
limitPricestringLimit price (if applicable)
executedQuantitystringQuantity filled
executedCoststringTotal execution cost
createdAtintegerCreation 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 CodeErrorDescription
400Invalid requestInvalid order parameters
401UnauthorizedInvalid or expired access token
403ForbiddenTrading account not authorized
404Not foundTrading 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.list to 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