const customer = await afriex.customers.updateKyc("customer-id", {
kyc: {
documentType: "passport",
documentNumber: "AB123456",
},
});
curl --request PATCH \
--url https://sandbox.api.afriex.com/api/v1/customer/{customerId}/kyc \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"PASSPORT": "A12345678",
"DATE_OF_BIRTH": "1990-05-15"
}
'import requests
url = "https://sandbox.api.afriex.com/api/v1/customer/{customerId}/kyc"
payload = {
"PASSPORT": "A12345678",
"DATE_OF_BIRTH": "1990-05-15"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({PASSPORT: 'A12345678', DATE_OF_BIRTH: '1990-05-15'})
};
fetch('https://sandbox.api.afriex.com/api/v1/customer/{customerId}/kyc', 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://sandbox.api.afriex.com/api/v1/customer/{customerId}/kyc",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'PASSPORT' => 'A12345678',
'DATE_OF_BIRTH' => '1990-05-15'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-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://sandbox.api.afriex.com/api/v1/customer/{customerId}/kyc"
payload := strings.NewReader("{\n \"PASSPORT\": \"A12345678\",\n \"DATE_OF_BIRTH\": \"1990-05-15\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-api-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.patch("https://sandbox.api.afriex.com/api/v1/customer/{customerId}/kyc")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"PASSPORT\": \"A12345678\",\n \"DATE_OF_BIRTH\": \"1990-05-15\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.api.afriex.com/api/v1/customer/{customerId}/kyc")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"PASSPORT\": \"A12345678\",\n \"DATE_OF_BIRTH\": \"1990-05-15\"\n}"
response = http.request(request)
puts response.read_bodyUpdate Customer KYC
Partially updates a customer’s KYC information.
const customer = await afriex.customers.updateKyc("customer-id", {
kyc: {
documentType: "passport",
documentNumber: "AB123456",
},
});
curl --request PATCH \
--url https://sandbox.api.afriex.com/api/v1/customer/{customerId}/kyc \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"PASSPORT": "A12345678",
"DATE_OF_BIRTH": "1990-05-15"
}
'import requests
url = "https://sandbox.api.afriex.com/api/v1/customer/{customerId}/kyc"
payload = {
"PASSPORT": "A12345678",
"DATE_OF_BIRTH": "1990-05-15"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({PASSPORT: 'A12345678', DATE_OF_BIRTH: '1990-05-15'})
};
fetch('https://sandbox.api.afriex.com/api/v1/customer/{customerId}/kyc', 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://sandbox.api.afriex.com/api/v1/customer/{customerId}/kyc",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'PASSPORT' => 'A12345678',
'DATE_OF_BIRTH' => '1990-05-15'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-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://sandbox.api.afriex.com/api/v1/customer/{customerId}/kyc"
payload := strings.NewReader("{\n \"PASSPORT\": \"A12345678\",\n \"DATE_OF_BIRTH\": \"1990-05-15\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-api-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.patch("https://sandbox.api.afriex.com/api/v1/customer/{customerId}/kyc")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"PASSPORT\": \"A12345678\",\n \"DATE_OF_BIRTH\": \"1990-05-15\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.api.afriex.com/api/v1/customer/{customerId}/kyc")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"PASSPORT\": \"A12345678\",\n \"DATE_OF_BIRTH\": \"1990-05-15\"\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
Static business API key issued from the dashboard. A business can provision multiple API keys, each scoped to a configurable set of permissions (e.g. read transactions, create deposits, etc). Permissions are chosen per key at creation time in the dashboard and may be revoked by deleting the key. Requests made with a key that does not include the permission required by the target endpoint is rejected with a 401 Unauthorized response, the same response an unrecognised, malformed or revoked key returns. The API does not distinguish the two cases on the wire. Manage your keys and their permissions under Developer → API keys in the dashboard.
Headers
API version in ISO 8601 format. The only supported version is 2026-05-18, which is also the default when the header is omitted. Any other value is rejected with a 400 Bad Request.
Path Parameters
The unique identifier of the customer
Body
A flat map of KYC document types to their values. Send the document map directly as the request body (do not wrap it in a kyc field). Each key must be one of the allowed KYC document types and each value is a string.
PHONE and COUNTRY are not accepted here; they are profile fields owned by PATCH /api/v1/customer/{customerId}. BVN is not accepted either; it is owned by POST /api/v1/customer/{customerId}/verify, which writes it only after a successful bank verification. Sending any of the three returns 400 INVALID_KYC_DOCUMENT_TYPE.
Response
Customer updated successfully.
Show child attributes
Show child attributes
