All portfolio trades
The request cannot be executed anonymously. The required token
parameter must contain an up-to-date Access Token.
This operation can be performed with request to HTTP API.
The request creates a subscription to receive information about all transactions made using the specified portfolio.
Request
To create a subscription to a data channel, send a message to the established WebSocket connection with a request body containing the details of the subscription to be created.
- Request body
- Schema
{
"opcode": "TradesGetAndSubscribeV2",
"portfolio": "D39004",
"skipHistory": false,
"exchange": "MOEX",
"instrumentGroup": "TQBR",
"format": "Simple",
"guid": "c328fcf1-e495-408a-a0ed-e20f95d6b813",
"token": "eyJhbGciOiJ..."
}
Request body parameters
OrderBookGetAndSubscribe
— Subscription to order bookBarsGetAndSubscribe
— Subscription to price history (candlesticks)QuotesSubscribe
— Subscription to quotesInstrumentsGetAndSubscribeV2
— Subscription to security information updates on the selected exchangeAllTradesGetAndSubscribe
— Subscribe to all tradesPositionsGetAndSubscribeV2
— Subscription to information about current positions on securities and moneySummariesGetAndSubscribeV2
— Subscription to portfolio summary informationRisksGetAndSubscribe
— Subscription to consolidated information on portfolio risksSpectraRisksGetAndSubscribe
— Subscription to information on derivatives market risks (FORTS)TradesGetAndSubscribeV2
— Subscription for information on tradesOrdersGetAndSubscribeV2
— Subscription to information about current orders on the market for the selected exchange and securityStopOrdersGetAndSubscribeV2
— Subscription to information about current conditional orders in the market for the selected exchange and securityunsubscribe
— Cancelation of previously created subscriptiontrue
— display only new datafalse
— display including historical dataworking
— Waiting for executionfilled
— Executedcanceled
— Canceledrejected
— RejectedMOEX
— Moscow ExchangeSPBX
— SPB Exchange- List of Moscow Exchange codes is available in table
- SPB Exchange securities always have
SPBX
code Simple
is the original data format. Supports legacy (deprecated) parameters to ensure backward compatibilitySlim
is the lightweight data format for fast messaging. Does not support legacy (deprecated) parametersHeavy
is the complete data format, evolving and augmented with new fields. Does not support legacy (deprecated) parameters
Operation code:
Client portfolio ID
Example: D39004
Flag for filtering out historical data:
Example: false
Optional filter by order statuses. Affects only the filtering of primary historical data at subscription. Possible values:
Example: filled
Exchange code:
Example: MOEX
Trading mode code (Board):
Example: TQBR
The format of the JSON object returned by the server:
Example: Simple
The unique identifier of the operation. All incoming messages related to this operation will have this guid
field value
Example: c328fcf1-e495-408a-a0ed-e20f95d6b813
Access Token
Example: eyJhbGciOiJ...
Responses
The content of the response returned to the WebSocket connection depends on the results of processing the request:
- If the request is processed successfully, the server will send one
200
code message in response, confirming that the subscription has been created, after which it will begin transmitting100
code messages containing the information requested as part of the subscription. - If the request processing failed, the server will send back one message with an error code corresponding to the reason for the failure, after which it will close the WebSocket connection.
- 100
- 200
- 401
Messages from the channel containing the requested information
- Simple
- Slim
- Heavy
- Response body
- Schema
{
"data": {
"id": "4421925358",
"orderno": "42030831469",
"comment": null,
"symbol": "GAZP",
"brokerSymbol": "MOEX:GAZP",
"exchange": "MOEX",
"date": "2023-12-29T12:35:06.0000000Z",
"board": "TQBR",
"qtyUnits": 10,
"qtyBatch": 1,
"qty": 1,
"price": 170.21,
"accruedInt": 0,
"side": "buy",
"existing": true,
"commission": 1.361050,
"repoSpecificFields": null,
"volume": 1702.10
},
"guid": "c328fcf1-e495-408a-a0ed-e20f95d6b813"
}
Response body parameters
MOEX
— Moscow ExchangeSPBX
— SPB Exchange- List of Moscow Exchange codes is available in table
- SPB Exchange securities always have
SPBX
code buy
sell
data
object
Requested data
Unique trade ID
Example: 4421925358
Order ID
Example: 0
Custom comment
Example: First order
Security code (ticker). [N/A]
if symbol
is not set
Example: SBER
Exchange-Ticker Pair
Example: MOEX:ALRS-3.24
Exchange code:
Example: MOEX
Date and time (UTC) of order closing.
Example: 2023-12-29T12:35:06.0000000Z
Trading mode code (Board):
Example: TQBR
Number of units
Example: 1
Number of lots
Example: 1
Quantity
Example: 5
Price
Example: 271.57
Accrued interest
Example: 0
Transaction side:
Example: sell
True
will return the response including data from snapshot, i.e. from history. False
will return only new events
Example: false
Total commission (null for derivatives)
Example: 1,36
repoSpecificFields
object
Special fields for repo trades
Repo price in percent per annum
Example: 23.45
Note field, used for providing information feedback to external systems. For example, the ID of the user of the external system that placed the request.
Example: MB0014100002
Repo term - the period of time, expressed in calendar days, between the dates of execution of the first and second parts of a repo transaction.
Example: 2
Trading account on behalf of which the transaction is concluded
Example: MB0014100002
Trade type description
Example: Swap settlement
Transaction volume represented in the settlement currency
Example: 46
Yield calculated at the transaction price
Example: null
Volume calculated at average price
Example: 1702.10
The unique identifier of the operation. All incoming messages related to this operation will have this guid
field value
Example: c328fcf1-e495-408a-a0ed-e20f95d6b813
- Response body
- Schema
{
"data": {
"id": "4421925358",
"eid": "42030831469",
"cmt": null,
"sym": "GAZP",
"tic": "MOEX:GAZP",
"ex": "MOEX",
"d": "2023-12-29T12:35:06.0000000Z",
"b": "TQBR",
"q": 10,
"qb": 1,
"px": 170.21,
"ai": 0,
"s": "buy",
"h": true,
"cms": 1.361050,
"r": null,
"v": 1702.10
},
"guid": "c328fcf1-e495-408a-a0ed-e20f95d6b813"
}
Response body parameters
MOEX
— Moscow ExchangeSPBX
— SPB Exchange- List of Moscow Exchange codes is available in table
- SPB Exchange securities always have
SPBX
code buy
sell
data
object
Requested data
Unique trade ID
Example: 4421925358
Order ID
Example: 0
Custom comment
Example: First order
Security code (ticker). [N/A]
if symbol
is not set
Example: SBER
Exchange-Ticker Pair
Example: MOEX:ALRS-3.24
Exchange code:
Example: MOEX
Date and time (UTC) of order closing.
Example: 2023-12-29T12:35:06.0000000Z
Trading mode code (Board):
Example: TQBR
Number of units
Example: 1
Number of lots
Example: 1
Price
Example: 271.57
Accrued interest
Example: 0
Transaction side:
Example: sell
True
will return the response including data from snapshot, i.e. from history. False
will return only new events
Example: false
Total commission (null for derivatives)
Example: 1,36
r
object
Special fields for repo trades
Repo price in percent per annum
Example: 23.45
Note field, used for providing information feedback to external systems. For example, the ID of the user of the external system that placed the request.
Example: MB0014100002
Repo term - the period of time, expressed in calendar days, between the dates of execution of the first and second parts of a repo transaction.
Example: 2
Trading account on behalf of which the transaction is concluded
Example: MB0014100002
Trade type description
Example: Swap settlement
Transaction volume represented in the settlement currency
Example: 46
Yield calculated at the transaction price
Example: null
Volume calculated at average price
Example: 1702.10
The unique identifier of the operation. All incoming messages related to this operation will have this guid
field value
Example: c328fcf1-e495-408a-a0ed-e20f95d6b813
- Response body
- Schema
{
"data": {
"id": "4421925358",
"orderNo": "42030831469",
"comment": null,
"symbol": "GAZP",
"brokerSymbol": "MOEX:GAZP",
"exchange": "MOEX",
"date": "2023-12-29T12:35:06.0000000Z",
"board": "TQBR",
"qtyUnits": 10,
"qtyBatch": 1,
"qty": 1,
"price": 170.21,
"accruedInt": 0,
"side": "buy",
"existing": true,
"commission": 1.361050,
"repoSpecificFields": null,
"volume": 1702.10,
"settleDate": "2024-12-31T23:59:59.9990000Z"
},
"guid": "c328fcf1-e495-408a-a0ed-e20f95d6b813"
}
Response body parameters
MOEX
— Moscow ExchangeSPBX
— SPB Exchange- List of Moscow Exchange codes is available in table
- SPB Exchange securities always have
SPBX
code buy
sell
data
object
Requested data
Unique trade ID
Example: 4421925358
Order ID
Example: 0
Custom comment
Example: First order
Security code (ticker). [N/A]
if symbol
is not set
Example: SBER
Exchange-Ticker Pair
Example: MOEX:ALRS-3.24
Exchange code:
Example: MOEX
Date and time (UTC) of order closing.
Example: 2023-12-29T12:35:06.0000000Z
Trading mode code (Board):
Example: TQBR
Number of units
Example: 1
Number of lots
Example: 1
Quantity
Example: 5
Price
Example: 271.57
Accrued interest
Example: 0
Transaction side:
Example: sell
True
will return the response including data from snapshot, i.e. from history. False
will return only new events
Example: false
Total commission (null for derivatives)
Example: 1,36
repoSpecificFields
object
Special fields for repo trades
Repo price in percent per annum
Example: 23.45
Note field, used for providing information feedback to external systems. For example, the ID of the user of the external system that placed the request.
Example: MB0014100002
Repo term - the period of time, expressed in calendar days, between the dates of execution of the first and second parts of a repo transaction.
Example: 2
Trading account on behalf of which the transaction is concluded
Example: MB0014100002
Trade type description
Example: Swap settlement
Transaction volume represented in the settlement currency
Example: 46
Yield calculated at the transaction price
Example: null
Volume calculated at average price
Example: 1702.10
UTC date of fulfillment of transaction obligations
Example: 2024-12-31T23:59:59.9990000Z
The unique identifier of the operation. All incoming messages related to this operation will have this guid
field value
Example: c328fcf1-e495-408a-a0ed-e20f95d6b813
Successful request processing report
- Body
- Schema
{
"message": "Handled successfully",
"httpCode": 200,
"requestGuid": "c328fcf1-e495-408a-a0ed-e20f95d6b813"
}
Response body parameters
Text description of the returned HTTP code
Example: Handled successfully
HTTP message code
Example: 200
The unique identifier of the operation. All incoming messages related to this operation will have this guid
field value
Example: c328fcf1-e495-408a-a0ed-e20f95d6b813
Failed to process request. Access token is invalid, not specified in the message or belongs to other system environment
- Body
- Schema
{
"requestGuid": "c328fcf1-e495-408a-a0ed-e20f95d6b813",
"httpCode": 401,
"message": "Invalid JWT token!"
}
Response body parameters
The unique identifier of the operation. All incoming messages related to this operation will have this guid
field value
Example: c328fcf1-e495-408a-a0ed-e20f95d6b813
HTTP message code
Example: 401
Text description of the returned HTTP code
Example: Invalid JWT token!