DXtrade Push AccountMetricsSubscriptionRequest
Subscribes to the metrics of chosen accounts, or of all, such as profit and loss and margin. Updates are sent periodically at a frequency set on the server, and less often for accounts with no trading activity.
Risk warning: CFDs and spread bets are complex instruments and come with a high risk of losing money rapidly due to leverage. You can lose money on these products, and each provider publishes its own loss figure under FCA rules. You should consider whether you understand how they work and whether you can afford to take the high risk of losing your money. Automated and API trading can amplify losses through bugs, connectivity failures and runaway orders.
This is a message of the DXtrade Push API, not an HTTP endpoint. It has no method and no path: it is sent as JSON or XML over an open WebSocket connection.
The specification says subscriptions with the request type ALL are rate limited for each user and subscription name, with a default of 1 a minute, and that passing the rate brings a Reject message with 429 Too Many Requests.
The message
- Name
- AccountMetricsSubscriptionRequest
- Direction
- Request, sent by the client
- Carried by
- WebSocket. Sent on the WebSocket resource for business events, the one used for every subscription except market data. The specification writes the address with a placeholder for the host, which each broker or firm that offers DXtrade supplies. Two optional query string arguments are set when connecting: format, XML or JSON, and compression, which can only be gzip.
Fields
| Name | Type | Description |
|---|---|---|
| typerequired | String | Always AccountMetricsSubscriptionRequest. |
| requestIdrequired | String | An id of your own for the request. The answer names it in inReplyTo. The specification says to keep ids unique within a session. |
| timestamprequired | Timestamp | When the message was sent, in UTC. |
| sessionrequired | String | The token of the session the message belongs to. It comes from the token login of the DXtrade REST API. |
| payloadrequired | Account metrics request | The accounts to subscribe to, with the fields below. |
| payload.requestTyperequired | String | ALL for every account, LIST for the accounts named. |
| payload.accounts | String | The account codes, separated by commas. Required where requestType is LIST. |
| payload.includePositions | Boolean | true adds metrics for each position and each currency to the updates. |
| payload.includeOffset | Boolean | true also processes offset accounts, where requestType is ALL. |
What arrives
AccountMetrics: The metrics of the accounts subscribed to. The fields of one account's metrics are defined in the specification and are not listed here.
| Name | Type | Description |
|---|---|---|
| typerequired | String | Always AccountMetrics. |
| inReplyTorequired | String | The requestId of the AccountMetricsSubscriptionRequest message it answers. |
| timestamprequired | Timestamp | When the message was sent, in UTC. |
| sessionrequired | String | The token of the session the message belongs to. It comes from the token login of the DXtrade REST API. |
| payload.metricsrequired | Account metrics | A list of account metrics. |
Sample
Written by this site from the fields recorded on this page. It has not been run against a terminal, a server or an account, and the values in it are placeholders. No credential is typed into it: where a field holds one, the placeholder says where it comes from. Nothing is entered on this site.
{
"type": "AccountMetricsSubscriptionRequest",
"requestId": "3",
"timestamp": "2026-10-12T09:00:00.000Z",
"session": "<the session token from the REST login, from your own environment>",
"payload": {
"requestType": "LIST",
"accounts": "default:demo1",
"includePositions": true
}
}