User Registration

Register New User Without Package

post
​

β€Žhttps://<domain>/<api prefix>/<version>/user/signup/β€Ž
This API endpoint add new user into the system.
Request
Response
Request
Headers
apikey
required
string
apikey
Authorization
required
string
Bearer access token
Body Parameters
country_code
required
string
country code
sponsor
required
string
sponsor username
first_name
required
string
first name
last_name
required
string
last name
username
required
string
username
password
required
string
password
confirm_password
required
string
confirm password
agree_terms
required
string
agree terms - Possible values are 1 or 0
user_type
required
string
user role - Possible values are customer or member. member role is equivalent to distributor, consultant, or agent.
email
required
string
email address
phone_number
required
string
phone number
place_genealogy
required
string
place_genealogy - Possible values are 1 or 0
Response
200: OK
HTTP/1.1 200 OK
Content-Type: application/json
​
Body:
{
"status_code": 200,
"errors": {},
"data": {
"uid": "<Unique user id>"
}
}

Sample code

Node

var request = require('request');
var options = {
'method': 'POST',
'url': 'https://<domain>/<api prefix>/<version>/user/signup/',
'headers': {
'apikey': '<apikey>'
},
formData: {
'country_code': '<country code>',
'sponsor': '<sponsor username>',
'first_name': '<first name>',
'last_name': '<last name>',
'username': '<username>',
'password': '<password>',
'confirm_password': '<confirm password>',
'agree_terms': '<agree terms>',
'user_type': '<user role>',
'email': '<email address>',
'phone_number': '<phone number>',
'place_genealogy': '<place genealogy>',
'position' : '<Genealogy position>'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});

PHP

<?php
​
$curl = curl_init();
​
curl_setopt_array($curl, array(
CURLOPT_URL => "https://<domain>/<api prefix>/<version>/user/signup/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => array(
'country_code' => <country code>,
'sponsor' => <sponsor username>,
'first_name' => <first name>,
'last_name' => <last name>,
'username' => <username>,
'password' => <password>,
'confirm_password' => <confirm password>,
'agree_terms' => <agree terms>,
'user_type' => <user role>,
'email' => <email address>,
'phone_number' => <phone number>,
'place_genealogy' => <place genealogy>,
'position' => <Genealogy position>
),
CURLOPT_HTTPHEADER => array(
"apikey: <apikey>"
)
));
​
$response = curl_exec($curl);
​
curl_close($curl);
echo $response;

Error Responses

Status Code

Error Type

Field

Description

400

Validation Error

country_code

Invalid country code

400

Validation Error

sponsor

Invalid sponsor name

400

Validation Error

sponsor

The selected sponsor is not found or is in the inactive state.

400

Validation Error

first_name

The first name should be an alphabet.

400

Validation Error

last_name

The last name should be an alphabet.

400

Validation Error

username

Username is already taken. Please try another one.

400

Validation Error

username

Invalid username. Only contains alphanumeric characters, underscore and dot. \nUnderscore and dot can't be next to each other (e.g user_.name). \nUnderscore or dot can't be used multiple times in a row (e.g user__name / user..name). The number of characters must be between 5 to 250.

400

Validation Error

password

password validation errors

400

Validation Error

confirm_password

Confirmed password doesn't match.

400

Validation Error

phone_number

Phone number already taken. Please try another one.

400

Validation Error

email

There is a user registered with the specified E-Mail address.

400

Validation Error

position

Your chosen position is invalid. The default will be the spilling preference of

Register New User With Package

post
​

β€Žβ€Žhttps://<domain>/<api prefix>/<version>/user/signup-package/
This API endpoint add new user into the system with an enrollment package.
Request
Response
Request
Headers
apikey
required
string
apikey
Authorization
required
string
Bearer access token
Body Parameters
country_code
required
string
country code
sponsor
required
string
sponsor username
first_name
required
string
first name
last_name
required
string
last name
username
required
string
username
password
required
string
password
confirm_password
required
string
confirm password
agree_terms
required
string
agree terms - Possible values are 1 or 0
user_type
required
string
user role - Possible values are customer or member. member role is equivalent to distributor, consultant, or agent.
email
required
string
email address
phone_number
required
string
phone number
place_genealogy
required
string
place_genealogy - Possible values are 1 or 0
product_id
required
string
product id
address_first_name
required
string
address first name
address_last_name
required
string
address last name
address_mail_id
required
string
address E-mail address
address_phone_number
required
string
address phone number
address_name_line
required
string
address house number
address_premise
required
string
address street
address_locality
required
string
address locality
address_postal_code
required
string
address post code
address_country_code
required
string
address country code
address_state_code
required
string
address state c
Response
200: OK
HTTP/1.1 200 OK
Content-Type: application/json
​
Body:
{
"status_code": 200,
"errors": {},
"data": {
"uid": "<Unique user id>"
}
}

