DXtrade Push AccountPortfoliosCloseSubscriptionRequest
Closes a portfolio subscription, by the requestId of the request that opened it. The server confirms, and no more portfolio updates are sent for that subscription.
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.
Besides the common errors, the section lists error code 2, Entity not found, where the subscription does not exist or is already closed.
The message
- Name
- AccountPortfoliosCloseSubscriptionRequest
- 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 AccountPortfoliosCloseSubscriptionRequest. |
| 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. |
| refRequestIdrequired | String | The requestId of the subscription request to close. |
| 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. |
What arrives
AccountPortfoliosSubscriptionClosed: The confirmation that the subscription is closed.
| Name | Type | Description |
|---|---|---|
| typerequired | String | Always AccountPortfoliosSubscriptionClosed. |
| inReplyTorequired | String | The requestId of the AccountPortfoliosCloseSubscriptionRequest 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. |
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": "AccountPortfoliosCloseSubscriptionRequest",
"requestId": "2",
"refRequestId": "1",
"timestamp": "2026-10-12T09:05:00.000Z",
"session": "<the session token from the REST login, from your own environment>"
}