WebSocket API

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: 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.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

bodyobjectrequired
idstringrequired

Client-generated identifier used to correlate the response.

methodstringrequired
paramsobjectrequired
batchRequestIdstringrequired

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.

batchRequestTimeintegerrequired

The time the client created the batch, in epoch milliseconds (UTC). Must be within 30 seconds of server time.

ordersarrayrequired

List of orders to place, up to 50. Each element has the same structure as the `params` of `order.place`.

orders[]objectrequired
symbolstringrequired

Trading symbol.

sidestringrequired

Order side. (B - Buy, S - Sell)

orderTypestringoptional

Order type. Defaults to `LO` when omitted.

accountNostringrequired

Trading account number.

pricestring | nulloptional

Order price. Required and must be > 0 when `orderType` is `LO`; optional for other order types.

quantitynumberrequired

Order quantity.

clientRequestIdstring | nulloptional

Client-generated order identifier, used to correlate the response and later event push. When omitted, the system auto-generates a `clientRequestId`.

deviceIdstringrequired

Identifier of the device submitting the order (MAC address or IMEI).

userAgentstring | nulloptional

Information about the browser/application sending the request.

isReturnOrderIdboolean | nulloptional

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.

signaturestringrequired

RSA+SHA256 signature (base64) over the entire `params` content, using the API Key's SecretKey. Required.

timestampintegerrequired

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
  }
}