Place an order (WebSocket)

Send PLACE_ORDER after login. The acknowledgement event is PLACE_ORDER_ACK.

Arguments

FieldTypeRequiredDescription
brokerClientIdstringYesAccount ID identifying the client account for the request.
exchangeCodestringYesMarket. Values: US.
productCodestringYesSecurity code, for example AAPL.
bsFlagstringYesB = buy; S = sell. Values: B, S.
orderTypestringYesL = limit; M = market. Values: L, M.
pricestringYesRequired. Send "0" for market orders (orderType=M).
qtyintegerYesOrder quantity.
orderValiditystringNo / conditionalTime in force. Values: Day, FAK, FOK, GTD, GTC. Default: Day.
orderExpiryDatestringNo / conditionalRequired for GTD. Format YYYY-MM-DD.
referencestringNo / conditionalCaller-supplied order reference. The server generates a UUID if omitted.
conditionCodestringNo / conditionalOmit or leave empty to send immediately. Conditional order type. Values: UT, DT, SL, OCO, TIME, HOLD, ``.
triggerPricestringNo / conditionalRequired for UT, DT, SL and OCO.
stopPricestringNo / conditionalRequired for OCO.
timeToSendstringNo / conditionalRequired for TIME. Format yyyy-MM-dd HH:mm:ss.
extendedTradingbooleanNo / conditionalWhether to allow pre-market and after-hours trading. Default: False.

Request

{
  "action": "PLACE_ORDER",
  "id": "req-002",
  "args": {
    "brokerClientId": "julioclient001",
    "exchangeCode": "US",
    "productCode": "AAPL",
    "bsFlag": "B",
    "orderType": "L",
    "price": "182.50",
    "qty": 100,
    "orderValidity": "Day"
  }
}

Response

{
  "event": "PLACE_ORDER_ACK",
  "id": "req-002",
  "code": 0,
  "message": "success",
  "data": {
    "orderNo": "23818",
    "orderStatus": "NEW"
  }
}