This call will create a customer in the CRM and will associate the created customer with a lead.
If a lead with the same email already exists in the CRM the customer will be associated with that lead.
If not, a new lead will be created.
The marketing parameters sent with the request will be associated with the lead of the customer along with any dynamic parameters passed as metadata.
( If configured in Settings>Trading Platforms ) The trading account parameter is used to create a platform (MT4 / MT5) account together with the new customer.
To use this API call, a valid API key is required in the headers.
If the API key used for the request is also associated with a user, that user will become the source of that lead.
API Key Generation
Go to Settings>System>User Management>Api Keys
Click on ‘New’
Type the name of the API key i.e. ‘API key’
Add an expiration date for the API key
Save your changes
From the column, ‘API key’ take the value that just generated
API Request Parameters
Name | Data Type | Mandatory/Optional | Description |
|---|---|---|---|
firstName | String | Mandatory | |
lastName | String | Mandatory | |
String | Mandatory | ||
natonalityCountryCode | String | Mandatory | An ISO3166-1 Standard Alpha- 2 country code |
phone | String | Mandatory | A phone number is written in international format |
phoneCountryCode | String | Mandatory | An ISO 3166-1 standard Alpha-2 country code |
password | String | Mandatory | An alphanumeric with more than six characters |
utmDetails | An optional object with marketing parameters | ||
utm_campaign | String | Optional | |
utm_medium | String | Optional | |
utm_source | String | Optional | |
affiliate_id | String | Optional | |
campaign_id | String | Optional | |
utm_term | String | Optional | |
utm_ad_group | String | Optional | |
utm_placement | String | Optional | |
utm_device | String | Optional | |
source_page | String | Optional | |
data_referrer | String | Optional | |
gclid | String | Optional | |
cxd | String | Optional | |
utm_content | String | Optional | |
tradingAccount | An optional object with information for creating a trading account. | ||
platformType | Enum[mt4, mt5] | Mandatory | |
platformMode | Enum[demo, live, dev] | Mandatory | |
accountType | Integer | Mandatory | A valid CRM account type id |
currency | String | Mandatory | An ISO 4217 standard Alpha-3 code |
name | String | Optional | Name of the account |
metadata | A list of any key(string) - value(string) pairs | ||
title | String | Optional | Available values Mr, Mrs, Ms, Miss, Mx) |
gender | String | Optional | Available values [Male, Female] |
birthday | (Date) (Format: yyyy/mm/dd) | ||
preferredLanguageCode | String | Optional | An ISO 3166-1 standard Alpha-2 language code |
address | Optional | object with information for creating an address | |
street | String | Optional | |
streetNum | String | Optional | |
city | String | Optional | |
postalCode | String | Optional | |
state | String | Optional | |
countryCode | String | Optional | An ISO 3166-1 standard Alpha-2 country code |
typeOf | String | Optional | (An ISO 3166-1 standard Alpha-2 country code |
termsAndConditions | Boolean | Optional | Denotes whether the customer has accepted the Terms and Conditions |
API Response Parameters
Name | Data Type | Description |
|---|---|---|
customerId | Integer | The id of the created customer |
leadId | Integer | The id of the lead associated with the created customer |
firstName | String | |
lastName | String | |
String | A valid email address | |
nationalityCountryCode | String | An ISO 3166-1 standard Alpha-2 country code |
phone | String | A phone number is written in International format |
phoneCountryCode | String | An ISO 3166-1 standard Alpha-2 country code |
password | String | An alphanumeric with more than six characters |
utmDetails | An optional object with marketing parameters | |
utm_campaign | String | |
utm_medium | String | |
utm_source | String | |
affiliate_id | String | |
campaign_id | String | |
utm_term | String | |
utm_ad_group | String | |
utm_placement | String | |
utm_device | String | |
source_page | String | |
data_referrer | String | |
gclid | String | |
cxd | String | |
utm_content | String | |
tradingAccount | An optional object with information for creating a trading account | |
platformType | Enum[mt4, mt5] | |
platformMode | Enum[demo, live, dev] | |
accountType | Integer | A valid CRM account type id |
currency | String | An ISO 4217 standard Alpha-3 code |
name | String | Name of the account |
metadata | A list of any key(string) - value(string) pairs | |
token | String | JWT Token of the customer (used in auto-login feature) |
title | String | (Available values [Mr, Mrs, Ms, Miss, Mx]) |
gender | String | (Available values [Male, Female]) |
birthday | (Date) (Format: yyyy/mm/dd) | |
preferredLanguageCode | String | An ISO 3166-1 standard Alpha-2 language code |
address | An optional object with information for creating an address | |
street | String | |
streetNum | String | |
city | String | |
postalCode | String | |
state | String | |
countryCode | String | An ISO 3166-1 standard Alpha-2 country code |
typeOf | String | (Available values [residential, temporary]) |
termsAndConditions | Boolean | Denotes whether the customer has accepted the Terms and Conditions |
Request Example :
curl -X POST \
https://api-mydomain.com/api/v1/customer \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Date: Wed, 20 Dec 2017 07:28:00 GMT' \
-H 'X-Api-Key: b18e9a6a-e47f-4c55-8968-647259a73c3b' \
-H 'X-Domain: api-mydomain.com' \
-H 'cache-control: no-cache' \
-d '{
"firstName": "Sample",
"lastName": "Customer",
"email": "sample@sample.com",
"nationalityCountryCode": "cy",
"phone": "+35799123456",
"phoneCountryCode": "cy",
"password": "abc!123456",
"referrer" : "984",
"utmDetails": {
"utm_campaign" : "myCampaign",
"utm_medium": "Sample Medium",
"utm_source": "Sample Source",
"affiliate_id": "123",
"campaign_id": "Sample Campaign ID",
"utm_term": "Fake Term",
"utm_ad_group": "Sample Ad Group",
"utm_placement": "Sample Placement",
"utm_device": "Sample Device",
"gclid" : "Sample Google Click Id",
"cxd" : "Sample Cellexperts Token",
"utm_content" : "Sample Content"
},
"metadata1": "metadata1",
"metadata2": "metadata2",
"metadata3": "metadata3"
"title": "Mr",
"gender": "Male",
"birthday": "2001-07-01T00:00:00.000Z",
"preferredLanguageCode": "ab",
"address": {
"typeOf": "residential",
"city": "Washington",
"postalCode": "20500",
"state": "DC",
"street": "1600 Pennsylvania Ave NW",
"streetNum": "1600",
"countryCode": "us"
}
"termsAndConditions": false
}'
Response Example:
{
"customerId": 418909342,
"leadId": 4727,
"firstName": "Sample",
"lastName": "Customer",
"email": "sample@sample.com",
"nationalityCountryCode": "cy",
"phone": "+35799123456",
"phoneCountryCode": "cy",
"utmDetails": {
"utmCampaign": "myCampaign",
"utmMedium": "Sample Medium",
"utmSource": "Sample Source",
"affiliateId": "123",
"campaignId": "Sample Campaign ID",
"utmTerm": "Sample Term",
"utmAdGroup": "Sample Ad Group",
"utmPlacement": "Sample Placement",
"utmDevice": "Sample Device",
"gclId": "Sample Google Click Id",
"cxd": "Sample Cellexperts Token",
"utmContent": "Sample Content"
},
"referrer": "984",
"metadata": {
"metadata1": "metadata1",
"metadata2": "metadata2",
"metadata3": "metadata3"
},
"title": "Mr",
"gender": "Male",
"birthday": "2001-07-01T00:00:00.000Z",
"preferredLanguageCode": "ab",
"address": {
"typeOf": "residential",
"city": "Washington",
"postalCode": "20500",
"state": "DC",
"street": "1600 Pennsylvania Ave NW",
"streetNum": "1600",
"countryCode": "us"
},
"termsAndConditions": false,
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxLUVKRXU4NjJJdGdwakszeVN0MVFsNGFlOUhyeHZneGplT084Q0l3dXNncWJ3ZWk4MG12OUZKOHRyaHZXNTBUT1BjZStreEswRWtKUFg4aFVkMTdFYnptN0JqaFh0WlE9PSIsImlzcyI6InBsYXktc2lsaG91ZXR0ZSIsImV4cCI6MTU2NzI1NjAzMCwiaWF0IjoxNTY2ODI0MDMwLCJqdGkiOiJmN2QxZWRiZjVhOTMwZDRkOGU1ODhkOGVlODM3ZWNlNzhlYTBlYTRmM2NkNGU0OGM1YzQ1YjQ5OWI1NDAxYWU2NGJiNWRiZGU1YTA2M2Y3NWUwZDkxZDJhOTI4ZmNlMDM2MDIzNWFlMDU1NDk5MDE4M2JkOWE1NDE1NmQwNGU3ODY1YTA3NGY5ZTU5ODMwN2RkODJlZWJlMjI5OTI3OWY2OWFhOWRhZTgzZjVkNDJhMDdlNmEzZGExY2YyZTFlZjU0ZjU0YWNjZjg3ZGRlNGViZGU5MGU1MjFjOGIxMGUwNDljMmNmMjc0ODExY2JkNmQxYTRmMTZmZTc5OGIxYmUyIn0.IzP0i1Rak8jvPrAwWuNGEarC1nluQdNs8ODbNPSHVQQ"
}
where my-domain should be replaced with the domain of members area
https://api-mydomain.com/api/v1/customer
Auto Login:
Auto-login URL
n the example below the user will automatically log in to the members area after he has navigated to the example URL.
Query parameter: token
Example URL: https://member.mydomain.com/auth/login?token=user-token
The user will be redirected to the dashboard page.
Auto-login with Redirect URL
In the example below the user will automatically log in to the members area and be navigated to the deposit page after he has navigated to the example URL.
Query parameter: returnUrl
Example URL: https://member.mydomain.com/auth/login?token=user-token&returnUrl=/wallet/deposit
The user will be redirected to the deposit page.
‘'Valid returnUrl parameters can be found on the admin area of the CRM under Settings > Menus’'
Auto-login with hidden status pop-up
In the example below the user will automatically log in to the members area and be navigated to the deposit page after he has navigated to the example URL but without opening the status pop up.
Query parameter: statusPopup
Example URL: https://member.mydomain.com/auth/login?token=user-token&returnUrl=/wallet/deposit&statusPopup=false
The user will be redirected to the deposit page but without opening the status popup.