API Reference
Customers API
Manage customers with KYC support.
Create Customer
const customer = await afriex.customers.create({
fullName: "John Doe",
email: "john@example.com",
phone: "+1234567890",
countryCode: "US",
kyc: {
// Optional KYC fields
},
meta: {
// Optional metadata
},
});Parameters:
| Field | Type | Required | Description |
|---|---|---|---|
fullName | string | Yes | Customer's full name |
email | string | Yes | Email address |
phone | string | Yes | Phone number with country code |
countryCode | string | Yes | ISO 3166-1 alpha-2 code, (e.g US) |
kyc | object | - | KYC verification data |
meta | object | - | Additional metadata |
Get Customer
const customer = await afriex.customers.get("customer-id");List Customers
const response = await afriex.customers.list({
page: 0,
limit: 20,
email: "john@example.com",
phone: "+2348192837465",
});
console.log(response.data); // Customer[]
console.log(response.total); // Total countemail and phone are optional exact-match filters for narrowing the list.
Update KYC
const customer = await afriex.customers.updateKyc("customer-id", {
kyc: {
documentType: "passport",
documentNumber: "AB123456",
},
});Delete Customer
await afriex.customers.delete("customer-id");