# Migrating from MetaApi to fxapis

URL: https://docs.fxapis.com/guides/migrate-from-metaapi

> A concept-by-concept guide for moving an MT5 integration from MetaApi to fxapis: provisioning and deploy versus connect and modes, RPC and streaming versus…



This guide is for teams with an MT5 integration on
[MetaApi](https://metaapi.cloud/) who are evaluating or planning a move to
fxapis. It maps MetaApi's concepts to ours, lists equivalent calls, and is
explicit about what fxapis does **not** have yet, so you can decide with the
full picture.

The MetaApi details below come from its public documentation, read on
30 September 2026; see [Sources](#sources). MetaApi changes over time — check
its current docs for anything your decision depends on.

## The short version [#the-short-version]

|                                | MetaApi                                                 | fxapis                                                                                         |
| ------------------------------ | ------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| Platforms                      | MetaTrader 4 and 5                                      | **MetaTrader 5 only**                                                                          |
| Interfaces                     | REST, WebSocket streaming, SDKs (Node.js, Python, Java) | REST (plain HTTPS, any language)                                                               |
| Account lifecycle              | Create, then deploy / undeploy                          | Connect, then a **mode** decides when it is online                                             |
| Real-time updates              | Streaming connection with synchronization listeners     | **Polling** — no streaming or webhooks yet                                                     |
| Trade copying                  | CopyFactory product                                     | [Multi-account orders](/guides/multi-account-orders) + [your own copier](/guides/copy-trading) |
| Order identity                 | `clientId` on a trade                                   | `clientOrderId`, plus an `Idempotency-Key` header: a retry returns the first answer            |
| An order whose answer was lost | See MetaApi's docs                                      | Reported as `ORDER_UNRESOLVED`, then confirmed against the broker's records                    |
| Market data                    | Quotes, candles, ticks                                  | Not provided                                                                                   |

If your product depends on streaming updates, MT4, market data or CopyFactory's
risk features, fxapis does not replace them today. If it places orders on MT5
accounts — one at a time or across many — and needs a recorded result for every
order, with an unclear one confirmed with the broker rather than guessed, read on.

## Concepts [#concepts]

### Provisioning and deploy → connect and modes [#provisioning-and-deploy--connect-and-modes]

In MetaApi you **create** an account through the provisioning API
(`POST /users/current/accounts` with `name`, `server`, `login`, `password`,
`platform`, `magic` and options such as `type`, `region` and `reliability`),
then **deploy** it (`POST …/deploy`), which starts an API server and a trading
terminal for it, and **undeploy** it to stop them.

In fxapis you **connect** an account with
[`POST /v1/accounts`](/api-reference/accounts/connect-an-mt5-account) — `login`,
`server`, `password`, and a `mode`. The mode replaces manual deploy/undeploy:

| fxapis mode      | Behaves like                                                                                                                                                  |
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `always_on`      | An account that is always deployed.                                                                                                                           |
| `warm_on_demand` | Deployed automatically when you place an order or prepare it; undeployed automatically after 15 idle minutes.                                                 |
| `cold`           | Deploy and undeploy yourself, with [`warm`](/api-reference/lifecycle/bring-an-account-online) and [`cool`](/api-reference/lifecycle/take-an-account-offline). |

Coming online takes about ten seconds in our tests. MetaApi's `waitConnected()` and
`waitSynchronized()` correspond to polling
[`GET /v1/accounts/{id}/status`](/api-reference/accounts/poll-lifecycle-state)
until `state` is `ready`. [`POST /v1/accounts/prepare`](/api-reference/lifecycle/bring-several-accounts-online-at-once)
brings up to 200 accounts online in one call.

There is no `magic` field: fxapis tags each order's MT5 comment so it can match
the broker's record to your order, and gives you `clientOrderId` for your own
reference.

### RPC and streaming connections → REST and polling [#rpc-and-streaming-connections--rest-and-polling]

MetaApi offers an **RPC connection** (`account.getRPCConnection()`), which its
docs recommend for monitoring apps and simple trading apps, and a **streaming
connection** (`account.getStreamingConnection()`), recommended for trade
copiers and automated strategies, which keeps a synchronized local terminal
state and calls your listeners on every change.

fxapis has one interface: REST. What you would read from a streaming
connection's terminal state you read with requests:

* **Positions:** [`GET /v1/accounts/{id}/positions`](/api-reference/trading/positions-on-an-account) — a
  snapshot refreshed about every 15 seconds while the account is online, with `observedAt` on
  each row. [`POST /v1/accounts/{id}/reconcile`](/api-reference/trading/confirm-pending-results-with-the-broker-now)
  refreshes it immediately.
* **Deals:** [`GET /v1/accounts/{id}/deals`](/api-reference/history/an-accounts-full-deal-history), including
  deals not caused by your orders (stop-outs, swaps, deposits, manual trades).
* **Order outcomes:** returned by the order call itself, and by [`GET /v1/orders/{id}`](/api-reference/history/fetch-one-order).

There are no event webhooks yet. Code that reacts to `onPositionUpdated` or
`onDealAdded` becomes a polling loop; the [copier guide](/guides/copy-trading)
shows one.

### Trades [#trades]

MetaApi places trades through one endpoint, `POST …/trade`, with an
`actionType`. fxapis has one endpoint per intent, and every order that opens or
closes exposure takes an `Idempotency-Key`:

* A **retry with the same key** returns the first answer instead of placing a second order, for 24
  hours.
* Three failures are distinguished: `SEND_FAILED` (never reached the broker — safe to retry),
  `ORDER_REJECTED` (the broker refused, with its `retcode`), and `ORDER_UNRESOLVED` (the answer was
  lost — **do not resend**; the order is confirmed against the broker's records and moves to what
  actually happened).
* Volumes and prices are **strings**: `"0.01"`, never `0.01`.

See [Idempotent MT5 orders](/guides/idempotency) and [Trading](/trading).

### CopyFactory → multi-account orders and a copier [#copyfactory--multi-account-orders-and-a-copier]

CopyFactory is a complete copy-trading product: strategies and subscribers,
per-subscription copy ratios, symbol mapping, risk filters (drawdown, equity
curve, leverage), stop-outs and signal filtering, with very low internal
copying latency per its docs.

fxapis provides the execution building block —
[multi-account orders](/guides/multi-account-orders), one trade sent to up to
500 accounts together on Enterprise (accounts per multi-account order: Starter
10, Scale 100, Enterprise 500), with per-account volumes, barrier policies and a
dispatch spread of about 30 ms across 100 accounts in our benchmark against an
instant broker — every multi-account order reports its own — and you build the
copying logic. The [trade copier guide](/guides/copy-trading) is a working
starting point. Risk filters, stop-outs, symbol mapping and subscriber
management are yours to implement.

## Equivalent calls [#equivalent-calls]

| MetaApi                                                      | fxapis                                                                                                                                       |
| ------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------- |
| `POST /users/current/accounts` (provisioning)                | [`POST /v1/accounts`](/api-reference/accounts/connect-an-mt5-account)                                                                        |
| `POST …/accounts/:id/deploy`                                 | [`POST /v1/accounts/{id}/warm`](/api-reference/lifecycle/bring-an-account-online), or a mode that does it for you                            |
| `POST …/accounts/:id/undeploy`                               | [`POST /v1/accounts/{id}/cool`](/api-reference/lifecycle/take-an-account-offline)                                                            |
| Removing an account                                          | [`POST /v1/accounts/{id}/disconnect`](/api-reference/lifecycle/disconnect-and-erase-the-credential) — erases the password, keeps the history |
| `waitConnected()` / `waitSynchronized()`, `connectionStatus` | Poll [`GET /v1/accounts/{id}/status`](/api-reference/accounts/poll-lifecycle-state) until `ready`                                            |
| `POST …/trade` with `ORDER_TYPE_BUY` / `ORDER_TYPE_SELL`     | [`POST /v1/accounts/{id}/orders/market`](/api-reference/trading/place-a-market-order) with `side`                                            |
| `ORDER_TYPE_BUY_LIMIT`, `…_STOP`, `…_STOP_LIMIT` (and sells) | [`POST /v1/accounts/{id}/orders/pending`](/api-reference/trading/place-a-limit-stop-or-stop-limit-order) with `kind`                         |
| `POSITION_MODIFY`                                            | [`POST /v1/accounts/{id}/positions/{ticket}/modify`](/api-reference/trading/move-a-positions-stop-loss-or-take-profit)                       |
| `POSITION_CLOSE_ID`                                          | [`POST /v1/accounts/{id}/positions/{ticket}/close`](/api-reference/trading/close-a-position)                                                 |
| `POSITION_PARTIAL`                                           | The same close, with `volume`                                                                                                                |
| `ORDER_MODIFY`                                               | [`POST /v1/orders/{id}/modify`](/api-reference/trading/move-a-pending-orders-price-or-levels)                                                |
| `ORDER_CANCEL`                                               | [`POST /v1/orders/{id}/cancel`](/api-reference/trading/cancel-a-pending-order)                                                               |
| `POSITIONS_CLOSE_SYMBOL`, `POSITION_CLOSE_BY`                | No single call — close each position                                                                                                         |
| `GET …/accounts/:id/positions`                               | [`GET /v1/accounts/{id}/positions`](/api-reference/trading/positions-on-an-account)                                                          |
| `GET …/history-deals/time/:start/:end`                       | [`GET /v1/accounts/{id}/deals?since=…&until=…`](/api-reference/history/an-accounts-full-deal-history)                                        |
| History orders                                               | [`GET /v1/orders?accountId=…`](/api-reference/history/list-orders)                                                                           |
| Margin calculation                                           | [`POST /v1/accounts/{id}/calculate`](/api-reference/trading/margin-required-or-profit-at-a-price)                                            |
| `clientId` on a trade                                        | `clientOrderId`, plus an `Idempotency-Key` header                                                                                            |
| CopyFactory strategies and subscriptions                     | [`POST /v1/execution-waves`](/api-reference/waves/place-one-trade-on-many-accounts) + your copier                                            |

## No equivalent yet [#no-equivalent-yet]

Be sure none of these is load-bearing for you:

* **Streaming.** No WebSocket connection, synchronization listeners or webhooks. Poll.
* **MetaTrader 4.** fxapis connects MT5 accounts only.
* **CopyFactory features.** No strategy/subscriber model, risk filters, stop-outs or symbol mapping.
* **Market data.** No quotes, ticks or candles.
* **Demo account creation.** fxapis does not open accounts at brokers; you connect existing ones.
* **Account balance and equity fields.** Derive them from deals and positions (see
  [prop-firm monitoring](/guides/prop-firms)).
* **Official SDKs.** Any HTTP client works; the [language guides](/guides) have complete programs
  for seven languages.

## A migration plan [#a-migration-plan]

<Steps>
  <Step>
    ### Try it on a demo account [#try-it-on-a-demo-account]

    Create an fxapis key and run the [Quickstart](/quickstart) or a
    [language guide](/guides) against a broker demo account. `fx_test_` keys still
    reach real brokers — they are a label, not a sandbox.
  </Step>

  <Step>
    ### Map your lifecycle [#map-your-lifecycle]

    Decide each account's mode. Accounts you kept deployed all the time become
    `always_on`; accounts you deployed around trades become `warm_on_demand`, and
    the deploy/undeploy code goes away.
  </Step>

  <Step>
    ### Collect credentials again [#collect-credentials-again]

    Connecting an account to fxapis needs its login, **trading** password and
    server name, sent to `POST /v1/accounts` from your backend. Plan how each user
    re-enters their password, and check it straight away — see
    [Connect MT5 accounts](/guides/connect-accounts).
  </Step>

  <Step>
    ### Port order placement [#port-order-placement]

    Replace each `actionType` with its endpoint from the table above. Add an
    `Idempotency-Key` to every market order, pending order and close, derived from
    your own decision (for example signal + account), and handle
    `ORDER_UNRESOLVED` by polling, never resending.
  </Step>

  <Step>
    ### Replace listeners with polling [#replace-listeners-with-polling]

    Turn streaming listeners into loops over positions and deals, with the interval
    your product needs. Show users `observedAt` so they know how fresh a view is.
  </Step>

  <Step>
    ### Switch accounts over one at a time [#switch-accounts-over-one-at-a-time]

    Avoid having both platforms placing orders on the same account at the same time:
    each would treat the other's trades as unexplained. Move an account, confirm its
    orders and history in fxapis, then remove it from the old setup.
  </Step>
</Steps>

## Sources [#sources]

MetaApi documentation, read on 30 September 2026:

* [MetaApi — Provisioning API overview](https://metaapi.cloud/docs/provisioning/)
* [Create account](https://metaapi.cloud/docs/provisioning/api/account/createAccount/),
  [Deploy account](https://metaapi.cloud/docs/provisioning/api/account/deployAccount/),
  [Undeploy account](https://metaapi.cloud/docs/provisioning/api/account/undeployAccount/)
* [MetaApi — Client API overview](https://metaapi.cloud/docs/client/) (REST and WebSocket, MT4 and MT5, SDKs)
* [Execute trade](https://metaapi.cloud/docs/client/restApi/api/trade/),
  [Read positions](https://metaapi.cloud/docs/client/restApi/api/readTradingTerminalState/readPositions/),
  [Read deals by time range](https://metaapi.cloud/docs/client/restApi/api/retrieveHistoricalData/readDealsByTimeRange/)
* [JavaScript SDK — RPC API](https://github.com/metaapi/metaapi-javascript-sdk/blob/master/docs/metaApi/rpcApi.md)
  and [Streaming API](https://github.com/metaapi/metaapi-javascript-sdk/blob/master/docs/metaApi/streamingApi.md)
* [CopyFactory overview](https://metaapi.cloud/docs/copyfactory/)

fxapis facts on this page are from our own [API reference](/api-reference) and
measurements.
