WebSocket API

fco.place

Đặt lệnh điều kiện (Conditional Order) — response trả về ngay kết quả tạo lệnh, không theo luồng xác nhận nhanh như order.*. Nếu bị từ chối, response trả về lỗi kèm error.code: "FCO_ERROR". Yêu cầu chữ ký signature. Tham khảo thêm Tham khảo đặt lệnh điều kiện.

Scope bắt buộc: tradingws:fco:post.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

bodyobjectrequired
idstringrequired
methodstringrequired
paramsobjectrequired
symbolstringrequired

Mã chứng khoán cơ sở/phái sinh.

sidestringrequired

Chiều mua/bán.

typestring | nulloptional

Loại lệnh điều kiện. Tham khảo phụ lục Tham khảo đặt lệnh điều kiện.

pricestringrequired

Giá đặt lệnh điều kiện. Bắt buộc và phải > 0.

priceSlipnumber | nulloptional

Biên độ trượt giá cho phép.

quantityintegerrequired

Khối lượng đặt lệnh.

accountNostringrequired

Số tài khoản giao dịch.

fromstring | nulloptional

Thời gian hiệu lực bắt đầu, định dạng `yyyy/MM/dd HH:mm:ss`. Nếu có `to`, `from` phải <= `to`.

tostring | nulloptional

Thời gian hiệu lực kết thúc, định dạng `yyyy/MM/dd HH:mm:ss`.

stopPricenumber | nulloptional

Giá kích hoạt (stop price).

activePricenumber | nulloptional

Giá kích hoạt lệnh điều kiện.

trailingAmountnumber | nulloptional

Biên độ trailing stop.

tpActivePricenumber | nulloptional

Giá kích hoạt Take Profit.

slActivePricenumber | nulloptional

Giá kích hoạt Stop Loss.

tpPricestring | nulloptional

Giá chốt lời (Take Profit).

slPricestring | nulloptional

Giá cắt lỗ (Stop Loss).

tpSlipnumber | nulloptional

Biên độ trượt giá cho Take Profit.

slSlipnumber | nulloptional

Biên độ trượt giá cho Stop Loss.

operatorstring | nulloptional

Toán tử so sánh điều kiện kích hoạt.

codestring | nulloptional

Mã OTP xác thực giao dịch (bắt buộc nếu tài khoản có bật xác thực OTP).

deviceIdstringrequired

Định danh thiết bị gửi yêu cầu.

userAgentstring | nulloptional

Thông tin trình duyệt/ứng dụng gửi yêu cầu.

signaturestringrequired

Chữ ký RSA+SHA256 (base64). Bắt buộc.

timestampintegerrequired

Response Body

application/json

application/json

Sample Request

wscat -c wss://api.ssi.com.vn/ws/v3/trading -x '{
  "id": "req-0004",
  "method": "fco.place",
  "params": {
    "symbol": "SSI",
    "side": "B",
    "type": "TS",
    "price": "45.00",
    "quantity": 4000,
    "accountNo": "1231496",
    "deviceId": "MAC-AABBCCDDEEFF"
  },
  "signature": "base64(RSA-SHA256(...))",
  "timestamp": 1755000003000
}'

Sample Response

{
  "id": "req-0004",
  "method": "fco.place",
  "status": 200,
  "result": {
    "fcoId": "7528ac20-a340-4233-8bb7-a2379fc3c638"
  },
  "rateLimit": {
    "limit": 50,
    "remaining": 44,
    "resetMs": 840
  }
}