Skip to main content

Overview

This channel streams realtime account-related data: orders, buying power, and portfolio — over Socket.IO. It is a separate channel from Priceboard (see Connecting to Priceboard) and requires a valid access token.
There are two distinct paths depending on product type — use the one matching the account you’re working with:
  • Stocks / underlying securities: eqt
  • Derivatives: fno

Connection details

Prerequisites

Before connecting, you need:
  1. access_token — obtained from the login API (auth/gen-secret-key/underlying). It must still be valid at the time you subscribe.
  2. sub_account_id (trading sub-account) — NOT your login username / custody code (e.g. 022Cxxxxxx). This is the actual trading sub-account number, formatted like 0301001425. Using the wrong value here causes FO20010 - Invalid sub-account errors elsewhere in the API, and prevents the realtime subscription from returning the correct account data.
Confusing the login/custody code with the trading sub-account (accountId) is the most common integration mistake for this channel. If unsure, obtain the exact accountId from the trading app or PHS operations team.

Connection steps

1

Log in to get an access_token

Call the auth API to obtain a valid token for the session.
2

Initialize the client

Connect to the matching host + path (eqt or fno), forcing the websocket transport.
3

Send the subscribe payload

After connect, emit a get event with a payload containing your sub_account_id and access_token.
4

Listen per channel

The server pushes data through separate events by business type — see the mapping table below.

Example code (Node.js / JavaScript — Underlying/EQT)

Channel mapping

Some older gateways may emit instrument, trade, account instead of OM/CI/SE. If you’re unsure which gateway version you’re on, register listeners for both naming sets for backward compatibility.

Response structure

Account data arrives wrapped in a common envelope. The EVENTTYPE field inside DT — not the outer Socket.IO event name — is what actually tells you whether this is OM, CI, or SE. Real example — a CI (Cash Info / buying power) event:

Common envelope (applies to every EVENTTYPE)

CI (Cash Info — Buying Power) fields

PPREF and BALDEFOVD are inferred from their abbreviated names and have not been officially confirmed by PHS. Verify against internal business documentation or the operations team before using them in calculations or customer-facing displays.
The DT field structure for OM (Order Management) and SE (Securities Equity) differs from CI and will be added once a corresponding real sample is available.

Troubleshooting

Next step

For realtime market data, see Connecting to Priceboard.