Skip to content

Open Trade

Opens a new market order for the authenticated client account.

POST

https://{some_domain}/trade/open

Authorization

All requests must include a JWT token:

Authorization: <JWT_TOKEN>

The token is issued by /sign/in and must belong to the same login sent in the request body.

Request

Content-Type: application/json

Body Parameters

Field Type Required Description
login int Yes Account login. Must match the authenticated session
cmd int Yes Market command only: 0=BUY, 1=SELL
volume int Yes Trade volume in minimal lots
symbol string Yes Trading symbol
sl double Yes Stop Loss level
tp double Yes Take Profit level
open_price double No Optional requested open price
expiration int64 No Optional expiration timestamp
comment string No Optional trade comment

Response

Success (200)

The response is an acknowledgment that the trade request was accepted into runtime processing.

{
  "accepted": true,
  "order": 1001234,
  "state": 1,
  "login": 1001,
  "symbol": "EURUSD",
  "cmd": 0,
  "volume": 100
}

Error Responses

Code Error Description
400 INVALID_DATA Validation failed or required fields are missing
401 PERMISSION_DENIED Missing or invalid authenticated session
403 PERMISSION_DENIED login does not match the authenticated session
4xx/5xx RET_* Business/runtime validation error returned by trade checks

Compatibility Note

OpenTrade is market-only. Pending commands are rejected. Use POST /trade/open/pending for pending orders.