WebSocket API

query.position

Lấy thông tin vị thế cho tài khoản. Tài khoản cổ phiếu trả về equity, tài khoản phái sinh trả về derivative. Không yêu cầu chữ ký.

Scope bắt buộc: tradingws:position:get.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

bodyobjectrequired
idstringrequired
methodstringrequired
paramsobjectrequired
accountNostringrequired

Tài khoản giao dịch cần lấy thông tin vị thế.

clientIdstring | nulloptional

Tài khoản 6 số định danh khách hàng tại SSI. Nếu số tài khoản là 003C123888 thì clientId = 123888.

querySummarybooleanoptional

Nếu true, trả về tóm tắt vị thế phái sinh. Nếu false, trả về chi tiết từng vị thế. Chỉ áp dụng cho tài khoản phái sinh.

timestampintegerrequired

Response Body

application/json

application/json

Sample Request

wscat -c wss://api.ssi.com.vn/ws/v3/trading -x '{
  "id": "req-0009",
  "method": "query.position",
  "params": {
    "accountNo": "0901351",
    "querySummary": true
  },
  "timestamp": 1755000008000
}'

Sample Response

{
  "id": "req-0009",
  "method": "query.position",
  "status": 200,
  "result": {
    "equity": [
      {
        "accountNo": "0901351",
        "symbol": "SSI",
        "quantity": "1000",
        "sellableQuantity": "1000"
      }
    ],
    "derivative": null
  },
  "rateLimit": {
    "limit": 100,
    "remaining": 96,
    "resetMs": 840
  }
}