Skip to content

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>

Copy-follower manual trading policy

For authenticated user/customer requests, an enabled copy follower's manual_trading_mode is enforced after account/order ownership checks:

  • 0 rejects all manual trade writes with HTTP 403, COPY_MANUAL_TRADING_DISABLED (Manual trading is disabled for this copy follower).
  • 1 permits writes to non-copied orders and rejects changes to copied orders with HTTP 403, COPY_COPIED_ORDER_MANUAL_FORBIDDEN (Manual changes to copied orders are disabled for this copy follower).
  • 2 permits manual writes to copied and non-copied orders.
HTTP Error Message
403 COPY_MANUAL_TRADING_DISABLED Manual trading is disabled for this copy follower
403 COPY_COPIED_ORDER_MANUAL_FORBIDDEN Manual changes to copied orders are disabled for this copy follower

This applies to opens, modifications, closes, pending-order changes, and group operations. A group operation that matches a protected copied order is rejected before any order is changed. Staff and internal requests bypass this follower policy.

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_MONEY leaves the order pending for a later retry
  • RET_TRADE_MARKET_CLOSED leaves the order pending for a later retry
  • terminal business/configuration errors move the order to TS_CANCEL_REQUEST with activation = ACTIVATION_CANCEL
  • in terminal activation cancellation, the server appends the reason to comment as [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
503 LICENSE_NOT_ACTIVE A v2 runtime lease is required before this risk-increasing action is admitted

Example

{
  "login": 1001,
  "cmd": 2,
  "volume": 100,
  "symbol": "EURUSD",
  "open_price": 1.0850,
  "sl": 1.0800,
  "tp": 1.0950,
  "expiration": 1760000000,
  "comment": "pending entry"
}