Skip to main content

Create Market order

Private resource

The WebSocket connection being used must be pre-authorized with authorization request.

HTTP API

This operation can be performed with request to HTTP API.

The request creates a market order with the parameters defined in the message body for the specified portfolio.


Request

To create an order, send a message to the established WebSocket connection with the operation code create:market containing the details of this order.

{
"opcode": "create:market",
"guid": "c328fcf1-e495-408a-a0ed-e20f95d6b813",
"side": "buy",
"quantity": 300,
"instrument": {
"symbol": "SBER",
"exchange": "MOEX"
},
"comment": "First order",
"board": "TQBR",
"user": {
"portfolio": "D39004"
},
"timeInForce": "oneday",
"checkDuplicates": true
}

Responses

According to the results of processing the received request, the server will return a message with the corresponding code to the WebSocket connection.

Successful request processing report

{
"requestGuid": "c328fcf1-e495-408a-a0ed-e20f95d6b813",
"httpCode": 200,
"message": "An order '12345' has been created.",
"orderNumber": "12345"
}