WebSocket API

order.amend

Sửa lệnh hiện có. Xác định lệnh cần sửa qua orderId HOẶC clientRequestId (bắt buộc truyền đúng một trong hai — truyền cả hai hoặc không truyền gì đều bị từ chối). Cùng luồng ack nhanh PD như order.place. Yêu cầu chữ ký signature.

Scope bắt buộc: tradingws:order:put.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

bodyobjectrequired
idstringrequired
methodstringrequired
paramsobjectrequired

Bắt buộc truyền đúng một trong hai trường `orderId`/`clientRequestId` để xác định lệnh cần sửa.

clientModifyIdstring | nulloptional

Định danh sửa lệnh do client tạo ra. Khi để trống, hệ thống tự sinh.

clientRequestIdstring | nulloptional

Định danh lệnh gốc do client tạo ra khi đặt lệnh. Dùng XOR với `orderId`.

orderIdstring | nulloptional

Định danh lệnh gốc sinh bởi hệ thống SSI. Dùng XOR với `clientRequestId`.

accountNostringrequired

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

symbolstring | nulloptional

Mã chứng khoán.

sidestring | nulloptional

Chiều mua/bán.

orderTypestring | nulloptional

Loại lệnh.

pricestring | nulloptional

Giá thay đổi của lệnh.

quantitynumber | nulloptional

Khối lượng thay đổi của lệnh.

deviceIdstringrequired

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

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-0002",
  "method": "order.amend",
  "params": {
    "orderId": "ORD123456",
    "accountNo": "0901351",
    "price": "46.00",
    "quantity": 500,
    "deviceId": "MAC-AABBCCDDEEFF"
  },
  "signature": "base64(RSA-SHA256(...))",
  "timestamp": 1755000001000
}'

Sample Response

{
  "id": "req-0002",
  "method": "order.amend",
  "status": 200,
  "result": {
    "clientRequestId": "req-0001",
    "orderId": "ORD123456",
    "orderStatus": "PD",
    "clientModifyId": "req-0002"
  },
  "rateLimit": {
    "limit": 50,
    "remaining": 46,
    "resetMs": 880
  }
}