Skip to content

OpenCustomerAccount

Endpoint

POST /customer/account/open

Description

Creates a trading account linked to the authenticated customer.

The request accepts only a group selected from GetCustomerAccountGroups. The server revalidates brand, public group visibility, account mode policy, and KYC requirements before creating the account.

Affiliate registration does not open an account. Automated account creation after customer.created must use the CRM workflow account.open action. This authenticated endpoint remains the self-service account-opening flow and applies the public-opening and KYC gates described below.

Authorization

Requires SESSION_CUSTOMER token.

Request

{
  "group": "demo-usd"
}

Response

{
  "login": 100001,
  "group": "demo-usd",
  "brand": "default",
  "account_mode": "DEMO",
  "currency": "USD",
  "leverage": 100,
  "temporary_password": "7b4c9d1a2f3e",
  "must_change_password": true
}

If the group has default_deposit > 0, the server creates the account and then applies the default balance operation.

temporary_password is returned only at account creation time.

KYC Gate

If the customer tries to open a REAL account and the brand requires KYC, the server revalidates the customer KYC aggregate before account creation.

When KYC is not approved, the method returns 403 KYC_REQUIRED and creates or reuses the customer KYC profile through KycManager::SetRequiredLevel with:

level = 1
reason = real_account_required
source = account_opening

The response includes the current KYC state so the terminal can switch to the KYC flow immediately:

{
  "error": "KYC_REQUIRED",
  "message": "Account opening is not allowed for this group",
  "kyc_required": true,
  "kyc_required_level": 1,
  "kyc_status": 2,
  "kyc_current_level": 0,
  "kyc_profile_id": 1
}

Errors

HTTP Error Description
400 INVALID_DATA Invalid request body
400 INVALID_GROUP Group does not exist
401 INVALID_CUSTOMER_SESSION Customer id is missing in session
403 BRAND_NOT_AVAILABLE Customer brand is disabled or missing
403 GROUP_DISABLED Group is disabled
403 GROUP_NOT_PUBLIC Group is not available for self-service opening
403 GROUP_BRAND_MISMATCH Group belongs to another brand
403 DEMO_OPENING_DISABLED Brand does not allow demo opening
403 REAL_OPENING_DISABLED Brand does not allow real opening
403 KYC_REQUIRED Real account opening requires approved KYC
500 CORE_NOT_AVAILABLE Trading core is not available
500 ADD_BALANCE_ERROR Account was created but default balance operation failed