OpenPendingTrade¶
Opens a new pending trade order.
POST
https://{some_domain}/trade/open/pending
Authorization¶
All requests must include a JWT token:
Authorization: <JWT_TOKEN>
Request¶
Content-Type: application/json
Body Parameters¶
| Field | Type | Required | Description |
|---|---|---|---|
login |
int | Yes | User account login ID |
cmd |
int | Yes | Pending command type only: 2=BUY_LIMIT, 3=SELL_LIMIT, 4=BUY_STOP, 5=SELL_STOP |
volume |
int | Yes | Trade volume in minimal lots |
symbol |
string | Yes | Trading symbol |
open_price |
double | Yes | Pending activation price |
sl |
double | Yes | Stop Loss level (>= 0) |
tp |
double | Yes | Take Profit level (>= 0) |
expiration |
int64 | No | Expiration time (epoch timestamp) |
comment |
string | No | Custom user comment |
Response¶
Success (200)¶
The response is an acknowledgment that the pending trade request was accepted into runtime processing. It is not a final activation report.
Activation is asynchronous and handled later by the pending-order lifecycle.
Pending activation policy:
RET_TRADE_NO_MONEYleaves the order pending for a later retryRET_TRADE_MARKET_CLOSEDleaves the order pending for a later retry- terminal business/configuration errors move the order to
TS_CANCEL_REQUESTwithactivation = ACTIVATION_CANCEL - in terminal activation cancellation, the server appends the reason to
commentas[ACTIVATION_CANCEL: <reason>]
{
"accepted": true,
"order": 1001234,
"state": 1,
"login": 1001,
"symbol": "EURUSD",
"cmd": 2,
"volume": 100
}
Error Responses¶
| Code | Error | Description |
|---|---|---|
| 400 | INVALID_DATA |
Validation failed, missing or incorrect request fields |
| 401 | PERMISSION_DENIED |
Access denied |
| 403 | PERMISSION_DENIED |
Login does not match the authorized session |
| 409 | RET_TRADE_INCORRECT_CMD |
OpenPendingTrade accepts only pending commands |
Example¶
{
"login": 1001,
"cmd": 2,
"volume": 100,
"symbol": "EURUSD",
"open_price": 1.0850,
"sl": 1.0800,
"tp": 1.0950,
"expiration": 1760000000,
"comment": "pending entry"
}