A market, limit, stop or stop limit order on an MT5 demo account. Pending orders can be modified and cancelled. 202 means the order was accepted and queued. Your risk rules run on your server next to the terminal, so follow the order timeline for the result. Sending the same client_order_id again returns the original order instead of placing a second one.
MetaTrader 5Demo accounts only
Headers
Authorizationrequired
Bearer per-terminal API token scoped to this account or route. Tokens expire after 90 days by default.
Idempotency-Key
Optional. When sent, must equal client_order_id.
Body
client_order_idrequired
string
Your id for the order. Makes retries safe.
symbolrequired
string
The broker’s symbol, for example EURUSD.
siderequired
buy | sell
Direction of the order.
volumerequired
decimal string
In the symbol’s volume unit; a multiple of its step.
type
market | limit | stop | stop_limit
Default market. Only types listed in the symbol’s order_types.
price
price
Required for limit and stop, and the trigger of a stop_limit. A multiple of the tick size, on the right side of the market.
stop_limit_price
price
The limit of a stop_limit order, placed once the trigger is reached.
For gtd: when the order expires, at least 60 seconds ahead.
good_until_date
date
For gtd_day: the trade server date at whose end the order expires.
stop_loss
price
Accepted on limit, stop and stop limit orders. Refused on MT5 market orders with stops_not_supported.
take_profit
price
As stop loss: accepted on pending orders, refused on MT5 market orders.
route_id
string
Place it through this route. A route token sets it.
expires_in_ms
integer
Not sent after this long. Default 10000.
Responses
202Queued. Follow the order timeline for the result.
200Replay of the same client_order_id. Nothing new was placed.
422Refused by a check, for example a live (non-demo) account. Never sent.
429Rate limited.
Time in force
gtc
Rests until filled or cancelled. The default when no expiry is given.
day
Expires at the end of the trade server’s day.
gtd
Expires at good_until.
gtd_day
Expires at the end of good_until_date on the trade server.
The symbol’s time_in_force list must include it. day, gtd and gtd_day need the trade server’s time from the terminal, otherwise the order is refused with broker_time_unknown. The broker removes an expired order; it then ends cancelled with cancel_reasonbroker_expired.
Both work on a placed limit, stop or stop_limit order. Each is an order of its own with its own client_order_id, and ends done once the broker shows the change. A modify changes price, stop_loss, take_profit, good_until, stop_limit_price (before the trigger) or time_in_force. A field left out keeps its value and null removes a stop. There is no volume: cancel and place a new order. A modify passes the same checks as a new position. A cancel counts as a close: it works during an emergency halt, with trading off and past the daily loss limit. Only orders PerkBridge placed can be changed, and a route token changes only its route’s orders.
Error codes
Every error is {“error”: {“code”, “message”, “request_id”}}. A refusal is 422 order_refused with order_id and refused_reason.code; it is stored and never sent. Accept codes you do not know.
DirectConnect is a planned, opt-in low-latency order path. Your program keeps a TLS WebSocket open, and orders go straight to the gateway on your server, with the same risk checks and demo accounts only. If a server is down you get an error with a request ID, or the order goes to a healthy standby. An early benchmark measured about 200 to 230 ms end to end on a broker demo server, mostly broker time; this is not a guarantee. It is designed and not built yet. The REST API on this page stays as it is.