Create a client
post
https://api.complycube.com
/v1/clients
Create a client
Creates a new client.
Parameters
Header
Content-Type*
string
The content-type must always be set to
application/json
.Authorization*
string
The API
live
or test
key.Body
type*
string
The type of client. Valid values are:
1.
person
2. company
email*
string
The client's email address.
mobile
string
The client's mobile number.
telephone
string
The client's telephone number.
externalId
string
A unique identifier that you can associate with the client. For example, this can be the client ID in your system.
joinedDate
string
The date and time when the client was registered with you. This is relevant for users that migrate existing customers. The format is
YYYY-MM-DD
.personDetails
object
Primary details for a client of type
person
. This is required when the type
is person. Also, see the person details object below.companyDetails
object
Primary details for a client of type
company
. This is required when the type
is company. Also, see the company details object below.metadata
object
Set of key-value pairs that you can associate with the client object. This is useful for storing additional information about the client in a structured format. You can specify up to 20 keys, with key names up to 40 characters long and values up to 500 characters long.
Responses
200
Client successfully created.
400
An example of a Bad Request, when an invalid client type is provided.
Attribute | Type | Description |
firstName | string | The client's first name. (Required) |
middleName | string | The client's middle name. (Optional) |
lastName | string | The client's last name. (Required) |
dob | string | The client's date of birth. The format is YYYY-MM-DD . (Optional) |
gender | string | The client's gender. Valid values include:
(Optional) |
nationality | string | |
birthCountry | string | |
ssn | string | The client's SSN (Social Security Number). This is for US clients. (Optional) |
socialInsuranceNumber | string | The client's Social Insurance Number. (Optional) |
nationalIdentityNumber | string | The client's National Identity Number. (Optional) |
taxIdentificationNumber | string | The client's Tax Identification Number (TIN). (Optional) |
Attribute | Type | Description |
name | string | The client's name. (Required) |
website | string | The client's website. (Optional) |
registrationNumber | string | The client's registration or incorporation number. (Optional) |
incorporationCountry | string | |
incorporationType | string | The client's incorporation type. Valid values include:
(Optional) |
cURL
Node.js
Python
PHP
.NET
curl -X POST https://api.complycube.com/v1/clients \
-H 'Authorization: <YOUR_API_KEY>' \
-H 'Content-Type: application/json' \
-d '{
"type": "person",
"email": "[email protected]",
"mobile": "+12 345678910",
"telephone": "+12 345678910",
"joinedDate": "2020-01-01",
"personDetails":{
"firstName": "John",
"lastName" :"Doe",
"dob": "1990-01-01",
"nationality": "GB"
}
}'
const { ComplyCube } = require("@complycube/api");
const complycube = new ComplyCube({ apiKey: "<YOUR_API_KEY>" });
const client = await complycube.client.create({
type: "person",
email: "[email protected]",
mobile: "+12 345678910",
telephone: "+12 345678910",
joinedDate: "2020-01-01",
personDetails: {
firstName: "John",
lastName: "Doe",
dob: "1990-01-01",
nationality: "GB"
}
});
from complycube import ComplyCubeClient
cc_api = ComplyCubeClient(api_key='<YOUR_API_KEY>')
new_client = {
'type':'person',
'email':'[email protected]',
'mobile':"+12 345678910",
'telephone': "+12 345678910",
'joinedDate': "2020-01-01",
'personDetails': {
'firstName':'John',
'lastName': "Doe",
'dob': "1990-01-01",
'nationality': "GB"
}
}
client = cc_api.clients.create(**new_client)
use ComplyCube\ComplyCubeClient;
$ccapi = new ComplyCubeClient('<YOUR_API_KEY>');
$result = $ccapi->clients()->create(['type' => 'person',
'email' => '[email protected]',
'mobile' => '+12 345678910',
'telephone' => '+12 345678910',
'joinedDate' => '2020-01-01',
'personDetails' => ['firstName' => 'John',
'lastName' => 'Doe',
'dob' => '1990-01-01',
'nationality' => 'GB']]);
using ComplyCube.Net;
using ComplyCube.Net.Resources.Clients;
var clientApi = new ClientApi(new ComplyCubeClient("<YOUR_API_KEY>"));
var newClient = new ClientRequest {
type = "person",
email = "[email protected]",
mobile = "+12 345678910",
telephone = "+12 345678910",
joinedDate = "2020-01-01",
personDetails = new PersonDetails {
firstName = "John",
lastName = "Doe",
dob = "1990-01-01",
nationality = "GB"
}
}
var client = await clientApi.CreateAsync(newClient);
Last modified 9mo ago