Create a customer
curl --request POST \
--url https://api.kemycard.com/v1/customers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"external_reference": "user-123",
"first_name": "John",
"last_name": "Doe",
"email": "[email protected]",
"phone_country_code": "+33",
"phone": "612345678",
"date_of_birth": "1990-05-15",
"address": "123 Main Street",
"city": "Paris",
"state": "IDF",
"postal_code": "75001",
"country": "FRA",
"metadata": {
"plan": "premium"
}
}
'import requests
url = "https://api.kemycard.com/v1/customers"
payload = {
"external_reference": "user-123",
"first_name": "John",
"last_name": "Doe",
"email": "[email protected]",
"phone_country_code": "+33",
"phone": "612345678",
"date_of_birth": "1990-05-15",
"address": "123 Main Street",
"city": "Paris",
"state": "IDF",
"postal_code": "75001",
"country": "FRA",
"metadata": { "plan": "premium" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
external_reference: 'user-123',
first_name: 'John',
last_name: 'Doe',
email: '[email protected]',
phone_country_code: '+33',
phone: '612345678',
date_of_birth: '1990-05-15',
address: '123 Main Street',
city: 'Paris',
state: 'IDF',
postal_code: '75001',
country: 'FRA',
metadata: {plan: 'premium'}
})
};
fetch('https://api.kemycard.com/v1/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.kemycard.com/v1/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([
'external_reference' => 'user-123',
'first_name' => 'John',
'last_name' => 'Doe',
'email' => '[email protected]',
'phone_country_code' => '+33',
'phone' => '612345678',
'date_of_birth' => '1990-05-15',
'address' => '123 Main Street',
'city' => 'Paris',
'state' => 'IDF',
'postal_code' => '75001',
'country' => 'FRA',
'metadata' => [
'plan' => 'premium'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.kemycard.com/v1/customers"
payload := strings.NewReader("{\n \"external_reference\": \"user-123\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"email\": \"[email protected]\",\n \"phone_country_code\": \"+33\",\n \"phone\": \"612345678\",\n \"date_of_birth\": \"1990-05-15\",\n \"address\": \"123 Main Street\",\n \"city\": \"Paris\",\n \"state\": \"IDF\",\n \"postal_code\": \"75001\",\n \"country\": \"FRA\",\n \"metadata\": {\n \"plan\": \"premium\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.kemycard.com/v1/customers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"external_reference\": \"user-123\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"email\": \"[email protected]\",\n \"phone_country_code\": \"+33\",\n \"phone\": \"612345678\",\n \"date_of_birth\": \"1990-05-15\",\n \"address\": \"123 Main Street\",\n \"city\": \"Paris\",\n \"state\": \"IDF\",\n \"postal_code\": \"75001\",\n \"country\": \"FRA\",\n \"metadata\": {\n \"plan\": \"premium\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kemycard.com/v1/customers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"external_reference\": \"user-123\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"email\": \"[email protected]\",\n \"phone_country_code\": \"+33\",\n \"phone\": \"612345678\",\n \"date_of_birth\": \"1990-05-15\",\n \"address\": \"123 Main Street\",\n \"city\": \"Paris\",\n \"state\": \"IDF\",\n \"postal_code\": \"75001\",\n \"country\": \"FRA\",\n \"metadata\": {\n \"plan\": \"premium\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"code": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"external_reference": "user-123",
"first_name": "John",
"last_name": "Doe",
"email": "[email protected]",
"phone_country_code": "+33",
"phone": "612345678",
"date_of_birth": "1990-05-15",
"address": "123 Main Street",
"city": "Paris",
"state": "IDF",
"postal_code": "75001",
"country": "FRA",
"verification_level": "basic",
"kyc_status": "not_started",
"poa_status": "not_started",
"verified_identity": {
"first_name": "John",
"last_name": "Doe",
"date_of_birth": "1990-05-15"
},
"identity_mismatch": false,
"status": "active",
"restriction_reason": null,
"metadata": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"meta": {
"request_id": "a4f8e2c1b3d97056",
"mode": "test",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Missing required fields.",
"details": {}
},
"meta": {
"request_id": "a4f8e2c1b3d97056",
"mode": "test",
"timestamp": "2023-11-07T05:31:56Z"
}
}Customers
Create a Customer
Creates a new customer with verification level basic. All fields are required except metadata.
POST
/
customers
Create a customer
curl --request POST \
--url https://api.kemycard.com/v1/customers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"external_reference": "user-123",
"first_name": "John",
"last_name": "Doe",
"email": "[email protected]",
"phone_country_code": "+33",
"phone": "612345678",
"date_of_birth": "1990-05-15",
"address": "123 Main Street",
"city": "Paris",
"state": "IDF",
"postal_code": "75001",
"country": "FRA",
"metadata": {
"plan": "premium"
}
}
'import requests
url = "https://api.kemycard.com/v1/customers"
payload = {
"external_reference": "user-123",
"first_name": "John",
"last_name": "Doe",
"email": "[email protected]",
"phone_country_code": "+33",
"phone": "612345678",
"date_of_birth": "1990-05-15",
"address": "123 Main Street",
"city": "Paris",
"state": "IDF",
"postal_code": "75001",
"country": "FRA",
"metadata": { "plan": "premium" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
external_reference: 'user-123',
first_name: 'John',
last_name: 'Doe',
email: '[email protected]',
phone_country_code: '+33',
phone: '612345678',
date_of_birth: '1990-05-15',
address: '123 Main Street',
city: 'Paris',
state: 'IDF',
postal_code: '75001',
country: 'FRA',
metadata: {plan: 'premium'}
})
};
fetch('https://api.kemycard.com/v1/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.kemycard.com/v1/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([
'external_reference' => 'user-123',
'first_name' => 'John',
'last_name' => 'Doe',
'email' => '[email protected]',
'phone_country_code' => '+33',
'phone' => '612345678',
'date_of_birth' => '1990-05-15',
'address' => '123 Main Street',
'city' => 'Paris',
'state' => 'IDF',
'postal_code' => '75001',
'country' => 'FRA',
'metadata' => [
'plan' => 'premium'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.kemycard.com/v1/customers"
payload := strings.NewReader("{\n \"external_reference\": \"user-123\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"email\": \"[email protected]\",\n \"phone_country_code\": \"+33\",\n \"phone\": \"612345678\",\n \"date_of_birth\": \"1990-05-15\",\n \"address\": \"123 Main Street\",\n \"city\": \"Paris\",\n \"state\": \"IDF\",\n \"postal_code\": \"75001\",\n \"country\": \"FRA\",\n \"metadata\": {\n \"plan\": \"premium\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.kemycard.com/v1/customers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"external_reference\": \"user-123\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"email\": \"[email protected]\",\n \"phone_country_code\": \"+33\",\n \"phone\": \"612345678\",\n \"date_of_birth\": \"1990-05-15\",\n \"address\": \"123 Main Street\",\n \"city\": \"Paris\",\n \"state\": \"IDF\",\n \"postal_code\": \"75001\",\n \"country\": \"FRA\",\n \"metadata\": {\n \"plan\": \"premium\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kemycard.com/v1/customers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"external_reference\": \"user-123\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"email\": \"[email protected]\",\n \"phone_country_code\": \"+33\",\n \"phone\": \"612345678\",\n \"date_of_birth\": \"1990-05-15\",\n \"address\": \"123 Main Street\",\n \"city\": \"Paris\",\n \"state\": \"IDF\",\n \"postal_code\": \"75001\",\n \"country\": \"FRA\",\n \"metadata\": {\n \"plan\": \"premium\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"code": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"external_reference": "user-123",
"first_name": "John",
"last_name": "Doe",
"email": "[email protected]",
"phone_country_code": "+33",
"phone": "612345678",
"date_of_birth": "1990-05-15",
"address": "123 Main Street",
"city": "Paris",
"state": "IDF",
"postal_code": "75001",
"country": "FRA",
"verification_level": "basic",
"kyc_status": "not_started",
"poa_status": "not_started",
"verified_identity": {
"first_name": "John",
"last_name": "Doe",
"date_of_birth": "1990-05-15"
},
"identity_mismatch": false,
"status": "active",
"restriction_reason": null,
"metadata": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"meta": {
"request_id": "a4f8e2c1b3d97056",
"mode": "test",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Missing required fields.",
"details": {}
},
"meta": {
"request_id": "a4f8e2c1b3d97056",
"mode": "test",
"timestamp": "2023-11-07T05:31:56Z"
}
}Authorizations
API key (sk_test_... or sk_live_...)
Body
application/json
Your internal user ID
Example:
"user-123"
Example:
"John"
Example:
"Doe"
Example:
International dialing code, + followed by 1 to 4 digits
Pattern:
^\+\d{1,4}$Example:
"+33"
Phone number, without the dialing code
Example:
"612345678"
Example:
"1990-05-15"
Example:
"123 Main Street"
Example:
"Paris"
Example:
"IDF"
Example:
"75001"
ISO 3166-1 alpha-3 country code
Pattern:
^[A-Z]{3}$Example:
"FRA"
Arbitrary key-value data
Example:
{ "plan": "premium" }