MngAddClient¶
Creates a client record in CRM. A customer is the business and KYC entity above
trading accounts; accounts are linked to it later through customer_id.
The command is available through the manager command API only; there is no REST
path for it. The kind is fixed by the command name, so customer_kind is not
accepted on input. See
Clients and Leads Commands.
Creating a record as a client straight away is a legitimate scenario: the
server fills conversion_flags and conversion_time itself, so the record
does not have to be created as a lead and converted afterwards.
It replaces the deprecated MngAddCustomer.
Access Control¶
Allowed sessions:
SESSION_MANAGERSESSION_ADMINSESSION_DEALERSESSION_CRM_MANAGERSESSION_CRM_ADMIN
The caller must have CRM access and set_clients. The record brand and desk must
be inside the manager scope; admin scope bypasses this check.
Setting email, phone, or password additionally requires set_clients_contacts. If the
manager does not have see_clients_contacts, contact fields in the response are masked.
Request¶
{
"command": "MngAddClient",
"extID": "1",
"data": {
"brand": "default",
"desk": "DESK_RETENTION",
"email": "[email protected]",
"first_name": "John",
"last_name": "Smith",
"phone": "+442000000000",
"type": 0,
"status": 0,
"lifecycle_flags": 0,
"deposit_allowed": 1,
"withdrawal_allowed": 1
}
}
Request Data¶
Every field is optional. customer_kind is not among them: the command name
carries the kind.
| Field | Type | Limits |
|---|---|---|
customer_id |
int | 0 or greater. 0 or omitted lets the server assign one |
brand |
string | Up to 64 characters |
desk |
string | Up to 64 characters |
manager_id |
int | 0 or greater |
type |
int | 0..1: 0 individual, 1 business |
status |
int | 0..2: 0 active, 1 blocked, 2 archived |
lifecycle_flags |
int64 | 0 or greater. Only the lower bound is checked here |
source_type |
int | 0..4: 0 manual, 1 web, 2 import, 3 affiliate, 4 system |
landing_url, referrer_url |
string | Up to 2048 characters |
utm_source, utm_medium, utm_campaign, utm_content, utm_term |
string | Up to 255 characters |
import_batch_id, old_id |
string | Up to 255 characters |
first_contact_time, archive_time, created_time |
int64 | 0 or greater |
deposit_allowed, withdrawal_allowed |
int | 0..1 |
pep_status |
int | 0..2 |
sanctions_status |
int | 0..3 |
risk_level |
int | 0..2 |
aml_status |
int | 0..3 |
kyc_status, sales_status, risk_status, finance_status |
int | 0 or greater, dictionary ids |
password |
string | 6 to 128 characters |
Contact and personal fields are accepted as well: first_name, last_name,
middle_name, full_name, birth_date, citizenship, country_of_residence,
email, phone, preferred_language, timezone, and the CRM classification
fields crm_stage, segment, tags_json, lead_source, campaign,
affiliate_id, introducer_id, meta_json. Their meanings are listed in
Customer Fields.
Response Data¶
Returns the created record. Sensitive authentication fields are never returned.
{
"customer": {
"customer_id": 1,
"brand": "default",
"desk": "DESK_RETENTION",
"email": "[email protected]",
"full_name": "John Smith",
"type": 0,
"status": 0,
"enable": 1,
"lifecycle_flags": 0,
"customer_kind": 1,
"conversion_flags": 1,
"deposit_allowed": 1,
"withdrawal_allowed": 1,
"created_time": 1777600000,
"updated_time": 1777600000
}
}
Errors¶
| HTTP | Error | Description |
|---|---|---|
400 |
INVALID_DATA |
Request validation failed |
400 |
INVALID_DESK |
desk does not exist, is disabled, archived, or belongs to another brand |
409 |
RET_DUPLICATE_RECORD |
Customer id or unique email already exists |
403 |
RET_NOT_ENOUGH_RIGHTS |
Missing permission, missing scope, or the record is outside the caller's visibility |
404 |
RET_NOT_FOUND |
No customer with that identifier exists |
Every error carries a message field with free-form text. Its contents are not
part of the contract; branch on error.