Provisioning clients
Create and manage trading accounts for your clients. This is the call your CRM makes when a user is approved, funded, or assigned a challenge.
Create an account
POST /api/v1/accounts
- curl
- Node.js
- Python
curl --request POST \
--url https://api.onlytradeplatform.com/api/v1/accounts \
--header "Authorization: Bearer $ADMIN_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"account_type": 0,
"trade_type": 0,
"role_id": 26100003,
"group_id": 26100005,
"currency": "USD",
"leverage": 100,
"status": 2,
"user_password": "Str0ng!Pass",
"investor_password": "ReadOnly!Pass",
"first_name": "Jane",
"family_name": "Doe",
"email": "jane@example.com"
}'
const res = await fetch("https://api.onlytradeplatform.com/api/v1/accounts", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.ADMIN_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
account_type: 0,
trade_type: 0,
role_id: 26100003,
group_id: 26100005,
currency: "USD",
leverage: 100,
status: 2,
user_password: "Str0ng!Pass",
investor_password: "ReadOnly!Pass",
first_name: "Jane",
family_name: "Doe",
email: "jane@example.com",
}),
});
const { data: account } = await res.json();
import os, requests
account = requests.post(
"https://api.onlytradeplatform.com/api/v1/accounts",
headers={"Authorization": f"Bearer {os.environ['ADMIN_TOKEN']}"},
json={
"account_type": 0,
"trade_type": 0,
"role_id": 26100003,
"group_id": 26100005,
"currency": "USD",
"leverage": 100,
"status": 2,
"user_password": "Str0ng!Pass",
"investor_password": "ReadOnly!Pass",
"first_name": "Jane",
"family_name": "Doe",
"email": "jane@example.com",
},
).json()["data"]
The response is a ViewAccount with the new id, balances, and (for prop
groups) the live prop config and prop_status.
Account types
Two fields decide what kind of account you create:
| Field | Values |
|---|---|
account_type | 0 client · 1 admin · 2 dealer |
trade_type | 0 live (real money) · 1 demo (no real money — used for testing) |
So prop / live / demo are combinations: a prop challenge is a client account
(account_type: 0) in a group with prop risk enabled,
and a test account is any account with trade_type: 1.
Key fields:
| Field | Notes |
|---|---|
role_id | the account's role (Trader, Investor, …). |
group_id | the group whose rules/risk/commission the account inherits. |
status | 0 read-only · 1 pending · 2 active · 3 rejected. Use 1 to hold a new live account for KYC. |
user_password | the trading password. |
investor_password | optional read-only password (view, no trades). |
| identity fields | first_name, family_name, email, date_of_birth, country_of_citizenship, address_line, … |
Read, update, move
GET /api/v1/accounts # list
GET /api/v1/accounts/{account_id} # one account
PUT /api/v1/accounts/{account_id} # update fields
PATCH /api/v1/accounts/{account_id}/change-password
PATCH /api/v1/accounts/{account_id}/groups/{group_id} # move to another group
DELETE /api/v1/accounts/{account_id}
KYC: approve / decline
New live accounts created with status: 1 (pending) wait for review:
PATCH /api/v1/accounts/{account_id}/approve
PATCH /api/v1/accounts/{account_id}/decline
Approving activates the account and emails the credentials; declining marks it
rejected. KYC status is also surfaced on the account's kyc_results field.
Provision with trade_type: 1 while you build — those accounts use no real
money. See Environments & testing.