CPlugin

MT5 :: Clients

API v1 (stable) · MT5 · 5 operations · base URL https://cloud.mywebapi.com · OpenAPI v1 (JSON) · Redoc

Every call needs Authorization: Bearer $TOKEN — an OAuth 2.0 client-credentials token from https://auth.cplugin.net/connect/token (scope webapi). $TRADE_PLATFORM_ID is the id of a trade platform registered in Toolbox.

Operations

Delete user

GET /api/MT5/{tradePlatform}/UserDelete/{login}

Timeout: 15 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: The operation may still be completed by the server (X-Request-Outcome: unknown): check its result before repeating it.

Parameters

NameInTypeRequiredDescription
tradePlatform path string (uuid) yes Trade platform id
login path integer (int64) yes The login of a user
X-Request-Timeout header number (double) no How long to wait for the trade server, in seconds (1–300). Default for this operation: 15 s (change). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.

Responses

Example

curl "https://cloud.mywebapi.com/api/MT5/$TRADE_PLATFORM_ID/UserDelete/$LOGIN" \
  -H "Authorization: Bearer $TOKEN"

Add client

POST /api/MT5/{tradePlatform}/ClientAdd

Add a client to the server database

Timeout: 15 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: The operation may still be completed by the server (X-Request-Outcome: unknown): check its result before repeating it.

Parameters

NameInTypeRequiredDescription
tradePlatform path string (uuid) yes Trade platform id
X-Request-Timeout header number (double) no How long to wait for the trade server, in seconds (1–300). Default for this operation: 15 s (change). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.

Request body

MT5Client (application/json) — Client to create

Responses

Example

curl -X POST "https://cloud.mywebapi.com/api/MT5/$TRADE_PLATFORM_ID/ClientAdd" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "personName": "", "recordID": 0, "clientType": "Undefined", "clientStatus": "Unregistered", "assignedManager": 0, "complianceApprovedBy": 0 }'

Attach account to user

GET /api/MT5/{tradePlatform}/ClientUserAdd/{clientId}/{login}

Attach account to user

Timeout: 15 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: The operation may still be completed by the server (X-Request-Outcome: unknown): check its result before repeating it.

Parameters

NameInTypeRequiredDescription
tradePlatform path string (uuid) yes Trade platform id
clientId path integer (int64) yes Client identifier
login path integer (int64) yes Trade account login
X-Request-Timeout header number (double) no How long to wait for the trade server, in seconds (1–300). Default for this operation: 15 s (change). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.

Responses

Example

curl "https://cloud.mywebapi.com/api/MT5/$TRADE_PLATFORM_ID/ClientUserAdd/$CLIENT_ID/$LOGIN" \
  -H "Authorization: Bearer $TOKEN"

Request Client

GET /api/MT5/{tradePlatform}/ClientRequest/{clientId}

Timeout: 10 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: Nothing was changed; the request is safe to repeat.

Parameters

NameInTypeRequiredDescription
tradePlatform path string (uuid) yes Trade platform id
clientId path integer (int64) yes Client identifier
X-Request-Timeout header number (double) no How long to wait for the trade server, in seconds (1–300). Default for this operation: 10 s (read). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.

Responses

Example

curl "https://cloud.mywebapi.com/api/MT5/$TRADE_PLATFORM_ID/ClientRequest/$CLIENT_ID" \
  -H "Authorization: Bearer $TOKEN"

Delete Client

GET /api/MT5/{tradePlatform}/ClientDelete/{clientId}

Timeout: 15 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: The operation may still be completed by the server (X-Request-Outcome: unknown): check its result before repeating it.

Parameters

NameInTypeRequiredDescription
tradePlatform path string (uuid) yes Trade platform id
clientId path integer (int64) yes Client identifier
X-Request-Timeout header number (double) no How long to wait for the trade server, in seconds (1–300). Default for this operation: 15 s (change). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.

Responses

Example

curl "https://cloud.mywebapi.com/api/MT5/$TRADE_PLATFORM_ID/ClientDelete/$CLIENT_ID" \
  -H "Authorization: Bearer $TOKEN"

Schemas

Types the operations above take and return, with their first-level properties; * marks a required one. The full graph is in the OpenAPI specification.

MT5Result

