WebSocket API

query.orderBook

Get order-book history by account and filters, paginated. No signature required.

Required scope: tradingws:orderBook:get.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

bodyobjectrequired
idstringrequired
methodstringrequired
paramsobjectrequired
accountNostringrequired

Trading account to fetch order-book history for.

fromstringrequired

Start time to filter order-book history, format `yyyy/MM/dd`.

tostringrequired

End time to filter order-book history, format `yyyy/MM/dd`. Must be >= `from`.

symbolstring | nulloptional

Trading symbol to filter by.

orderStatusstring | nulloptional

Order status to filter by. See the Order Status & Flow appendix.

pageSizeintegeroptional

Number of records per page.

pageIndexintegeroptional

Page index, starting from 1.

timestampintegerrequired

Response Body

application/json

application/json

Sample Request

wscat -c wss://api.ssi.com.vn/ws/v3/trading -x '{
  "id": "req-0013",
  "method": "query.orderBook",
  "params": {
    "accountNo": "0901351",
    "from": "2026/09/01",
    "to": "2026/09/10",
    "pageIndex": 1,
    "pageSize": 10
  },
  "timestamp": 1755000012000
}'

Sample Response

{
  "id": "req-0013",
  "method": "query.orderBook",
  "status": 200,
  "result": {
    "accountNo": "0901351",
    "totalRecord": 1,
    "orderList": [
      {
        "clientRequestId": "req-0001",
        "orderId": "ORD123456",
        "symbol": "SSI",
        "side": "B",
        "orderType": "LO",
        "quantity": "1000",
        "price": "45.50",
        "filledQty": "1000",
        "cancelQty": "0",
        "avgPrice": "45.48",
        "inputTime": "2026/09/09 09:15:32",
        "modifiedTime": "2026/09/09 09:16:01",
        "orderStatus": "FF",
        "message": ""
      }
    ]
  },
  "rateLimit": {
    "limit": 100,
    "remaining": 92,
    "resetMs": 760
  }
}

query.ppmmrAccountWS

Get an account's PP/MMR (Purchasing Power / Maintenance Margin Ratio) information. No signature required. Required scope: `tradingws:ppmmrAccount:get`.

subscribe/unsubscribeWS

Subscribe/unsubscribe to order/portfolio notifications on the same connection — **required** to receive the real final order status after `order.place`/`order.amend`/`order.cancel` has responded `PD` (see "Place/amend/cancel orders: fast acknowledgment, result arrives later" at the top of this document). This message requires no signature and carries no `id`. This API **only supports channel `TRADING`**, with 2 topic types: - `order.{accountNo}` — order match and partial-match notifications. - `portfolio.{accountNo}` — asset/portfolio change notifications, **derivative accounts only (suffix 8)**. Both notification types use the same `data` structure as channel `TRADING` on the FastConnect WebSocket API (market data) — see field details at [Sub/Unsub Trading Data](/en/docs/api-reference/subscribeUnsubscribeTradingData). **Note:** every topic must name a specific `accountNo` — **the `*` wildcard is not supported**, and that account must be owned by the API Key in use (you cannot subscribe to another customer's account data). **Subscribe sample:** ```json { "method": "SUBSCRIBE", "channel": "TRADING", "topics": ["order.0901351", "portfolio.1231996"] } ``` **Ack:** ```json { "method": "SUBSCRIBE", "channel": "TRADING", "status": "ok", "message": "Subscribed to 2 topic(s)" } ``` If `status: "error"`, `message` describes the reason (malformed topic syntax, missing permission, or an account not owned by the caller). **Sample notification** (`order.{accountNo}`): ```json { "channel": "TRADING", "topic": "order.0901351", "data": { "eventType": "orderEvent", "clientRequestId": "req-0001", "orderId": "ORD123456", "orderStatus": "FF", "...": "..." } } ```