curl --request POST \
--url https://api.fernhq.com/customers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "john.doe@example.com",
"firstName": "John",
"lastName": "Doe",
"businessName": "John Doe Inc."
}
'import requests
url = "https://api.fernhq.com/customers"
payload = {
"email": "john.doe@example.com",
"firstName": "John",
"lastName": "Doe",
"businessName": "John Doe Inc."
}
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({
email: 'john.doe@example.com',
firstName: 'John',
lastName: 'Doe',
businessName: 'John Doe Inc.'
})
};
fetch('https://api.fernhq.com/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.fernhq.com/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' => 'john.doe@example.com',
'firstName' => 'John',
'lastName' => 'Doe',
'businessName' => 'John Doe Inc.'
]),
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.fernhq.com/customers"
payload := strings.NewReader("{\n \"email\": \"john.doe@example.com\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"businessName\": \"John Doe Inc.\"\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.fernhq.com/customers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"john.doe@example.com\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"businessName\": \"John Doe Inc.\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fernhq.com/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 \"email\": \"john.doe@example.com\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"businessName\": \"John Doe Inc.\"\n}"
response = http.request(request)
puts response.read_body{
"customerId": "03b7030f-6da1-4d76-9352-cdebd82112c8",
"customerStatus": "ACTIVE",
"customerType": "INDIVIDUAL",
"name": "John Doe",
"email": "johndoe@example.com",
"verificationLink": "https://forms.fernhq.com/verify-customer/03b7030f-6da1-4d76-9352-cdebd82112c8",
"updatedAt": "2023-10-01T12:00:00Z",
"organizationId": "8469411c-48c1-4e26-a032-44688be9cb4b"
}Create customer
Upon successful customer creation, a hosted KYC link requesting the required information to fill in will be generated. This may be distributed to your end-user for completion, or it can be completed on the customer’s behalf by your team.
curl --request POST \
--url https://api.fernhq.com/customers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "john.doe@example.com",
"firstName": "John",
"lastName": "Doe",
"businessName": "John Doe Inc."
}
'import requests
url = "https://api.fernhq.com/customers"
payload = {
"email": "john.doe@example.com",
"firstName": "John",
"lastName": "Doe",
"businessName": "John Doe Inc."
}
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({
email: 'john.doe@example.com',
firstName: 'John',
lastName: 'Doe',
businessName: 'John Doe Inc.'
})
};
fetch('https://api.fernhq.com/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.fernhq.com/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' => 'john.doe@example.com',
'firstName' => 'John',
'lastName' => 'Doe',
'businessName' => 'John Doe Inc.'
]),
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.fernhq.com/customers"
payload := strings.NewReader("{\n \"email\": \"john.doe@example.com\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"businessName\": \"John Doe Inc.\"\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.fernhq.com/customers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"john.doe@example.com\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"businessName\": \"John Doe Inc.\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fernhq.com/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 \"email\": \"john.doe@example.com\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"businessName\": \"John Doe Inc.\"\n}"
response = http.request(request)
puts response.read_body{
"customerId": "03b7030f-6da1-4d76-9352-cdebd82112c8",
"customerStatus": "ACTIVE",
"customerType": "INDIVIDUAL",
"name": "John Doe",
"email": "johndoe@example.com",
"verificationLink": "https://forms.fernhq.com/verify-customer/03b7030f-6da1-4d76-9352-cdebd82112c8",
"updatedAt": "2023-10-01T12:00:00Z",
"organizationId": "8469411c-48c1-4e26-a032-44688be9cb4b"
}Authorizations
To authenticate server-side requests
Body
Request payload for creating a new customer account with optional KYC data
Request payload for creating a new customer account with optional KYC data
The type of customer - either individual or business
INDIVIDUAL, BUSINESS Email of the customer
"john.doe@example.com"
First name of the customer
"John"
Last name of the customer
"Doe"
Name of the business
"John Doe Inc."
Optional KYC data for immediate verification submission.
Show child attributes
Show child attributes
Optional KYB data for immediate verification submission.
Show child attributes
Show child attributes
Response
Response schema for a customer retrieval request
Response schema for a customer retrieval request
Unique identifier of the customer
"abc123"
Current status of the customer
CREATED, UNDER_REVIEW, NEEDS_ADDITIONAL_INFORMATION, ACTIVE, REJECTED, DEACTIVATED "ACTIVE"
Email of the customer
"john.doe@example.com"
The type of customer - either individual or business
INDIVIDUAL, BUSINESS Full name of the customer or business
"John Doe"
URL for KYC/KYB verification process
"https://forms.fernhq.com/verify-customer/0423300f-ae6d-4e82-8afb-a3b430e22e29"
Timestamp of the last status update
Organization identifier
"8469411c-48c1-4e26-a032-44688be9cb4b"
Available payment methods for the customer
[
"ACH",
"WIRE",
"SEPA",
"CA_INTERAC",
"IN_NEFT_RTGS_IMPS",
"ARBITRUM",
"BASE",
"ETHEREUM",
"OPTIMISM",
"POLYGON",
"SOLANA"
]
Current verification issues blocking customer approval. Only present for customers in NEEDS_ADDITIONAL_INFORMATION, UNDER_REVIEW, or REJECTED status.
Show child attributes
Show child attributes
[
{
"code": "DOCUMENT_MISSING_BACK",
"message": "Please upload clear photos of both the front and back of your ID.",
"timestamp": "2023-10-01T12:00:00Z"
}
]
Was this page helpful?