Place a market order
place_market_orderOpens a position at market on the user's real broker account (or demo) and waits for the broker; confirm account, symbol, side and volume with the user first. On ORDER_UNRESOLVED never resend, poll get_order. Example: {"account_id": "", "symbol": "EURUSD", "side": "buy", "volume": "0.10", "idempotency_key": ""}
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| side | Yes | buy or sell. | |
| symbol | Yes | The symbol exactly as this broker names it, e.g. "EURUSD" — some brokers add a suffix such as "EURUSD.r". | |
| volume | Yes | Order size. In lots, preferably as a string: "0.01" is a micro lot, "1.00" a standard lot. | |
| comment | No | Optional note stored on the order. MT5 keeps the first 17 characters after our reference. | |
| stop_loss | No | Optional stop loss. Below entry for a buy, above for a sell. An absolute price (e.g. "1.08450"), not a distance in pips or points. | |
| account_id | Yes | The fxapis account id (a UUID) from list_accounts — not the MT5 login number. | |
| take_profit | No | Optional take profit. Above entry for a buy, below for a sell. An absolute price (e.g. "1.08450"), not a distance in pips or points. | |
| client_order_id | No | Optional reference of your own, echoed back on the order. | |
| idempotency_key | Yes | A unique string you generate for THIS action, e.g. a fresh UUID. If a call fails or times out and you retry the same action, send the SAME key: fxapis then returns the first result instead of acting twice. Use a new key only for a genuinely new action. | |
| deviation_points | No | Maximum slippage in points. Too small invites requotes. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| order | Yes |