Skip to main content

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 --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"
}'

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:

FieldValues
account_type0 client · 1 admin · 2 dealer
trade_type0 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:

FieldNotes
role_idthe account's role (Trader, Investor, …).
group_idthe group whose rules/risk/commission the account inherits.
status0 read-only · 1 pending · 2 active · 3 rejected. Use 1 to hold a new live account for KYC.
user_passwordthe trading password.
investor_passwordoptional read-only password (view, no trades).
identity fieldsfirst_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.

Test against demo first

Provision with trade_type: 1 while you build — those accounts use no real money. See Environments & testing.