Accounts
Connect, list and disconnect trading accounts.
An account is your MetaTrader login, stored with its password encrypted. We never return the password from any endpoint.
POST /v1/accounts
Connect an account. Needs a trade key, or a role that can trade.
| Field | Type | |
|---|---|---|
platform | "mt5" or "mt4" | Required. |
login | string | Required. |
password | string | Required. Your trading password, not the investor one. |
server | string | Required. Exactly as MetaTrader shows it. |
brokerSlug | string | Optional. Checked against server; a mismatch is a 400. |
brokerName | string | Optional. What you call your broker, if we do not list it. |
label | string | Optional. Your name for it, up to 64 characters. |
transport | "auto" | "ea" | "api" | Optional, default auto. See below. |
chartSymbol | string | Optional. A symbol this account trades. |
symbolMap | object | Optional. { "XAUUSD": ["XAUUSDm", "GOLD"] }: your broker's spellings for canonical names, tried in order. See Symbols. |
curl -X POST https://api.orderfill.trade/v1/accounts \
-H "authorization: Bearer $ORDERFILL_API_KEY" \
-H "content-type: application/json" \
-d '{"platform":"mt5","login":"477072059","password":"…","server":"Exness-MT5Trial9"}'
{
"account": {
"id": "b1c9…", "platform": "mt5", "login": "477072059",
"server": "Exness-MT5Trial9", "transport": "auto", "label": null,
"status": "active", "chartSymbol": null
},
"notice": null
}
A non-null notice means the account was saved but may not connect yet. Show it to
your user.
Any server works, demo or live, and the broker is optional. Every MetaTrader login
names a server, and that is all we need. If we have not connected to a server before,
the account's status is adding while we find it, usually a few minutes, and becomes
active on the first login that works. A call that needs the terminal meanwhile answers
409 server_unknown. MT4 accounts take a server only; there is no broker list for them.
Copy the server name exactly, capitals and spaces included, from MetaTrader or your broker's email.
One login per server per team. Connecting a login your team already has on that server
answers 409 conflict, with the existing account's id in details.accountId.
Use the trading password to place orders. An investor (read-only) password connects and reads, but the broker refuses every order.
transport decides how we connect to your terminal. ea runs an expert advisor
inside it and is the fastest for closing many positions at once. api runs no expert
advisor, which some prop firms require. auto picks for you. If your firm has rules
about expert advisors, choose explicitly. MT4 accounts always use the expert advisor.
GET /v1/accounts
Your team's accounts.
{ "accounts": [ { "id": "b1c9…", "login": "477072059", "server": "Exness-MT5Trial9", "status": "active", "live": true, "lastOrderAt": "2026-10-17T10:19:03Z", "…": "…" } ] }
live is true while a terminal is running for the account. Reading a sleeping account wakes
it, so check live before polling balances you do not need.
GET /v1/accounts/:id
One account, same shape as in the list.
GET /v1/accounts/:id/health
Whether the account can trade right now.
{ "health": { "connected": true, "tradeAllowed": true, "pingMs": 42.5, "build": 5100 } }
connected: false means the account has lost its broker connection; tradeAllowed: false
means the broker or the account is not accepting orders at the moment. pingMs is the
last measured round trip to the broker, null before the first one.
PATCH /v1/accounts/:id
Change an account's password, label, chartSymbol or transport. Send only what changes;
anything else is refused. Needs trade.
{ "password": "the-new-trading-password" }
A new password clears login_failed. A new password, chart symbol or connection mode closes
the running terminal, so the next call logs in with what you saved.
DELETE /v1/accounts/:id
Disconnect and delete an account, including its stored credentials. Needs trade. Open positions
stay open at your broker; close them first if you mean to.
Connecting takes a while, once
The first request against an account starts its terminal and logs it into your broker: 20–40 seconds. Requests that arrive meanwhile wait for the same connection rather than starting another. Once connected, calls are fast until the account has been idle for your plan's idle timeout.