Afriex SDK
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:

FieldTypeRequiredDescription
fullNamestringYesCustomer's full name
emailstringYesEmail address
phonestringYesPhone number with country code
countryCodestringYesISO 3166-1 alpha-2 code, (e.g US)
kycobject-KYC verification data
metaobject-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 count

email 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");

On this page