Create Customer
curl --request POST \
--url https://api.cleverhub.co/api/v2/customers \
--header 'Content-Type: application/json' \
--header 'app-id: <api-key>' \
--header 'secret-key: <api-key>' \
--data '
{
"email": "string",
"first_name": "string",
"last_name": "string",
"middle_name": "string",
"dob": "2024-04-16",
"gender": "male",
"phone": "+61-1234523",
"street": "string",
"street2": "string",
"city": "string",
"postal_code": "string",
"state": "CA",
"country": "US",
"type": "organization",
"reg_no": "10242424",
"identity": {
"issue_country": "US",
"document_number": "string",
"issue_date": "2024-04-16",
"expiry_date": "2024-04-16",
"id_doc_type": "Passport"
}
}
'import requests
url = "https://api.cleverhub.co/api/v2/customers"
payload = {
"email": "string",
"first_name": "string",
"last_name": "string",
"middle_name": "string",
"dob": "2024-04-16",
"gender": "male",
"phone": "+61-1234523",
"street": "string",
"street2": "string",
"city": "string",
"postal_code": "string",
"state": "CA",
"country": "US",
"type": "organization",
"reg_no": "10242424",
"identity": {
"issue_country": "US",
"document_number": "string",
"issue_date": "2024-04-16",
"expiry_date": "2024-04-16",
"id_doc_type": "Passport"
}
}
headers = {
"app-id": "<api-key>",
"secret-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'app-id': '<api-key>',
'secret-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
email: 'string',
first_name: 'string',
last_name: 'string',
middle_name: 'string',
dob: '2024-04-16',
gender: 'male',
phone: '+61-1234523',
street: 'string',
street2: 'string',
city: 'string',
postal_code: 'string',
state: 'CA',
country: 'US',
type: 'organization',
reg_no: '10242424',
identity: {
issue_country: 'US',
document_number: 'string',
issue_date: '2024-04-16',
expiry_date: '2024-04-16',
id_doc_type: 'Passport'
}
})
};
fetch('https://api.cleverhub.co/api/v2/customers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cleverhub.co/api/v2/customers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'email' => 'string',
'first_name' => 'string',
'last_name' => 'string',
'middle_name' => 'string',
'dob' => '2024-04-16',
'gender' => 'male',
'phone' => '+61-1234523',
'street' => 'string',
'street2' => 'string',
'city' => 'string',
'postal_code' => 'string',
'state' => 'CA',
'country' => 'US',
'type' => 'organization',
'reg_no' => '10242424',
'identity' => [
'issue_country' => 'US',
'document_number' => 'string',
'issue_date' => '2024-04-16',
'expiry_date' => '2024-04-16',
'id_doc_type' => 'Passport'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"app-id: <api-key>",
"secret-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.cleverhub.co/api/v2/customers"
payload := strings.NewReader("{\n \"email\": \"string\",\n \"first_name\": \"string\",\n \"last_name\": \"string\",\n \"middle_name\": \"string\",\n \"dob\": \"2024-04-16\",\n \"gender\": \"male\",\n \"phone\": \"+61-1234523\",\n \"street\": \"string\",\n \"street2\": \"string\",\n \"city\": \"string\",\n \"postal_code\": \"string\",\n \"state\": \"CA\",\n \"country\": \"US\",\n \"type\": \"organization\",\n \"reg_no\": \"10242424\",\n \"identity\": {\n \"issue_country\": \"US\",\n \"document_number\": \"string\",\n \"issue_date\": \"2024-04-16\",\n \"expiry_date\": \"2024-04-16\",\n \"id_doc_type\": \"Passport\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("app-id", "<api-key>")
req.Header.Add("secret-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.cleverhub.co/api/v2/customers")
.header("app-id", "<api-key>")
.header("secret-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"string\",\n \"first_name\": \"string\",\n \"last_name\": \"string\",\n \"middle_name\": \"string\",\n \"dob\": \"2024-04-16\",\n \"gender\": \"male\",\n \"phone\": \"+61-1234523\",\n \"street\": \"string\",\n \"street2\": \"string\",\n \"city\": \"string\",\n \"postal_code\": \"string\",\n \"state\": \"CA\",\n \"country\": \"US\",\n \"type\": \"organization\",\n \"reg_no\": \"10242424\",\n \"identity\": {\n \"issue_country\": \"US\",\n \"document_number\": \"string\",\n \"issue_date\": \"2024-04-16\",\n \"expiry_date\": \"2024-04-16\",\n \"id_doc_type\": \"Passport\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cleverhub.co/api/v2/customers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["app-id"] = '<api-key>'
request["secret-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"string\",\n \"first_name\": \"string\",\n \"last_name\": \"string\",\n \"middle_name\": \"string\",\n \"dob\": \"2024-04-16\",\n \"gender\": \"male\",\n \"phone\": \"+61-1234523\",\n \"street\": \"string\",\n \"street2\": \"string\",\n \"city\": \"string\",\n \"postal_code\": \"string\",\n \"state\": \"CA\",\n \"country\": \"US\",\n \"type\": \"organization\",\n \"reg_no\": \"10242424\",\n \"identity\": {\n \"issue_country\": \"US\",\n \"document_number\": \"string\",\n \"issue_date\": \"2024-04-16\",\n \"expiry_date\": \"2024-04-16\",\n \"id_doc_type\": \"Passport\"\n }\n}"
response = http.request(request)
puts response.read_body{
"uuid": "customer_clever12234",
"email": "JohnDoe@mail.com"
}{
"errors": {
"code": "REQUIRE_LOGIN",
"message": "Not Authorised"
}
}{
"errors": {
"amount": "can't be blank"
}
}Authorizations
A unique identifier assigned to each application.
A secure token associated with the app-id.
Body
Customer's email
Customer's first name
Customer's last name
Customer date of birth format 'yyyy-mm-dd'
Customer's phone
"+61-412345678"
Customer's Gender
male, female, other "male"
The primary name of an address's street.
Name of an address's city or town.
The address's postcode
The address's state / province / country. When country is US, CA, or AU, this field is required and must be a valid state/province code for that country (e.g., CA for California, NSW for New South Wales, ON for Ontario).
ISO 3166-1 alpha-2 country code.
Show child attributes
Show child attributes
Customer's middle name
The secondary name of an address's street.
Customer type. Allowed values: individual, organization. If provided, must be one of the valid types.
individual, organization "organization"
Registration number. Required when type is organization.
"10242424"
curl --request POST \
--url https://api.cleverhub.co/api/v2/customers \
--header 'Content-Type: application/json' \
--header 'app-id: <api-key>' \
--header 'secret-key: <api-key>' \
--data '
{
"email": "string",
"first_name": "string",
"last_name": "string",
"middle_name": "string",
"dob": "2024-04-16",
"gender": "male",
"phone": "+61-1234523",
"street": "string",
"street2": "string",
"city": "string",
"postal_code": "string",
"state": "CA",
"country": "US",
"type": "organization",
"reg_no": "10242424",
"identity": {
"issue_country": "US",
"document_number": "string",
"issue_date": "2024-04-16",
"expiry_date": "2024-04-16",
"id_doc_type": "Passport"
}
}
'import requests
url = "https://api.cleverhub.co/api/v2/customers"
payload = {
"email": "string",
"first_name": "string",
"last_name": "string",
"middle_name": "string",
"dob": "2024-04-16",
"gender": "male",
"phone": "+61-1234523",
"street": "string",
"street2": "string",
"city": "string",
"postal_code": "string",
"state": "CA",
"country": "US",
"type": "organization",
"reg_no": "10242424",
"identity": {
"issue_country": "US",
"document_number": "string",
"issue_date": "2024-04-16",
"expiry_date": "2024-04-16",
"id_doc_type": "Passport"
}
}
headers = {
"app-id": "<api-key>",
"secret-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'app-id': '<api-key>',
'secret-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
email: 'string',
first_name: 'string',
last_name: 'string',
middle_name: 'string',
dob: '2024-04-16',
gender: 'male',
phone: '+61-1234523',
street: 'string',
street2: 'string',
city: 'string',
postal_code: 'string',
state: 'CA',
country: 'US',
type: 'organization',
reg_no: '10242424',
identity: {
issue_country: 'US',
document_number: 'string',
issue_date: '2024-04-16',
expiry_date: '2024-04-16',
id_doc_type: 'Passport'
}
})
};
fetch('https://api.cleverhub.co/api/v2/customers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cleverhub.co/api/v2/customers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'email' => 'string',
'first_name' => 'string',
'last_name' => 'string',
'middle_name' => 'string',
'dob' => '2024-04-16',
'gender' => 'male',
'phone' => '+61-1234523',
'street' => 'string',
'street2' => 'string',
'city' => 'string',
'postal_code' => 'string',
'state' => 'CA',
'country' => 'US',
'type' => 'organization',
'reg_no' => '10242424',
'identity' => [
'issue_country' => 'US',
'document_number' => 'string',
'issue_date' => '2024-04-16',
'expiry_date' => '2024-04-16',
'id_doc_type' => 'Passport'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"app-id: <api-key>",
"secret-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.cleverhub.co/api/v2/customers"
payload := strings.NewReader("{\n \"email\": \"string\",\n \"first_name\": \"string\",\n \"last_name\": \"string\",\n \"middle_name\": \"string\",\n \"dob\": \"2024-04-16\",\n \"gender\": \"male\",\n \"phone\": \"+61-1234523\",\n \"street\": \"string\",\n \"street2\": \"string\",\n \"city\": \"string\",\n \"postal_code\": \"string\",\n \"state\": \"CA\",\n \"country\": \"US\",\n \"type\": \"organization\",\n \"reg_no\": \"10242424\",\n \"identity\": {\n \"issue_country\": \"US\",\n \"document_number\": \"string\",\n \"issue_date\": \"2024-04-16\",\n \"expiry_date\": \"2024-04-16\",\n \"id_doc_type\": \"Passport\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("app-id", "<api-key>")
req.Header.Add("secret-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.cleverhub.co/api/v2/customers")
.header("app-id", "<api-key>")
.header("secret-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"string\",\n \"first_name\": \"string\",\n \"last_name\": \"string\",\n \"middle_name\": \"string\",\n \"dob\": \"2024-04-16\",\n \"gender\": \"male\",\n \"phone\": \"+61-1234523\",\n \"street\": \"string\",\n \"street2\": \"string\",\n \"city\": \"string\",\n \"postal_code\": \"string\",\n \"state\": \"CA\",\n \"country\": \"US\",\n \"type\": \"organization\",\n \"reg_no\": \"10242424\",\n \"identity\": {\n \"issue_country\": \"US\",\n \"document_number\": \"string\",\n \"issue_date\": \"2024-04-16\",\n \"expiry_date\": \"2024-04-16\",\n \"id_doc_type\": \"Passport\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cleverhub.co/api/v2/customers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["app-id"] = '<api-key>'
request["secret-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"string\",\n \"first_name\": \"string\",\n \"last_name\": \"string\",\n \"middle_name\": \"string\",\n \"dob\": \"2024-04-16\",\n \"gender\": \"male\",\n \"phone\": \"+61-1234523\",\n \"street\": \"string\",\n \"street2\": \"string\",\n \"city\": \"string\",\n \"postal_code\": \"string\",\n \"state\": \"CA\",\n \"country\": \"US\",\n \"type\": \"organization\",\n \"reg_no\": \"10242424\",\n \"identity\": {\n \"issue_country\": \"US\",\n \"document_number\": \"string\",\n \"issue_date\": \"2024-04-16\",\n \"expiry_date\": \"2024-04-16\",\n \"id_doc_type\": \"Passport\"\n }\n}"
response = http.request(request)
puts response.read_body{
"uuid": "customer_clever12234",
"email": "JohnDoe@mail.com"
}{
"errors": {
"code": "REQUIRE_LOGIN",
"message": "Not Authorised"
}
}{
"errors": {
"amount": "can't be blank"
}
}