Skip to main content

Create Trading Account from an Account Template

Description


info
Documentation on this page is applicable to platforms that have Account Templates enabled. If you are unsure whether you have Account Templates enabled, please contact your account manager.

To create a Trading Account, you must first set up an Account Template.

The following APIs may be used to create Trading Accounts:

Create Sim Account


API URL: POST https://userapi-demo.s2f.projectx.com/TradingAccount/createSimAccount

API Reference: /TradingAccount/createSimAccount

Parameters


NameTypeDescriptionRequiredNullable
userIdintegerThe User id.truefalse
templateIdintegerThe Account Template Id.truefalse
accountNamestringThe Account name.truefalse
internalTagintegerA flag that informs whether this account is for internal use.falsetrue

Example Request

{
"userId": 0,
"templateId": 0,
"accountName": "string",
"internalTag": 0
}

Example Response

{
"success": true,
"errorCode": 0,
"errorMessage": "string",
"tradingAccount": {
"accountName": "string",
"userId": 0,
"startingBalance": 0,
"balance": 0,
"status": 0,
"marketDataLevel": 0,
"accountId": 0,
"winRate": 0,
"profitAndLoss": 0,
"startDate": "2024-07-02T20:54:35.607Z",
"closedDate": "2024-07-02T20:54:35.607Z",
"dailyLoss": 0,
"maximumLoss": 0,
"drawDownLimit": 0,
"maxPositions": 0,
"type": 0,
"startOfDayBalance": 0,
"combineName": "string",
"platformId": 0,
"platformAccountId": "string",
"platformUserName": "string",
"maxMargin": 0,
"isSharing": true,
"realizedDayPnl": 0,
"updatedAt": "2024-07-02T20:54:35.607Z",
"personalDailyLossLimit": 0,
"personalDailyLossLimitAction": 0,
"personalDailyProfitTarget": 0,
"personalDailyProfitTargetAction": 0,
"totalProfit": 0,
"totalLoss": 0,
"totalTrades": 0,
"dailyTrades": 0,
"isFollower": true,
"isLeader": true,
"openPnl": 0,
"templateId": 0
}
}

Create Live Account


API URL: POST https://userapi-demo.s2f.projectx.com/TradingAccount/createLiveAccount

API Reference: /TradingAccount/createLiveAccount

Parameters


NameTypeDescriptionRequiredNullable
userIdintegerThe User id.truefalse
templateIdintegerThe Account Template Id.truefalse
accountNamestringThe Account name.truefalse
internalTagintegerA flag that informs whether this account is for internal use.falsetrue

Example Request

  {
"userId": 0,
"templateId": 0,
"accountName": "string",
"internalTag": 0
}

Example Response

{
"success": true,
"errorCode": 0,
"errorMessage": "string",
"tradingAccount": {
"accountName": "string",
"userId": 0,
"startingBalance": 0,
"balance": 0,
"status": 0,
"marketDataLevel": 0,
"accountId": 0,
"winRate": 0,
"profitAndLoss": 0,
"startDate": "2024-07-02T17:37:09.387Z",
"closedDate": "2024-07-02T17:37:09.387Z",
"dailyLoss": 0,
"maximumLoss": 0,
"drawDownLimit": 0,
"maxPositions": 0,
"type": 0,
"startOfDayBalance": 0,
"combineName": "string",
"platformId": 0,
"platformAccountId": "string",
"platformUserName": "string",
"maxMargin": 0,
"isSharing": true,
"realizedDayPnl": 0,
"updatedAt": "2024-07-02T17:37:09.387Z",
"personalDailyLossLimit": 0,
"personalDailyLossLimitAction": 0,
"personalDailyProfitTarget": 0,
"personalDailyProfitTargetAction": 0,
"totalProfit": 0,
"totalLoss": 0,
"totalTrades": 0,
"dailyTrades": 0,
"isFollower": true,
"isLeader": true,
"openPnl": 0,
"templateId": 0
}
}