Let AI agents trade and read MetaTrader 5 accounts. Hosted — no terminal for you to run.
Maintain this server? Claim it
Call this server's tools from your browser. Nothing to install.
Your fxapis API key as 'Bearer fx_live_…'. Create one at https://fxapis.com/dashboard/keys; a read-only or reduce-only key is recommended for agents.
Requests go through mcptry because browsers can't call most MCP servers directly. Header values are sent to the server for that request only and are never stored or logged.
Tool list from our last check. Connect live to refresh it.
Starts each account's MT5 terminal in the cloud and logs it in; poll get_account_status until `ready`. Places no trades and is safe to repeat. Example: {"account_ids": ["<id>"]}
One or more account ids.
This tool isn't marked read-only, so it may change something on the server or in an account you connected.
Starts each account's MT5 terminal in the cloud and logs it in; poll get_account_status until `ready`. Places no trades and is safe to repeat. Example: {"account_ids": ["<id>"]}
| Argument | Type | Description |
|---|---|---|
| account_ids* | array | One or more account ids. |
{
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"required": [
"account_ids"
],
"properties": {
"account_ids": {
"type": "array",
"items": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"description": "The fxapis account id (a UUID) from list_accounts — not the MT5 login number."
},
"maxItems": 200,
"minItems": 1,
"description": "One or more account ids."
}
}
}The margin an order would need, or its profit between two prices, as the broker computes it; opens nothing. The account must be online. Example: {"account_id": "<id>", "kind": "margin", "symbol": "EURUSD", "side": "buy", "volume": "0.10", "price": "1.08450"}
| Argument | Type | Description |
|---|---|---|
| kind* | string | margin: required to open. profit: result between price and close_price. |
| side* | string | buy or sell. |
| price* | any | Entry price. An absolute price (e.g. "1.08450"), not a distance in pips or points. |
| symbol* | string | The symbol exactly as this broker names it, e.g. "EURUSD" — some brokers add a suffix such as "EURUSD.r". |
| volume* | any | Order size. In lots, preferably as a string: "0.01" is a micro lot, "1.00" a standard lot. |
| account_id* | string | The fxapis account id (a UUID) from list_accounts — not the MT5 login number. |
| close_price | any | Exit price. Required when kind is profit. An absolute price (e.g. "1.08450"), not a distance in pips or points. |
| response_format | string | concise (default): what a next step needs. detailed: every field the API returns. |
{
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"required": [
"account_id",
"kind",
"symbol",
"side",
"volume",
"price"
],
"properties": {
"kind": {
"enum": [
"margin",
"profit"
],
"type": "string",
"description": "margin: required to open. profit: result between price and close_price."
},
"side": {
"enum": [
"buy",
"sell"
],
"type": "string",
"description": "buy or sell."
},
"price": {
"anyOf": [
{
"type": "string",
"pattern": "^\\d+(\\.\\d{1,8})?$"
},
{
"type": "number",
"minimum": 0
}
],
"description": "Entry price. An absolute price (e.g. \"1.08450\"), not a distance in pips or points."
},
"symbol": {
"type": "string",
"maxLength": 32,
"minLength": 1,
"description": "The symbol exactly as this broker names it, e.g. \"EURUSD\" — some brokers add a suffix such as \"EURUSD.r\"."
},
"volume": {
"anyOf": [
{
"type": "string",
"pattern": "^\\d+(\\.\\d{1,8})?$"
},
{
"type": "number",
"minimum": 0
}
],
"description": "Order size. In lots, preferably as a string: \"0.01\" is a micro lot, \"1.00\" a standard lot."
},
"account_id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"description": "The fxapis account id (a UUID) from list_accounts — not the MT5 login number."
},
"close_price": {
"anyOf": [
{
"type": "string",
"pattern": "^\\d+(\\.\\d{1,8})?$"
},
{
"type": "number",
"minimum": 0
}
],
"description": "Exit price. Required when kind is profit. An absolute price (e.g. \"1.08450\"), not a distance in pips or points."
},
"response_format": {
"enum": [
"concise",
"detailed"
],
"type": "string",
"description": "concise (default): what a next step needs. detailed: every field the API returns."
}
}
}Calls off a multi-account order on the user's real broker accounts (or demo) before anything is sent. Once orders went out, close the positions instead. Example: {"multi_account_order_id": "<id>", "idempotency_key": "<new uuid>"}
| Argument | Type | Description |
|---|---|---|
| idempotency_key* | string | 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. |
| multi_account_order_id* | string | The multi-account order id. |
{
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"required": [
"multi_account_order_id",
"idempotency_key"
],
"properties": {
"idempotency_key": {
"type": "string",
"maxLength": 200,
"minLength": 8,
"description": "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."
},
"multi_account_order_id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"description": "The multi-account order id."
}
}
}Cancels a pending order on the user's real broker account (or demo) that has not triggered. If it triggered there is a position to close instead. Example: {"order_id": "<id>", "idempotency_key": "<new uuid>"}
| Argument | Type | Description |
|---|---|---|
| order_id* | string | The fxapis id of the pending order. |
| idempotency_key* | string | 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. |
{
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"required": [
"order_id",
"idempotency_key"
],
"properties": {
"order_id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"description": "The fxapis id of the pending order."
},
"idempotency_key": {
"type": "string",
"maxLength": 200,
"minLength": 8,
"description": "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."
}
}
}Closes a position on the user's real broker account (or demo), whole or by volume. Sent twice it opens the opposite position, so reuse an idempotency_key only to retry the same close. Example: {"account_id": "<id>", "position_id": "<brokerPositionId>", "idempotency_key": "<new uuid>"}
| Argument | Type | Description |
|---|---|---|
| volume | any | Optional: how much to close. Omit to close the whole position. In lots, preferably as a string: "0.01" is a micro lot, "1.00" a standard lot. |
| comment | string | Optional note stored on the order. MT5 keeps the first 17 characters after our reference. |
| account_id* | string | The fxapis account id (a UUID) from list_accounts — not the MT5 login number. |
| position_id* | string | The position ticket: `brokerPositionId` from list_positions. |
| client_order_id | string | Optional reference of your own, echoed back on the order. |
| idempotency_key* | string | 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. |
One account: login, broker, state, environment, and its last-read balance, equity and free margin. Example: {"account_id": "<id from list_accounts>"}
| Argument | Type | Description |
|---|---|---|
| account_id* | string | The fxapis account id (a UUID) from list_accounts — not the MT5 login number. |
| response_format | string | concise (default): what a next step needs. detailed: every field the API returns. |
{
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"required": [
"account_id"
],
"properties": {
"account_id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"description": "The fxapis account id (a UUID) from list_accounts — not the MT5 login number."
},
"response_format": {
"enum": [
"concise",
"detailed"
],
"type": "string",
"description": "concise (default): what a next step needs. detailed: every field the API returns."
}
}
}Balance, equity, margin, free margin and margin level as decimal strings in the account currency, read every 15 s while online. Set fresh to ask the terminal now (the account must be `ready`). Example: {"account_id": "<id>", "fresh": true}
| Argument | Type | Description |
|---|---|---|
| fresh | boolean | True to ask the terminal now instead of using the last read. |
| account_id* | string | The fxapis account id (a UUID) from list_accounts — not the MT5 login number. |
| response_format | string | concise (default): what a next step needs. detailed: every field the API returns. |
{
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"required": [
"account_id"
],
"properties": {
"fresh": {
"type": "boolean",
"description": "True to ask the terminal now instead of using the last read."
},
"account_id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"description": "The fxapis account id (a UUID) from list_accounts — not the MT5 login number."
},
"response_format": {
"enum": [
"concise",
"detailed"
],
"type": "string",
"description": "concise (default): what a next step needs. detailed: every field the API returns."
}
}
}One account in one call: state, environment, balance and equity, and its largest open positions with their total P/L. Start here when asked how an account is doing. Example: {"account_id": "<id>"}
| Argument | Type | Description |
|---|---|---|
| top | integer | How many of the largest positions to list. Default 5. |
| account_id* | string | The fxapis account id (a UUID) from list_accounts — not the MT5 login number. |
| response_format | string | concise (default): what a next step needs. detailed: every field the API returns. |
{
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"required": [
"account_id"
],
"properties": {
"top": {
"type": "integer",
"maximum": 20,
"minimum": 1,
"description": "How many of the largest positions to list. Default 5."
},
"account_id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"description": "The fxapis account id (a UUID) from list_accounts — not the MT5 login number."
},
"response_format": {
"enum": [
"concise",
"detailed"
],
"type": "string",
"description": "concise (default): what a next step needs. detailed: every field the API returns."
}
}
}Just an account's state, cheap enough to poll every few seconds after bring_accounts_online until `ready`. States invalid_credentials, needs_2fa, needs_certificate and trading_disabled need the user, so stop polling. Example: {"account_id": "<id>"}
| Argument | Type | Description |
|---|---|---|
| account_id* | string | The fxapis account id (a UUID) from list_accounts — not the MT5 login number. |
| response_format | string | concise (default): what a next step needs. detailed: every field the API returns. |
{
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"required": [
"account_id"
],
"properties": {
"account_id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"description": "The fxapis account id (a UUID) from list_accounts — not the MT5 login number."
},
"response_format": {
"enum": [
"concise",
"detailed"
],
"type": "string",
"description": "concise (default): what a next step needs. detailed: every field the API returns."
}
}
}Whether a market is open now on this account's broker, and when it next opens or closes, in UTC. A broker holiday missing from its schedule still refuses orders. Example: {"account_id": "<id>", "instrument": "XAUUSD"}
| Argument | Type | Description |
|---|---|---|
| symbol | string | Or the broker's own symbol. |
| account_id* | string | The fxapis account id (a UUID) from list_accounts — not the MT5 login number. |
| instrument | string | An instrument from list_instruments, e.g. XAUUSD. |
| response_format | string | concise (default): what a next step needs. detailed: every field the API returns. |
{
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"required": [
"account_id"
],
"properties": {
"symbol": {
"type": "string",
"maxLength": 32,
"minLength": 1,
"description": "Or the broker's own symbol."
},
"account_id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"description": "The fxapis account id (a UUID) from list_accounts — not the MT5 login number."
},
"instrument": {
"type": "string",
"maxLength": 32,
"minLength": 1,
"description": "An instrument from list_instruments, e.g. XAUUSD."
},
"response_format": {
"enum": [
"concise",
"detailed"
],
"type": "string",
"description": "concise (default): what a next step needs. detailed: every field the API returns."
}
}
}One multi-account order and each account's result; poll it after placing one. An account left `unresolved` must not be resent, so poll its order instead. Example: {"multi_account_order_id": "<id>"}
| Argument | Type | Description |
|---|---|---|
| response_format | string | concise (default): what a next step needs. detailed: every field the API returns. |
| multi_account_order_id* | string | The id returned by place_multi_account_order. |
{
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"required": [
"multi_account_order_id"
],
"properties": {
"response_format": {
"enum": [
"concise",
"detailed"
],
"type": "string",
"description": "concise (default): what a next step needs. detailed: every field the API returns."
},
"multi_account_order_id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"description": "The id returned by place_multi_account_order."
}
}
}The authoritative record of one order: what was asked, the broker's answer, fill volume and price. Poll it after ORDER_UNRESOLVED until it leaves `unknown`. Example: {"order_id": "<id>", "include_deals": true}
| Argument | Type | Description |
|---|---|---|
| order_id* | string | The fxapis order id. |
| include_deals | boolean | Also return the deals this order produced. Needs history:read. |
| response_format | string | concise (default): what a next step needs. detailed: every field the API returns. |
{
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"required": [
"order_id"
],
"properties": {
"order_id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"description": "The fxapis order id."
},
"include_deals": {
"type": "boolean",
"description": "Also return the deals this order produced. Needs history:read."
},
"response_format": {
"enum": [
"concise",
"detailed"
],
"type": "string",
"description": "concise (default): what a next step needs. detailed: every field the API returns."
}
}
}Live bid and ask for up to 20 symbols or instruments from this account's broker; a closed market answers its last price with marketOpen false. The account must be online. Example: {"account_id": "<id>", "instruments": ["EURUSD"]}
| Argument | Type | Description |
|---|---|---|
| symbols | array | Broker symbols, exactly as this broker names them. |
| account_id* | string | The fxapis account id (a UUID) from list_accounts — not the MT5 login number. |
| instruments | array | Instruments; each is quoted as this account's own symbol for it. |
| response_format | string | concise (default): what a next step needs. detailed: every field the API returns. |
{
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"required": [
"account_id"
],
"properties": {
"symbols": {
"type": "array",
"items": {
"type": "string",
"maxLength": 32,
"minLength": 1,
"description": "The symbol exactly as this broker names it, e.g. \"EURUSD\" — some brokers add a suffix such as \"EURUSD.r\"."
},
"maxItems": 20,
"description": "Broker symbols, exactly as this broker names them."
},
"account_id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"description": "The fxapis account id (a UUID) from list_accounts — not the MT5 login number."
},
"instruments": {
"type": "array",
"items": {
"type": "string",
"maxLength": 32,
"minLength": 1
},
"maxItems": 20,
"description": "Instruments; each is quoted as this account's own symbol for it."
},
"response_format": {
"enum": [
"concise",
"detailed"
],
"type": "string",
"description": "concise (default): what a next step needs. detailed: every field the API returns."
}
}
}One symbol on one account in one call: its specification, live quote, whether the market is open, and the margin for a volume. Use it before proposing a trade. Example: {"account_id": "<id>", "instrument": "XAUUSD", "volume": "0.10", "side": "buy"}
| Argument | Type | Description |
|---|---|---|
| side | string | buy (default) or sell, for the margin. |
| symbol | string | The symbol exactly as this broker names it, e.g. "EURUSD" — some brokers add a suffix such as "EURUSD.r". |
| volume | any | Optional: the size to price the margin for. In lots, preferably as a string: "0.01" is a micro lot, "1.00" a standard lot. |
| account_id* | string | The fxapis account id (a UUID) from list_accounts — not the MT5 login number. |
| instrument | string | Instead of symbol: an instrument from list_instruments, e.g. XAUUSD. |
| response_format | string | concise (default): what a next step needs. detailed: every field the API returns. |
{
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"required": [
"account_id"
],
"properties": {
"side": {
"enum": [
"buy",
"sell"
],
"type": "string",
"description": "buy (default) or sell, for the margin."
},
"symbol": {
"type": "string",
"maxLength": 32,
"minLength": 1,
"description": "The symbol exactly as this broker names it, e.g. \"EURUSD\" — some brokers add a suffix such as \"EURUSD.r\"."
},
"volume": {
"anyOf": [
{
"type": "string",
"pattern": "^\\d+(\\.\\d{1,8})?$"
},
{
"type": "number",
"minimum": 0
}
],
"description": "Optional: the size to price the margin for. In lots, preferably as a string: \"0.01\" is a micro lot, \"1.00\" a standard lot."
},
"account_id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"description": "The fxapis account id (a UUID) from list_accounts — not the MT5 login number."
},
"instrument": {
"type": "string",
"maxLength": 32,
"minLength": 1,
"description": "Instead of symbol: an instrument from list_instruments, e.g. XAUUSD."
},
"response_format": {
"enum": [
"concise",
"detailed"
],
"type": "string",
"description": "concise (default): what a next step needs. detailed: every field the API returns."
}
}
}This month's usage against the plan, and its cost so far in minor units (9900 is $99.00). Over quota opening is refused, closing never is. Example: {}
| Argument | Type | Description |
|---|---|---|
| response_format | string | concise (default): what a next step needs. detailed: every field the API returns. |
{
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"response_format": {
"enum": [
"concise",
"detailed"
],
"type": "string",
"description": "concise (default): what a next step needs. detailed: every field the API returns."
}
}
}This connection's workspace: its plan, the plan's limits and features, and whether trading is switched off. Call it first when unsure what the user can do. Example: {}
| Argument | Type | Description |
|---|---|---|
| response_format | string | concise (default): what a next step needs. detailed: every field the API returns. |
{
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"response_format": {
"enum": [
"concise",
"detailed"
],
"type": "string",
"description": "concise (default): what a next step needs. detailed: every field the API returns."
}
}
}Each instrument's symbol on this account's broker: mapped, ambiguous (with candidates) or missing. Trade the mapped symbol. Example: {"account_id": "<id>", "query": "XAU"}
| Argument | Type | Description |
|---|---|---|
| limit | integer | Items per page, 1–100. Default 25. |
| query | string | Only instruments or symbols containing this, e.g. XAU. |
| cursor | string | next_cursor from the previous page. |
| account_id* | string | The fxapis account id (a UUID) from list_accounts — not the MT5 login number. |
| response_format | string | concise (default): what a next step needs. detailed: every field the API returns. |
{
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"required": [
"account_id"
],
"properties": {
"limit": {
"type": "integer",
"maximum": 100,
"minimum": 1,
"description": "Items per page, 1–100. Default 25."
},
"query": {
"type": "string",
"maxLength": 32,
"minLength": 1,
"description": "Only instruments or symbols containing this, e.g. XAU."
},
"cursor": {
"type": "string",
"maxLength": 200,
"description": "next_cursor from the previous page."
},
"account_id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"description": "The fxapis account id (a UUID) from list_accounts — not the MT5 login number."
},
"response_format": {
"enum": [
"concise",
"detailed"
],
"type": "string",
"description": "concise (default): what a next step needs. detailed: every field the API returns."
}
}
}The workspace's MT5 accounts with id, login, server, state and environment (demo or live); use the id, not the login, everywhere else. Only `ready` accounts trade, so bring the others online first. Example: {"limit": 25}
| Argument | Type | Description |
|---|---|---|
| limit | integer | Items per page, 1–100. Default 25. |
| cursor | string | next_cursor from the previous page. |
| response_format | string | concise (default): what a next step needs. detailed: every field the API returns. |
{
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"limit": {
"type": "integer",
"maximum": 100,
"minimum": 1,
"description": "Items per page, 1–100. Default 25."
},
"cursor": {
"type": "string",
"maxLength": 200,
"description": "next_cursor from the previous page."
},
"response_format": {
"enum": [
"concise",
"detailed"
],
"type": "string",
"description": "concise (default): what a next step needs. detailed: every field the API returns."
}
}
}An account's deal history as the broker recorded it, newest first, including stops that fired, swaps and manual trades. Realised profit is here. Example: {"account_id": "<id>", "since": "2026-10-01T00:00:00Z"}
| Argument | Type | Description |
|---|---|---|
| limit | integer | Rows per page, 1–200. Default 25. |
| since | string | ISO 8601 date-time; only rows at or after it. |
| until | string | ISO 8601 date-time; only rows at or before it. |
| cursor | string | `nextCursor` from the previous page. |
| symbol | string | The symbol exactly as this broker names it, e.g. "EURUSD" — some brokers add a suffix such as "EURUSD.r". |
| account_id* | string | The fxapis account id (a UUID) from list_accounts — not the MT5 login number. |
| response_format | string | concise (default): what a next step needs. detailed: every field the API returns. |
{
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"required": [
"account_id"
],
"properties": {
"limit": {
"type": "integer",
"maximum": 200,
"minimum": 1,
"description": "Rows per page, 1–200. Default 25."
},
"since": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
"description": "ISO 8601 date-time; only rows at or after it."
},
"until": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
"description": "ISO 8601 date-time; only rows at or before it."
},
"cursor": {
"type": "string",
"description": "`nextCursor` from the previous page."
},
"symbol": {
"type": "string",
"maxLength": 32,
"minLength": 1,
"description": "The symbol exactly as this broker names it, e.g. \"EURUSD\" — some brokers add a suffix such as \"EURUSD.r\"."
},
"account_id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"description": "The fxapis account id (a UUID) from list_accounts — not the MT5 login number."
},
"response_format": {
"enum": [
"concise",
"detailed"
],
"type": "string",
"description": "concise (default): what a next step needs. detailed: every field the API returns."
}
}
}Markets named once (XAUUSD, US30, BTCUSD) whatever each broker calls them. list_account_instruments gives one account's own symbol for each. Example: {"category": "metals"}
| Argument | Type | Description |
|---|---|---|
| category | string | Only this category. |
| response_format | string | concise (default): what a next step needs. detailed: every field the API returns. |
{
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"category": {
"enum": [
"forex",
"metals",
"indices",
"energies",
"crypto"
],
"type": "string",
"description": "Only this category."
},
"response_format": {
"enum": [
"concise",
"detailed"
],
"type": "string",
"description": "concise (default): what a next step needs. detailed: every field the API returns."
}
}
}Recent multi-account orders (one trade on many accounts), each with its per-account result. Pages with limit and cursor. Example: {}
| Argument | Type | Description |
|---|---|---|
| limit | integer | Items per page, 1–100. Default 25. |
| cursor | string | next_cursor from the previous page. |
| response_format | string | concise (default): what a next step needs. detailed: every field the API returns. |
{
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"limit": {
"type": "integer",
"maximum": 100,
"minimum": 1,
"description": "Items per page, 1–100. Default 25."
},
"cursor": {
"type": "string",
"maxLength": 200,
"description": "next_cursor from the previous page."
},
"response_format": {
"enum": [
"concise",
"detailed"
],
"type": "string",
"description": "concise (default): what a next step needs. detailed: every field the API returns."
}
}
}Orders placed through fxapis, newest first, for one account or all; state `unknown` means still being confirmed, so never resend those. Pages with cursor. Example: {"state": "unknown"}
| Argument | Type | Description |
|---|---|---|
| limit | integer | Rows per page, 1–200. Default 25. |
| since | string | ISO 8601 date-time; only rows at or after it. |
| state | string | Only orders in this state. |
| until | string | ISO 8601 date-time; only rows at or before it. |
| cursor | string | `nextCursor` from the previous page. |
| symbol | string | The symbol exactly as this broker names it, e.g. "EURUSD" — some brokers add a suffix such as "EURUSD.r". |
| account_id | string | The fxapis account id (a UUID) from list_accounts — not the MT5 login number. |
| response_format | string | concise (default): what a next step needs. detailed: every field the API returns. |
Open positions on one account as last observed; brokerPositionId is what close_position and modify_position take. Pages with limit and cursor. Example: {"account_id": "<id>"}
| Argument | Type | Description |
|---|---|---|
| limit | integer | Items per page, 1–100. Default 25. |
| cursor | string | next_cursor from the previous page. |
| account_id* | string | The fxapis account id (a UUID) from list_accounts — not the MT5 login number. |
| include_closed | boolean | Also return positions that have closed. Default false. |
| response_format | string | concise (default): what a next step needs. detailed: every field the API returns. |
{
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"required": [
"account_id"
],
"properties": {
"limit": {
"type": "integer",
"maximum": 100,
"minimum": 1,
"description": "Items per page, 1–100. Default 25."
},
"cursor": {
"type": "string",
"maxLength": 200,
"description": "next_cursor from the previous page."
},
"account_id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"description": "The fxapis account id (a UUID) from list_accounts — not the MT5 login number."
},
"include_closed": {
"type": "boolean",
"description": "Also return positions that have closed. Default false."
},
"response_format": {
"enum": [
"concise",
"detailed"
],
"type": "string",
"description": "concise (default): what a next step needs. detailed: every field the API returns."
}
}
}Moves a position's stop loss or take profit on the user's real broker account (or demo); null removes a level. Remove a stop loss only when the user asks. Example: {"account_id": "<id>", "position_id": "<brokerPositionId>", "stop_loss": "1.08000", "idempotency_key": "<new uuid>"}
| Argument | Type | Description |
|---|---|---|
| stop_loss | any | |
| account_id* | string | The fxapis account id (a UUID) from list_accounts — not the MT5 login number. |
| position_id* | string | The position ticket: `brokerPositionId` from list_positions. |
| take_profit | any | |
| idempotency_key* | string | 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. |
{
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"required": [
"account_id",
"position_id",
"idempotency_key"
],
"properties": {
"stop_loss": {
"anyOf": [
{
"anyOf": [
{
"type": "string",
"pattern": "^\\d+(\\.\\d{1,8})?$"
},
{
"type": "number",
"minimum": 0
}
],
"description": "New stop loss; null removes it. An absolute price (e.g. \"1.08450\"), not a distance in pips or points."
},
{
"type": "null"
}
]
},
"account_id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"description": "The fxapis account id (a UUID) from list_accounts — not the MT5 login number."
},
"position_id": {
"type": "string",
"maxLength": 40,
"minLength": 1,
"description": "The position ticket: `brokerPositionId` from list_positions."
},
"take_profit": {
"anyOf": [
{
"anyOf": [
{
"type": "string",
"pattern": "^\\d+(\\.\\d{1,8})?$"
},
{
"type": "number",
"minimum": 0
}
],
"description": "New take profit; null removes it. An absolute price (e.g. \"1.08450\"), not a distance in pips or points."
},
{
"type": "null"
}
]
},
"idempotency_key": {
"type": "string",
"maxLength": 200,
"minLength": 8,
"description": "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."
}
}
}Opens 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": "<id>", "symbol": "EURUSD", "side": "buy", "volume": "0.10", "idempotency_key": "<new uuid>"}
| Argument | Type | Description |
|---|---|---|
| side* | string | buy or sell. |
| symbol* | string | The symbol exactly as this broker names it, e.g. "EURUSD" — some brokers add a suffix such as "EURUSD.r". |
| volume* | any | Order size. In lots, preferably as a string: "0.01" is a micro lot, "1.00" a standard lot. |
| comment | string | Optional note stored on the order. MT5 keeps the first 17 characters after our reference. |
| stop_loss | any | 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* | string | The fxapis account id (a UUID) from list_accounts — not the MT5 login number. |
| take_profit | any |
Places the same market order on many of the user's real broker accounts (or demo) at once and returns at once; follow it with get_multi_account_order. Confirm the accounts, symbol, side and volume with the user first. Example: {"account_ids": ["<id>", "<id>"], "instrument": "XAUUSD", "side": "buy", "volume": "0.01", "idempotency_key": "<new uuid>"}
| Argument | Type | Description |
|---|---|---|
| side* | string | buy or sell. |
| label | string | A name for this multi-account order. |
| symbol | string | The symbol exactly as this broker names it, e.g. "EURUSD" — some brokers add a suffix such as "EURUSD.r". |
| volume* | any | Size per account, unless weights overrides it for an account. In lots, preferably as a string: "0.01" is a micro lot, "1.00" a standard lot. |
| comment | string | Optional note stored on the order. MT5 keeps the first 17 characters after our reference. |
| weights | object | Optional per-account size, keyed by account id, e.g. {"<account id>": "0.05"}. |
| stop_loss | any | Optional stop loss for every account. An absolute price (e.g. "1.08450"), not a distance in pips or points. |
Places a limit or stop order on the user's real broker account (or demo) that waits at the broker; success means working, not filled. Confirm it with the user first. Example: {"account_id": "<id>", "symbol": "EURUSD", "side": "buy", "kind": "limit", "volume": "0.10", "price": "1.08000", "idempotency_key": "<new uuid>"}
| Argument | Type | Description |
|---|---|---|
| kind* | string | limit, stop or stop_limit. |
| side* | string | buy or sell. |
| price* | any | The price the order waits at. An absolute price (e.g. "1.08450"), not a distance in pips or points. |
| symbol* | string | The symbol exactly as this broker names it, e.g. "EURUSD" — some brokers add a suffix such as "EURUSD.r". |
| volume* | any | Order size. In lots, preferably as a string: "0.01" is a micro lot, "1.00" a standard lot. |
| comment | string | Optional note stored on the order. MT5 keeps the first 17 characters after our reference. |
| stop_loss | any | Optional stop loss. An absolute price (e.g. "1.08450"), not a distance in pips or points. |
MT5 broker servers matching a broker or server name, servers seen working on fxapis first. A server not listed can still be used. Example: {"query": "icmarkets"}
| Argument | Type | Description |
|---|---|---|
| query* | string | A broker's name or the start of a server name, e.g. 'justmarkets' or 'VantageInternational-Live'. |
| response_format | string | concise (default): what a next step needs. detailed: every field the API returns. |
{
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"required": [
"query"
],
"properties": {
"query": {
"type": "string",
"maxLength": 64,
"minLength": 2,
"description": "A broker's name or the start of a server name, e.g. 'justmarkets' or 'VantageInternational-Live'."
},
"response_format": {
"enum": [
"concise",
"detailed"
],
"type": "string",
"description": "concise (default): what a next step needs. detailed: every field the API returns."
}
}
}Stops an account's terminal; open positions and their stops stay at the broker. Refused while an order is in flight. Example: {"account_id": "<id>"}
| Argument | Type | Description |
|---|---|---|
| account_id* | string | The fxapis account id (a UUID) from list_accounts — not the MT5 login number. |
{
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"required": [
"account_id"
],
"properties": {
"account_id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"description": "The fxapis account id (a UUID) from list_accounts — not the MT5 login number."
}
}
}| deviation_points | integer | Maximum slippage in points. |
{
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"required": [
"account_id",
"position_id",
"idempotency_key"
],
"properties": {
"volume": {
"anyOf": [
{
"type": "string",
"pattern": "^\\d+(\\.\\d{1,8})?$"
},
{
"type": "number",
"minimum": 0
}
],
"description": "Optional: how much to close. Omit to close the whole position. In lots, preferably as a string: \"0.01\" is a micro lot, \"1.00\" a standard lot."
},
"comment": {
"type": "string",
"maxLength": 120,
"description": "Optional note stored on the order. MT5 keeps the first 17 characters after our reference."
},
"account_id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"description": "The fxapis account id (a UUID) from list_accounts — not the MT5 login number."
},
"position_id": {
"type": "string",
"maxLength": 40,
"minLength": 1,
"description": "The position ticket: `brokerPositionId` from list_positions."
},
"client_order_id": {
"type": "string",
"maxLength": 120,
"description": "Optional reference of your own, echoed back on the order."
},
"idempotency_key": {
"type": "string",
"maxLength": 200,
"minLength": 8,
"description": "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": {
"type": "integer",
"maximum": 10000,
"minimum": 0,
"description": "Maximum slippage in points."
}
}
}{
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"limit": {
"type": "integer",
"maximum": 200,
"minimum": 1,
"description": "Rows per page, 1–200. Default 25."
},
"since": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
"description": "ISO 8601 date-time; only rows at or after it."
},
"state": {
"enum": [
"accepted",
"validating",
"sending",
"working",
"completed",
"filled",
"partially_filled",
"rejected",
"failed",
"unknown",
"cancelled",
"expired"
],
"type": "string",
"description": "Only orders in this state."
},
"until": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
"description": "ISO 8601 date-time; only rows at or before it."
},
"cursor": {
"type": "string",
"description": "`nextCursor` from the previous page."
},
"symbol": {
"type": "string",
"maxLength": 32,
"minLength": 1,
"description": "The symbol exactly as this broker names it, e.g. \"EURUSD\" — some brokers add a suffix such as \"EURUSD.r\"."
},
"account_id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"description": "The fxapis account id (a UUID) from list_accounts — not the MT5 login number."
},
"response_format": {
"enum": [
"concise",
"detailed"
],
"type": "string",
"description": "concise (default): what a next step needs. detailed: every field the API returns."
}
}
}| 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 | string | Optional reference of your own, echoed back on the order. |
| idempotency_key* | string | 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 | integer | Maximum slippage in points. Too small invites requotes. |
{
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"required": [
"account_id",
"symbol",
"side",
"volume",
"idempotency_key"
],
"properties": {
"side": {
"enum": [
"buy",
"sell"
],
"type": "string",
"description": "buy or sell."
},
"symbol": {
"type": "string",
"maxLength": 32,
"minLength": 1,
"description": "The symbol exactly as this broker names it, e.g. \"EURUSD\" — some brokers add a suffix such as \"EURUSD.r\"."
},
"volume": {
"anyOf": [
{
"type": "string",
"pattern": "^\\d+(\\.\\d{1,8})?$"
},
{
"type": "number",
"minimum": 0
}
],
"description": "Order size. In lots, preferably as a string: \"0.01\" is a micro lot, \"1.00\" a standard lot."
},
"comment": {
"type": "string",
"maxLength": 120,
"description": "Optional note stored on the order. MT5 keeps the first 17 characters after our reference."
},
"stop_loss": {
"anyOf": [
{
"type": "string",
"pattern": "^\\d+(\\.\\d{1,8})?$"
},
{
"type": "number",
"minimum": 0
}
],
"description": "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": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"description": "The fxapis account id (a UUID) from list_accounts — not the MT5 login number."
},
"take_profit": {
"anyOf": [
{
"type": "string",
"pattern": "^\\d+(\\.\\d{1,8})?$"
},
{
"type": "number",
"minimum": 0
}
],
"description": "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": {
"type": "string",
"maxLength": 120,
"description": "Optional reference of your own, echoed back on the order."
},
"idempotency_key": {
"type": "string",
"maxLength": 200,
"minLength": 8,
"description": "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": {
"type": "integer",
"maximum": 10000,
"minimum": 0,
"description": "Maximum slippage in points. Too small invites requotes."
}
}
}| execute_at | string | When to send. Omit to send as soon as every account is online. |
| expires_at | string | Stop waiting for accounts after this. |
| instrument | string | Instead of symbol: an instrument from list_instruments, e.g. XAUUSD. Each account trades its own broker's symbol for it; the whole order is refused if any account's broker does not offer it. |
| account_ids* | array | The accounts to trade on, one order each. |
| take_profit | any | Optional take profit for every account. An absolute price (e.g. "1.08450"), not a distance in pips or points. |
| barrier_policy | string | When some accounts are not online in time: release-ready (default) trades on those that are; all-or-nothing trades on none unless all are; wait keeps waiting until expires_at. |
| idempotency_key* | string | 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. |
{
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"required": [
"account_ids",
"side",
"volume",
"idempotency_key"
],
"properties": {
"side": {
"enum": [
"buy",
"sell"
],
"type": "string",
"description": "buy or sell."
},
"label": {
"type": "string",
"maxLength": 120,
"description": "A name for this multi-account order."
},
"symbol": {
"type": "string",
"maxLength": 32,
"minLength": 1,
"description": "The symbol exactly as this broker names it, e.g. \"EURUSD\" — some brokers add a suffix such as \"EURUSD.r\"."
},
"volume": {
"anyOf": [
{
"type": "string",
"pattern": "^\\d+(\\.\\d{1,8})?$"
},
{
"type": "number",
"minimum": 0
}
],
"description": "Size per account, unless weights overrides it for an account. In lots, preferably as a string: \"0.01\" is a micro lot, \"1.00\" a standard lot."
},
"comment": {
"type": "string",
"maxLength": 120,
"description": "Optional note stored on the order. MT5 keeps the first 17 characters after our reference."
},
"weights": {
"type": "object",
"description": "Optional per-account size, keyed by account id, e.g. {\"<account id>\": \"0.05\"}.",
"propertyNames": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
"additionalProperties": {
"anyOf": [
{
"type": "string",
"pattern": "^\\d+(\\.\\d{1,8})?$"
},
{
"type": "number",
"minimum": 0
}
]
}
},
"stop_loss": {
"anyOf": [
{
"type": "string",
"pattern": "^\\d+(\\.\\d{1,8})?$"
},
{
"type": "number",
"minimum": 0
}
],
"description": "Optional stop loss for every account. An absolute price (e.g. \"1.08450\"), not a distance in pips or points."
},
"execute_at": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
"description": "When to send. Omit to send as soon as every account is online."
},
"expires_at": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
"description": "Stop waiting for accounts after this."
},
"instrument": {
"type": "string",
"maxLength": 32,
"minLength": 1,
"description": "Instead of symbol: an instrument from list_instruments, e.g. XAUUSD. Each account trades its own broker's symbol for it; the whole order is refused if any account's broker does not offer it."
},
"account_ids": {
"type": "array",
"items": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"description": "The fxapis account id (a UUID) from list_accounts — not the MT5 login number."
},
"maxItems": 1000,
"minItems": 1,
"description": "The accounts to trade on, one order each."
},
"take_profit": {
"anyOf": [
{
"type": "string",
"pattern": "^\\d+(\\.\\d{1,8})?$"
},
{
"type": "number",
"minimum": 0
}
],
"description": "Optional take profit for every account. An absolute price (e.g. \"1.08450\"), not a distance in pips or points."
},
"barrier_policy": {
"enum": [
"release-ready",
"all-or-nothing",
"wait"
],
"type": "string",
"description": "When some accounts are not online in time: release-ready (default) trades on those that are; all-or-nothing trades on none unless all are; wait keeps waiting until expires_at."
},
"idempotency_key": {
"type": "string",
"maxLength": 200,
"minLength": 8,
"description": "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."
}
}
}| account_id* | string | The fxapis account id (a UUID) from list_accounts — not the MT5 login number. |
| expires_at | string | When the broker should drop it. Omit for good-till-cancelled. |
| take_profit | any | Optional take profit. An absolute price (e.g. "1.08450"), not a distance in pips or points. |
| client_order_id | string | Optional reference of your own, echoed back on the order. |
| idempotency_key* | string | 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. |
| stop_limit_price | any | Required for stop_limit: the limit placed once the stop triggers. An absolute price (e.g. "1.08450"), not a distance in pips or points. |
{
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"required": [
"account_id",
"symbol",
"side",
"kind",
"volume",
"price",
"idempotency_key"
],
"properties": {
"kind": {
"enum": [
"limit",
"stop",
"stop_limit"
],
"type": "string",
"description": "limit, stop or stop_limit."
},
"side": {
"enum": [
"buy",
"sell"
],
"type": "string",
"description": "buy or sell."
},
"price": {
"anyOf": [
{
"type": "string",
"pattern": "^\\d+(\\.\\d{1,8})?$"
},
{
"type": "number",
"minimum": 0
}
],
"description": "The price the order waits at. An absolute price (e.g. \"1.08450\"), not a distance in pips or points."
},
"symbol": {
"type": "string",
"maxLength": 32,
"minLength": 1,
"description": "The symbol exactly as this broker names it, e.g. \"EURUSD\" — some brokers add a suffix such as \"EURUSD.r\"."
},
"volume": {
"anyOf": [
{
"type": "string",
"pattern": "^\\d+(\\.\\d{1,8})?$"
},
{
"type": "number",
"minimum": 0
}
],
"description": "Order size. In lots, preferably as a string: \"0.01\" is a micro lot, \"1.00\" a standard lot."
},
"comment": {
"type": "string",
"maxLength": 120,
"description": "Optional note stored on the order. MT5 keeps the first 17 characters after our reference."
},
"stop_loss": {
"anyOf": [
{
"type": "string",
"pattern": "^\\d+(\\.\\d{1,8})?$"
},
{
"type": "number",
"minimum": 0
}
],
"description": "Optional stop loss. An absolute price (e.g. \"1.08450\"), not a distance in pips or points."
},
"account_id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"description": "The fxapis account id (a UUID) from list_accounts — not the MT5 login number."
},
"expires_at": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
"description": "When the broker should drop it. Omit for good-till-cancelled."
},
"take_profit": {
"anyOf": [
{
"type": "string",
"pattern": "^\\d+(\\.\\d{1,8})?$"
},
{
"type": "number",
"minimum": 0
}
],
"description": "Optional take profit. An absolute price (e.g. \"1.08450\"), not a distance in pips or points."
},
"client_order_id": {
"type": "string",
"maxLength": 120,
"description": "Optional reference of your own, echoed back on the order."
},
"idempotency_key": {
"type": "string",
"maxLength": 200,
"minLength": 8,
"description": "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."
},
"stop_limit_price": {
"anyOf": [
{
"type": "string",
"pattern": "^\\d+(\\.\\d{1,8})?$"
},
{
"type": "number",
"minimum": 0
}
],
"description": "Required for stop_limit: the limit placed once the stop triggers. An absolute price (e.g. \"1.08450\"), not a distance in pips or points."
}
}
}