Values: Ok, OkNone, Error, ErrParams, ErrData, ErrDisk, ErrMem, ErrNetwork, ErrPermissions, ErrTimeout, ErrConnection, ErrNoService, ErrFrequent, ErrNotfound, ErrPartial, ErrShutdown, ErrCancel, ErrDuplicate, AuthClientInvalid, AuthAccountInvalid, AuthAccountDisabled, AuthAdvanced, AuthCertificate, AuthCertificateBad, AuthNotConfirmed, AuthServerInternal, AuthServerBad, AuthUpdateOnly, AuthClientOld, AuthManagerNoConfig, AuthManagerIPBlock, AuthGroupInvalid, AuthCaDisabled, AuthInvalidID, AuthInvalidIp, AuthInvalidType, AuthServerBusy, AuthServerCert, AuthAccountUnknown, AuthServerOld, AuthServerLimit, AuthMobileDisabled, AuthManagerType, AuthDemoDisabled, AuthResetPassword, AuthOTPInvalid, AuthOTPNeedSecret, AuthMigrationMT4, AuthMigrationMT5, AuthInvalidVerify, AuthVerifyBadEmail, AuthVerifyBadPhone, AuthAPIDisabled, CfgLastAdmin, CfgLastAdminGroup, CfgNotEmpty, CfgInvalidRange, CfgNotManagerLogin, CfgBuiltin, CfgDuplicate, CfgLimitReached, CfgNoAccessToMain, CfgDealerIDExist, CfgBindAddressExist, CfgWorkingTrade, CfgGatewayNameExist, CfgSwitchToBackup, CfgNoBackupModule, CfgNoTradeModule, CfgNoHistoryModule, CfgAnotherSwitch, CfgNoLicenseFile, CfgGatewayLoginExist, CfgInvalidCompany, UsrLastAdmin, UsrLoginExhausted, UsrLoginProhibited, UsrLoginExist, UsrSuicide, UsrInvalidPassword, UsrLimitReached, UsrHasTrades, UsrDifferentServers, UsrDifferentCurrency, UsrImportBalance, UsrImportGroup, UsrAccountExist, UsrImportAccount, UsrImportPositions, UsrImportOrders, UsrImportDeals, UsrImportHistory, UsrAPILimitReached, TradeLimitReached, TradeOrderExist, TradeOrderExhausted, TradeDealExhausted, TradeMaxMoney, TradeDealExist, TradeOrderProhibited, TradeDealProhibited, TradeSplitVolume, ReportSnapshot, ReportNotSupported, ReportNodata, ReportTemplateBad, ReportTemplateEnd, ReportInvalidRow, ReportLimitRepeat, ReportLimitReport, HstSymbolNotfound, RequestInWay, RequestAccepted, RequestProcess, RequestRequote, RequestPrices, RequestReject, RequestCancel, RequestPlaced, RequestDone, RequestDonePartial, RequestError, RequestTimeout, RequestInvalid, RequestInvalidVolume, RequestInvalidPrice, RequestInvalidStops, RequestTradeDisabled, RequestMarketClosed, RequestNoMoney, RequestPriceChanged, RequestPriceOff, RequestInvalidExp, RequestOrderChanged, RequestTooMany, RequestNoChanges, RequestAtDisabledServer, RequestAtDisabledClient, RequestLocked, RequestFrozen, RequestInvalidFill, RequestConnection, RequestOnlyReal, RequestLimitOrders, RequestLimitVolume, RequestInvalidOrder, RequestPositionClosed, RequestExecutionSkipped, RequestInvalidCloseVolume, RequestCloseOrderExist, RequestLimitPositions, RequestRejectCancel, RequestLongOnly, RequestShortOnly, RequestCloseOnly, RequestProhibitedByFifo, RequestHedgeProhibited, RequestReturn, RequestDoneCancel, RequestRequoteReturn, ErrNotImplement, ErrNotMain, ErrNotSupported, ErrDeadlock, ErrLocked, MessengerInvalidPhone, MessengerNotMobile, SubsNotFound, SubsNotFoundCfg, SubsNotFoundUser, SubsDisabled, SubsPermissionUser, SubsPermissionSubscribe, SubsPermissionUnsubscribe, SubsRealOnly, SubsPaymentMethod, PayRealOnly, PayInvalidAmount, PayNotAllowedDeposit, PayNotAllowedWithdrawal, PayNotAllowedGroup, PayNotAllowedCountry, PayDeclineByRules, PayDeclineByAml, PayLimitDepositMin, PayLimitDepositMax, PayLimitWithdrawalMin, PayLimitWithdrawalMax, PayProviderPayment, PayProviderStatus, PayConversion, PayNotWaiting, PayVerification, PayInvoice, PayInvalidCurrency, PayLimitReached, PayProviderRefund, PayDeclineByCardholderName

