order.batchNew
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:
batchRequestIdmust be unique per API Key and per action (place/cancel) within a day; resending the samebatchRequestIdis rejected as a duplicate request. - The
signature(RSA+SHA256) is computed over the entireparams, i.e.batchRequestId,batchRequestTimeandorders.
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.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Client-generated identifier used to correlate the response.
Batch identifier created by the client. Must be unique per API Key and per action (place/cancel) within a day. Used as the idempotency key.
The time the client created the batch, in epoch milliseconds (UTC). Must be within 30 seconds of server time.
List of orders to place, up to 50. Each element has the same structure as the `params` of `order.place`.
Trading symbol.
Order side. (B - Buy, S - Sell)
Order type. Defaults to `LO` when omitted.
Trading account number.
Order price. Required and must be > 0 when `orderType` is `LO`; optional for other order types.
Order quantity.
Client-generated order identifier, used to correlate the response and later event push. When omitted, the system auto-generates a `clientRequestId`.
Identifier of the device submitting the order (MAC address or IMEI).
Information about the browser/application sending the request.
Optional. Defaults by account type (equity `true`, derivatives `false`). The WebSocket `PD` ack never includes `orderId` regardless of this value — `orderId` arrives on the `order.{accountNo}` channel.
RSA+SHA256 signature (base64) over the entire `params` content, using the API Key's SecretKey. Required.
Unix timestamp (milliseconds) when the request is sent, used as input to the signature.
Response Body
application/json
application/json
Sample Request
wscat -c wss://api.ssi.com.vn/ws/v3/trading -x '{
"id": "req-0010",
"method": "order.batchNew",
"params": {
"batchRequestId": "batch-20261014-0001",
"batchRequestTime": 1755000010000,
"orders": [
{
"symbol": "SSI",
"side": "B",
"orderType": "LO",
"price": "45.50",
"quantity": 1000,
"accountNo": "0901351",
"clientRequestId": "o-0001",
"deviceId": "MAC-AABBCCDDEEFF"
},
{
"symbol": "VNM",
"side": "S",
"orderType": "LO",
"price": "62.10",
"quantity": 500,
"accountNo": "0901351",
"clientRequestId": "o-0002",
"deviceId": "MAC-AABBCCDDEEFF"
}
]
},
"signature": "base64(RSA-SHA256(...))",
"timestamp": 1755000010000
}'Sample Response
{
"id": "req-0010",
"method": "order.batchNew",
"status": 200,
"result": {
"batchRequestId": "batch-20261014-0001",
"results": [
{
"clientRequestId": "o-0001",
"orderStatus": "PD",
"success": true
},
{
"clientRequestId": "o-0002",
"orderStatus": "PD",
"success": true
}
]
},
"rateLimit": {
"limit": 50,
"remaining": 46,
"resetMs": 870
}
}order.cancelWS
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`.
order.batchCancelWS
Cancel multiple orders in a single message (Batch Order). Each order in `params.orders` has the same structure and rules as `order.cancel` (the order is identified by `orderId` OR `clientRequestId`). The same general rules and the same fast `PD` acknowledgment as `order.batchNew` apply (up to 50 orders, all-or-nothing validation, 30-second replay window, idempotency by `batchRequestId`, signature over the entire `params`). The real outcome of each cancel request arrives afterward through the `order.{accountNo}` notification channel. Required scope: `tradingws:order:delete`.