Skip to content

Decisions7 min read

Connecting a forex CRM to MetaTrader 5: Manager API, Web API and what should sync

By Published

Short answerMetaQuotes describes the MetaTrader 5 Web API as the way to integrate the platform with a broker's web resources and other services, and the Manager API as the way to build administration tools. Whichever you use, the trading server owns balances and trades, and the CRM owns clients, KYC, payment approvals and IB rules. Trades flow one way, into the CRM. Deposits and withdrawals reach the server only after approval.

What MetaQuotes says each MetaTrader 5 API is for

MetaQuotes lists five APIs on its MetaTrader 5 page for brokers, each with one sentence of purpose. Two of them matter for a CRM. The other three are for people extending the server itself.

The same site's comparison of MetaTrader 5 and MetaTrader 4 lists C++, ASP.Net and PHP against the Manager API for MetaTrader 5. The public pages do not publish method lists, ports or limits, so I will not quote any here.

APIMetaQuotes' descriptionDoes a CRM need it?
Web APIPlatform integration with web resources and other services of the companyYes. A CRM and a traders' room fit this description
Manager APIDeveloping custom administration and management utilities, or even your own manager terminalSometimes, for back-office tools
Gateway APIIntegration with other trading systems and creation of custom data feedsNo
Server APIAdding functions to the trade server and the history serverNo
Report APIExpanding the reports the trade servers produceRarely

Who can open the API documentation

The API reference is not public. When I opened the documentation addresses on support.metaquotes.net, each one showed the MetaQuotes Support Center sign-in page instead of the manual. I could not find a public page that says who is given a login, so I am not going to guess.

What MetaQuotes does say in public is useful to a startup owner. The platform is deployed on the broker's own infrastructure. MetaQuotes states that it does not provide SaaS solutions and has no access to servers, accounts or trading data. It also says MetaTrader 5 supports White Label licensing.

So access is a question about your own setup. If you hold the licence, ask MetaQuotes. If you run a white label, ask the company that provides it. Either way I would want three answers in writing before any CRM work is priced: which API will be opened to you, with what permissions, and whether a test server exists.

A developer cannot get this for you.

One owner for every fact: the sync table

My rule for connecting two systems is that each fact has one owner, and the other system holds a copy it never edits. For a brokerage the split is clean. The trading server owns the money on trading accounts and everything that happens in the market. The CRM owns people, documents, approvals and partner rules.

MetaQuotes' MQL5 reference lists the account properties the platform keeps, including balance, credit, equity, free margin and leverage. Those are figures the CRM should display and never calculate for itself.

WhatOwnerDirectionHow I would handle it
Client profile, KYC state, documentsCRMStays in the CRMSend the server only the details it needs
Trading account: number, group, leverage, currencyTrading serverCRM requests, server creates, the number comes backStore the number against the client
Balance, credit, equity, free marginTrading serverServer to CRM, read onlyNever edit the copy in the CRM
DepositCRM approves, server recordsCRM to server, then the server's record backOne payment reference, one balance operation
WithdrawalCRM approves, server recordsRead free margin, then CRM to server, then pay outDeduct on the server before the money leaves
Bonus, credit, correction, feeCRM decides, server recordsCRM to serverUse the matching transaction type
Trades (deals)Trading serverServer to CRM onlyNever write trades from the CRM
IB commissionCRM calculatesDeals in; a payout back only if it lands on a trading accountFinance approves before a payout is sent
Trading passwordsTrading serverNot copiedI would not store them in the CRM at all

Deposits and withdrawals: one reference, one balance operation

MetaQuotes' comparison page lists eight balance transaction types in MetaTrader 5: Balance, Credit, Correction, Charge, Bonus, Commission, Agent and Interest. That matters for reporting. If every bonus and fee is pushed as a plain balance entry, nobody can separate client deposits from promotions later.

Here is a made-up deposit to show the order of events. A client pays 500 US dollars by card. The payment provider confirms it to the CRM with the reference PAY-1042. The CRM checks the KYC state and the approval rule, then sends one balance operation of 500 to the trading server, carrying PAY-1042 in whatever field the API offers for a reference. The server's record of that operation comes back and is stored next to the payment. Only then does the client see the deposit as completed.