MT5Error

PropertyTypeDescription
errorDescription string, nullable MT5 ManagerAPI response code description.
errorCode MT5Result MT5 ManagerAPI response code
errorType MT5ResultType type of error described here
requestId string (uuid) Unique request tracking ID

MT5Client

Client record interface

PropertyTypeDescription
recordID integer (int64), nullable record id
clientType ClientTypes client type
clientStatus ClientStatuses client status
assignedManager integer (int64), nullable assigned manager
complianceApprovedBy integer (int64), nullable compliance approved by
complianceClientCategory string, nullable compliance client category
complianceDateApproval string (date-time), nullable compliance date approval
complianceDateTermination string (date-time), nullable compliance date termination
leadCampaign string, nullable lead campaign
leadSource string, nullable lead source
introducer string, nullable introducer
personTitle string, nullable person title
personName * string person name
personMiddleName string, nullable person middle name
personLastName string, nullable person last name
personBirthDate string (date-time), nullable person birth date The date of birth is specified in the FILETIME format: the number of 100-nanosecond intervals that have elapsed since January 1, 1601
personCitizenship string, nullable person citizenship
personGender Genders person gender
personTaxID string, nullable person taxid
personDocumentType string, nullable person document type
personDocumentNumber string, nullable person document number
personDocumentDate string (date-time), nullable issue date of the identification document (of passport, driver's license, etc.). in seconds since 01.01.1970 (UnixTime).
personDocumentExtra string, nullable person document extra
personEmployment Employment person employment
personIndustry EmploymentIndustry person industry
personEducation EducationLevel person education
personWealthSource WealthSource person wealth source
personAnnualIncome number (double), nullable person annual income
personNetWorth number (double), nullable person net worth
personAnnualDeposit number (double), nullable person annual deposit
companyName string, nullable company name
companyRegNumber string, nullable company registration number
companyRegDate string (date-time), nullable Company registration date in seconds that elapsed since 01.01.1970 (UnixTime).
companyRegAuthority string, nullable company registration authority
companyVAT string, nullable company VAT
companyLEI string, nullable company LEI
companyLicenseNumber string, nullable company license number
companyLicenseAuthority string, nullable company license authority
companyCountry string, nullable company country
companyAddress string, nullable company address
companyWebsite string, nullable company website
contactPreferred PreferredCommunication contact preferred
contactLanguage string, nullable contact language
contactEmail string, nullable contact email
contactPhone string, nullable contact phone
contactMessengers string, nullable contact messengers
contactSocialNetworks string, nullable contact social networks
contactLastDate string (date-time), nullable Contact last date
addressCountry string, nullable address country
addressPostcode string, nullable address postcode
addressStreet string, nullable address street
addressState string, nullable address state
addressCity string, nullable address city
experienceFX TradingExperience experience of FX
experienceCFD TradingExperience experience of CFD
experienceFutures TradingExperience experience of Futures
experienceStocks TradingExperience experience of Stocks
tradingGroup string, nullable trading group
clientOrigin ClientOrigins client origin
clientOriginLogin integer (int64), nullable client origin login
clientExternalID string, nullable external ID
personDocumentExpiration string (date-time), nullable person document expiration date
kycStatus KYCStatuses KYC status
dateCreated string (date-time), nullable record creation date
dateModified string (date-time), nullable record modification date

MT5ResultType

type of error described here

Values: HTTP, MT4API, MT5API

ClientTypes

Values: Undefined, Individual, Corporate, Fund

ClientStatuses

Values: Unregistered, Registered, NotInterested, ApplicationIncomplete, ApplicationCompleted, ApplicationInformation, ApplicationRejected, Approved, Funded, Active, Inactive, Suspended, Closed, Terminated

Genders

Values: Unspecified, Male, Female

Employment

Values: Unemployed, Employed, SelfEmployed, Retired, Student, Other

EmploymentIndustry

Values: None, Agriculture, Construction, Management, Communication, Education, Government, Healthcare, Tourism, IT, Security, Manufacturing, Marketing, Science, Engineering, Transport, Other

EducationLevel

Values: None, HighSchool, Bachelor, Master, PHD, Other

WealthSource

Values: Employment, Savings, Inheritance, Other

PreferredCommunication

Values: Undefined, Email, Phone, SMS, Messenger

TradingExperience

Values: LessThanYear, OneToThreeYears, AboveThreeYears

ClientOrigins

Values: Manual, Demo, Contest, Preliminary, Real

KYCStatuses

Values: Undefined, Approved, Declined