Sample Code

Node

var request = require('request');
var options = {
'method': 'POST',
'url': 'https://<domain>/<api prefix>/<version>/user/signup-package/',
'headers': {
'apikey': '<apikey>'
},
formData: {
'country_code': '<country code>',
'sponsor': '<sponsor username>',
'first_name': '<first name>',
'last_name': '<last name>',
'username': '<username>',
'password': '<password>',
'confirm_password': '<confirm password>',
'agree_terms': '<agree terms>',
'user_type': '<user role>',
'email': '<email address>',
'phone_number': '<phone number>',
'place_genealogy': '<place genealogy>',
'position' : '<Genealogy position>',
'product_id': '<product id>',
'address_first_name': '<address first name>',
'address_last_name': '<address last name>',
'address_mail_id': '<address email id>',
'address_phone_number': '<address phone number>',
'address_name_line': '<address house number>',
'address_premise': '<address street>',
'address_locality': '<address locality>',
'address_postal_code': '<address post code>',
'address_country_code': '<address country code>',
'address_state_code': '<address state code>'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});

PHP

<?php
​
$curl = curl_init();
​
curl_setopt_array($curl, array(
CURLOPT_URL => "https://<domain>/<api prefix>/<version>/user/signup-package/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => array(
'country_code' => <country code>,
'sponsor' => <sponsor username>,
'first_name' => <first name>,
'last_name' => <last name>,
'username' => <username>,
'password' => <password>,
'confirm_password' => <confirm password>,
'agree_terms' => <agree terms>,
'user_type' => <user role>,
'email' => <email address>,
'phone_number' => <phone number>,
'place_genealogy' => <place genealogy>,
'position' => <genealogy position>,
'product_id' => <product id>,
'address_first_name' => <address first name>,
'address_last_name' => <address last name>,
'address_mail_id' => <address email id>,
'address_phone_number' => <address phone number>,
'address_name_line' => <address house number>,
'address_premise' => <address street>,
'address_locality' => <address locality>,
'address_postal_code' => <address post code>,
'address_country_code' => <address country code>,
'address_state_code' => <address state code>
),
CURLOPT_HTTPHEADER => array(
"apikey: <apikey>"
)
));

Error Responses

Status Code

Error Type

Field

Description

400

Validation Error

country_code

Invalid country code

400

Validation Error

sponsor

Invalid sponsor name

400

Validation Error

sponsor

The selected sponsor is not found or is in the inactive state.

400

Validation Error

first_name

The first name should be an alphabet.

400

Validation Error

last_name

The last name should be an alphabet.

400

Validation Error

username

Username is already taken. Please try another one.

400

Validation Error

username

username Invalid username. Only contains alphanumeric characters, underscore and dot. \nUnderscore and dot can't be next to each other (e.g user_.name). \nUnderscore or dot can't be used multiple times in a row (e.g user__name / user..name). The number of characters must be between 5 to 250.

400

Validation Error

password

password validation errors

400

Validation Error

confirm_password

Confirmed password doesn't match.

400

Validation Error

phone_number

Phone number already taken. Please try another one.

400

Validation Error

email

There is a user registered with the specified E-Mail address.

400

Validation Error

position

Your chosen position is invalid. The default will be the spilling preference of

400

Validation Error

address_postal_code

Invalid postcode

400

Validation Error

address_state_code

Invalid address_state_code

400

Validation Error

address_first_name

Invalid address_first_name

400

Validation Error

address_last_name

Invalid address_last_name

400

Validation Error

address_country_code

Invalid address_country_code

400

Validation Error

product_id

Invalid product_id

500

Server Error

​

User creation is failed.