The failure I design against is the double credit. A provider can send the same confirmation twice, and a network timeout can hide a success. So the CRM must refuse a second operation for a reference it has already sent. After a timeout it looks for the reference on the server before it retries.

Each night I would also compare totals. Made-up numbers again: the CRM ledger shows deposits of 12,400 for the day and the server shows 12,900. In this example the 500 gap is an entry made by hand on the server that the CRM never sent. The report should name it by morning.

Trades for IB commission flow one way

The MQL5 reference defines a deal as the reflection of a trade operation being executed, based on an order. Each deal has a ticket, which the reference calls a unique number assigned to each deal, along with a symbol, a time, a volume, a commission and an entry flag for whether it opened or closed a position. Those are the raw materials for partner commission.

The CRM copies deals in. It does not send them back, and it does not edit its copies.

  • Use the server's deal ticket as the key, so a deal that arrives twice is stored once.
  • Whether you pay on the opening deal, the closing deal or both comes from your IB plan. My post on scoping a forex CRM covers those rules.
  • Calculate commission from the stored deals, not from a running total. A corrected rate can then be replayed over the same deals.
  • MetaTrader 5 lists both Commission and Agent among its balance transaction types. Which one your payouts use is a setup decision to confirm with whoever administers the server.

Automations: the route that may need no API code

There is a second way to move events out of the platform. MetaQuotes describes a feature called Automations, built into MetaTrader 5, with a back-office integration workflow: when an event such as a new trading account or a completed payment occurs, the platform sends a web request to your system. MetaQuotes presents this as an alternative to building custom API integrations.

It also describes the reverse direction. In its example a client deposits through the broker's website, the website sends a callback request to the platform, and the platform credits the trading account.

MetaQuotes' own advice for this workflow is to whitelist the trading server's external IP address in your firewall so outbound requests are not blocked. The duplicate rule from the deposit section still applies.

I have read the product pages, not the configuration manual. Before designing around Automations I would confirm which events and fields your server offers.

What to send me before I quote the platform connection

A forex CRM is custom software. It is not one of my fixed app packages, which are mobile apps: Launch at $999, Growth at $1,699 and Scale at $2,500. I quote a CRM as a fixed price after a written scope, and the trading platform connection is its own line in that scope. Third-party fees, hosting and ongoing maintenance are not included. Licensing and regulatory questions stay with the broker and its advisers.

The Forex CRM case study lists trading platform integration, deposits and withdrawals, and an IB and partner portal among its capabilities. The sync table above is where I would start the same conversation with you.

  • Written confirmation of which API you can use, and whether there is a test server.
  • Your account groups, leverage options and account currencies.
  • Your payment providers, with their documentation.
  • A list of who may make manual balance entries on the server. Each one has to be explained in the nightly report.

Questions

Can a developer get MetaTrader 5 API access without a broker?
I could not find a public route. The API documentation sits behind the MetaQuotes Support Center sign-in, and MetaQuotes' public pages address brokers who buy or license the platform. So I would ask the broker, or the company behind its white label, to arrange access and a test server.
Should the CRM store client balances?
It can keep a copy for reports, with the time it was read. The trading server's figure is the one that counts. The CRM never changes a balance on its own: a change goes to the server as a balance operation and comes back as a record.

Sources

Platform rules and fees in this article were checked against these official pages on 14 November 2026. They change, so confirm before you rely on them.

Sannan Malik is a software architect and product builder with 8+ years in software, CEO of Alpha Notic FZE and a Certified Scrum Product Owner. He builds mobile apps and business software for companies in the UAE, the wider Gulf, the UK, the US, Canada and Australia.

Let's build it

Got an idea? Let's talk.

The fastest way to reach me is WhatsApp. Tell me what you're building and I'll reply with how I'd approach it, which package fits, or what a custom scope would look like.

Message me on WhatsApp