WebSocket API

order.cancel

Cancel an existing order. Identify the order to cancel via orderId OR clientRequestId (exactly one must be supplied). Same fast-ack PD flow as order.place. Requires a signature.

Required scope: tradingws:order:delete.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

bodyobjectrequired
idstringrequired
methodstringrequired
paramsobjectrequired

Exactly one of `orderId`/`clientRequestId` must be supplied to identify the order to cancel.

clientCancelIdstring | nulloptional

Client-generated cancel identifier. Auto-generated by the system when omitted.

clientRequestIdstring | nulloptional

The original order's client-generated identifier from when it was placed. Used XOR with `orderId`.

orderIdstring | nulloptional

The original order's identifier generated by the SSI system. Used XOR with `clientRequestId`.

accountNostringrequired

Trading account number.

deviceIdstringrequired

Identifier of the device submitting the cancel request.

userAgentstring | nulloptional

Information about the browser/application sending the request.

signaturestringrequired

RSA+SHA256 signature (base64). Required.

timestampintegerrequired

Response Body

application/json

application/json

Sample Request

wscat -c wss://api.ssi.com.vn/ws/v3/trading -x '{
  "id": "req-0003",
  "method": "order.cancel",
  "params": {
    "orderId": "ORD123456",
    "accountNo": "0901351",
    "deviceId": "MAC-AABBCCDDEEFF"
  },
  "signature": "base64(RSA-SHA256(...))",
  "timestamp": 1755000002000
}'

Sample Response

{
  "id": "req-0003",
  "method": "order.cancel",
  "status": 200,
  "result": {
    "clientRequestId": "req-0001",
    "orderId": "ORD123456",
    "orderStatus": "PD",
    "clientCancelId": "req-0003"
  },
  "rateLimit": {
    "limit": 50,
    "remaining": 45,
    "resetMs": 860
  }
}

order.amendWS

Amend an existing order. Identify the order to amend via `orderId` OR `clientRequestId` (exactly one must be supplied — supplying both or neither is rejected). Same fast-ack `PD` flow as `order.place`. Requires a `signature`. Required scope: `tradingws:order:put`.

order.batchNewWS

Place multiple new orders in a single message (Batch Order). Each order in `params.orders` has the same structure and rules as `order.place`. **General rules** - Up to **50 orders** per batch. Orders may belong to different accounts, but every account must be in the list of accounts granted to the API Key. - Validation is **all-or-nothing**: if any order is invalid, the entire batch is rejected and no order is sent. - **Replay protection**: `batchRequestTime` (epoch milliseconds, UTC) must be within **30 seconds** of server time. - **Idempotency**: `batchRequestId` must be unique per API Key and per action (place/cancel) within a day; resending the same `batchRequestId` is rejected as a duplicate request. - The `signature` (RSA+SHA256) is computed over the **entire `params`**, i.e. `batchRequestId`, `batchRequestTime` and `orders`. **Response:** the system returns **a single ack** for the whole batch, in which every order has `orderStatus: "PD"` — this is not the match result yet. The real outcome of each order (filled/rejected/cancelled) is delivered separately through the `order.{accountNo}` notification channel (see "Place/amend/cancel orders: fast acknowledgment, result arrives later" at the top of this document), so clients **must subscribe** for the accounts involved. Unlike REST, the WebSocket ack does not contain `orderId` and does not indicate whether an individual order is later rejected during business processing. Required scope: `tradingws:order:post`.