MetaTrader 5 icon

MetaTrader 5

Interact with MetaTrader 5 trading platform via WebAPI

Client → Create Client

AI-generated

Summary

Create a new client record via the MT5 WebAPI.

Inputs

  • clientData — Client data in JSON format. This data is posted to the MT5 WebAPI /api/client/add endpoint to create the client record. See MT5 WebAPI documentation for available fields. Defaults to an empty object if not provided.
  • simplify — Whether to return a simplified version of the response instead of the raw data. When enabled, the response includes RecordID, PersonName, PersonLastName, ContactEmail, ContactPhone, ClientStatus, ClientType, DateCreated, AssignedManager, and LeadSource. Defaults to true.

Output shape

If simplify is true, the response is shaped by simplifyClientData (fields: RecordID, PersonName, PersonLastName, ContactEmail, ContactPhone, ClientStatus, ClientType, DateCreated, AssignedManager, LeadSource). If false, the raw API response from /api/client/add is returned.

The operation posts the parsed clientData JSON to the MT5 server. The simplify parameter controls whether the returned data is distilled to core client fields or returned in full.

Examples

Example 1: Create a basic client record with minimal data.

clientData: { PersonName: 'John Doe', ContactEmail: 'john@example.com' }, simplify: true

Discussion