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
| Name | Type | Description | Required | Nullable |
|---|---|---|---|---|
| userId | integer | The User id. | true | false |
| templateId | integer | The Account Template Id. | true | false |
| accountName | string | The Account name. | true | false |
| internalTag | integer | A flag that informs whether this account is for internal use. | false | true |
Example Request
- Request
- cURL
{
"userId": 0,
"templateId": 0,
"accountName": "string",
"internalTag": 0
}
curl -X 'POST' \
'https://userapi-demo.s2f.projectx.com/TradingAccount/createSimAccount' \
-H 'accept: text/plain' \
-H 'Content-Type: application/json' \
-d '{
"userId": 0,
"templateId": 0,
"accountName": "string",
"internalTag": 0
}'
Example Response
- Success
- Error
{
"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
}
}
Error: response status is 401
Create Live Account
API URL: POST https://userapi-demo.s2f.projectx.com/TradingAccount/createLiveAccount
API Reference: /TradingAccount/createLiveAccount
Parameters
| Name | Type | Description | Required | Nullable |
|---|---|---|---|---|
| userId | integer | The User id. | true | false |
| templateId | integer | The Account Template Id. | true | false |
| accountName | string | The Account name. | true | false |
| internalTag | integer | A flag that informs whether this account is for internal use. | false | true |
Example Request
- Request
- cURL
{
"userId": 0,
"templateId": 0,
"accountName": "string",
"internalTag": 0
}
curl -X 'POST' \
'https://userapi-demo.s2f.projectx.com/TradingAccount/createLiveAccount' \
-H 'accept: text/plain' \
-H 'Content-Type: application/json' \
-d '{
"userId": 0,
"templateId": 0,
"accountName": "string",
"internalTag": 0
}'
Example Response
- Success
- Error
{
"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
}
}
Error: response status is 401