3.3. Create a Trader

Method URL
POST /webserv/traders

Creates a new trading account.

Request Body

Key Required? Data Type Description
accessRights Yes string The access rights given to the new account. Can be limited to closing positions (CLOSE_ONLY), a total ban on trading (NO_TRADING), and removal of all login rights (NO_LOGIN). The default value is FULL_ACCESS.
accountType Yes string The type of the newly created account. The values include HEDGED, NETTED, and SPREAD_BETTING; HEDGED is the default value.
balance Yes integer The total balance of the new account. This parameter primarily exists for the creation of demo accounts with a non-zero balance. Please, note that balance is specified in 10^2. E.g., a balance value of 56445 would equal to 564.45 in the account base currency units. If JPY is the account currency, the last two digits in balance have to equal zero.
brokerName No string Please, see Section 2.3.
contactDetails Yes object A JSON object containing the trader’s address, phone number, and other details as shown below.
contactDetails.address No string The trader’s address of residence.
contactDetails.city No string The trader’s city of residence.
contactDetails.countryId No integer The ID number denoting the trader’s country of residence.
contactDetails.documentId No string The trader’s unique document ID.
contactDetails.email No string The trader’s email address.
contactDetails.phone No string The trader’s phone number.
contactDetails.state No string The trader’s state of residence.
contactDetails.zipCode No string The zip code of the trader’s residence.
depositCurrency Yes string The currency that the account uses for making deposits and withdrawals.
description No string A brief description of the account
groupName Yes string The name of the group to which the account is assigned.
hashedPassword Yes string The MD5 of the account password.
isLimitedRisk Yes boolean The trader’s limited risk (LR) status. LR means the establishment of guaranteed stop losses. If this parameter equals true, LR is enabled, and vice versa.
lastName No string The trader’s last name.
leverageInCents Yes integer The total amount of leverage available to the account; is specified in 10^2. For example, the value of 12515 would signify a 1:121.15 leverage.
limitedRiskMarginCalculationStrategy No string The margin calculation strategy used for a limited risk account. Can be ACCORDING_TO_LEVERAGE, ACCORDING_TO_GSL, and ACCORDING_TO_GSL_AND_LEVERAGE.
maxLeverage No integer The maximum amount of leverage (in the base currency units) available to an account. Specified in 10^2.
name No string The name of the account.
sendOwnStatement No boolean A flag determining whether a daily trading statement is sent to the trader.
sendStatementToBroker No boolean A flag determining whether a daily account trading statement is sent to the broker.
totalMarginCalculationType No boolean The means through which the account margin is calculated. The value can equal MAX, SUM, and NET.

Output

Key Data Type Description
accessRights string Please, see the ‘Request Body’ table.
accountType string Please, see the ‘Request Body’ table.
balance integer Please, see the ‘Request Body’ table.
brokerName string Please, see the ‘Request Body’ table.
contactDetails object Please, see the ‘Request Body’ table.
depositCurrency string Please, see the ‘Request Body’ table.
description string Please, see the ‘Request Body’ table.
groupName string Please, see the ‘Request Body’ table.
isLimitedRisk boolean Please, see the ‘Request Body’ table.
lastName string Please, see the ‘Request Body’ table.
leverageInCents integer Please, see the ‘Request Body’ table.
limitedRiskMarginCalculationStrategy string Please, see the ‘Request Body’ table.
maxLeverage integer Please, see the ‘Request Body’ table.
name string Please, see the ‘Request Body’ table.
sendOwnStatement boolean Please, see the ‘Request Body’ table.
sendStatementToBroker boolean Please, see the ‘Request Body’ table.
totalMarginCalculationType string Please, see the ‘Request Body’ table.
bonus integer The total amount of bonus funds allocated to the account. Subject to moneyDigits.
equity integer The total amount of equity possessed by the account. Subject to moneyDigits.
freeMargin integer The amount of free margin available to the account. Subject to moneyDigits.
lastUpdateTimestamp integer A timestamp with the date and time of the latest account update.
login integer The number of a specific trading account.
moneyDigits integer Please, see Section 2.1.
nonWithdrawableBonus integer The total amount of the non-withdrawable bonus allocated to the account. Subject to moneyDigits.
rebateRate integer The current account rebate rate.
registrationTimestamp integer A timestamp with the date and time of account registration.
swapFree boolean If this parameter equals true, rollover commissions are applied to the account instead of swaps. The reverse applies if the parameter is false. This field is useful for ensuring compliance with Sharia law.
usedMargin integer The total amount of margin in use by the account. Subject to moneyDigits.

Request Example

curl -X POST ‘https://HOST:PORT/v2/webserv/traders?token=04d95575-c9af-42fba72e-2f0ce93f01d4’ -H ‘Accept: application/json’ -H ‘Content-Type: application/json’ -d ‘{"accessRights": "FULL_ACCESS", "accountType": "HEDGED", "balance": 00, "brokerName": "BESTBROKER", "contactDetails": {"address": "Moon", "city": "Lake", "countryId": 8, "documentId": "0123", "email": "president%40bestbroker.com", "phone": "+50987654321", "state": "RE ", "zipCode": "5500"},"depositCurrency": "EUR", "description": "string", "groupName": "Default", "hashedPassword": "c5678ghf94578ce06iqrs5ag76a62c5ca4", "isLimitedRisk": false, "lastName": "President ", "leverageInCents": 10000, "maxLeverage": 100000, "name": "Best", "sendOwnStatement": true, "sendStatementToBroker": true, "totalMarginCalculationType": "MAX"}’

Expected Response Status Code

201

Response Example

{
    "accessRights": "FULL_ACCESS",
    "accountType": "HEDGED",
    "balance": 1000,
    "brokerName": "BESTBROKER",
    "contactDetails": {
        "address": "Moon",
        "city": "Lake",
        "countryId": 8,
        "documentId": "0123",
        "email": "president%40bestbroker.com",
        "phone": "+50987654321",
        "state": "RE ",
        "zipCode": "5500"
    },
    "depositCurrency": "EUR",
    "description": "string",
    "groupName": "Default",
    "isLimitedRisk": false,
    "lastName": "President ",
    "leverageInCents": 10000,
    "maxLeverage": 100000,
    "name": "Best",
    "sendOwnStatement": true,
    "sendStatementToBroker": true,
    "totalMarginCalculationType": "MAX",
    "bonus": 0,
    "equity": 0,
    "freeMargin": 1000,
    "lastUpdateTimestamp": 1598862013825,
    "login": 8673590,
    "moneyDigits": 2,
    "nonWithdrawableBonus": 0,
    "registrationTimestamp": 1598862013824,
    "swapFree": false,
    "usedMargin": 0
}

Last update: September 26, 2022

Comments