6.4. Đặt lệnh thường

POST/khronos/v1/order/place
Đặt lệnh thường trên thị trường phái sinh. Lệnh điều kiện dùng 6.5.

Header

TênKiểuBắt buộcMô tả
AuthorizationstringBearer <access token>.
Content-Typestringapplication/json.

Request Body

TênKiểuBắt buộcMô tả
accountIdstringSố tài khoản lưu ký.
subAccountIdstringSố tiểu khoản phái sinh.
sideenumB = mua, S = bán.
symbolstringMã phái sinh, ví dụ VN30F2103.
pricenumberGiá đặt (trong khoảng trần sàn).
volumeint64Số lượng.
orderTypestring0 = lệnh thường; SLP=1.0,0.8 = SL/TP; ABI=mã HĐTL = lệnh đối ứng.
refIdstringSố ngẫu nhiên duy nhất xác định kênh đặt lệnh (H.<số tự sinh>). Có thể dùng UUID cho trường hợp này.
POST /khronos/v1/order/place
curl -X POST https://openapi.tcbs.com.vn/khronos/v1/order/place \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"accountId":"105C031402","subAccountId":"105C031402A","side":"B","symbol":"VN30F2103","price":1198.7,"volume":10,"orderType":"0","refId":"H.OWsC4418qYN59HXcvGtD3z"}'

Response

TênKiểuBắt buộcMô tả
cmdstringLệnh gọi (echo).
rcstringMã kết quả, 1 = thành công.
rsstringThông báo lỗi (nếu có).
oIDstringID phiên đặt lệnh.
data[].orderNostringSố hiệu lệnh.
data[].pk_orderNostringKey lệnh.
data[].showPricestringGiá hiển thị.
{
  "cmd": "Web.placeOrder",
  "rc": "1",
  "rs": "",
  "oID": "H.OWsC4418qYN59HXcvGtD3z",
  "data": [
    {
      "orderNo": "1",
      "pk_orderNo": "7625400",
      "showPrice": "1198.7"
    }
  ]
}