Interswitch Customer Insights API
Access customer demographics, financial transaction history, and spending patterns for KYC verification, credit scoring, and service personalization.
Insight Categories
| Category |
Data Available |
| Demographics |
Name, age, gender, location, phone, email |
| Financial History |
Transaction history, account balances, income patterns |
| Financial Habits |
Spending categories, frequency, average amounts |
Endpoints
| Endpoint |
Method |
Description |
/api/v1/customer-insights/demographics |
POST |
Get demographic data |
/api/v1/customer-insights/financial-history |
POST |
Get transaction history |
/api/v1/customer-insights/financial-habits |
POST |
Get spending patterns |
Customer Demographics
interface DemographicsRequest {
customerId: string; // BVN, phone, or account number
idType: 'BVN' | 'PHONE' | 'ACCOUNT';
consent: boolean; // Customer consent required
}
interface DemographicsResponse {
responseCode: string;
data: {
firstName: string;
lastName: string;
middleName?: string;
dateOfBirth: string;
gender: string;
phoneNumber: string;
email?: string;
address?: string;
state?: string;
lga?: string;
nationality: string;
bvn?: string;
};
}
async function getCustomerDemographics(
data: DemographicsRequest
): Promise<DemographicsResponse> {
const headers = await getAuthHeaders();
const response = await fetch(
`${process.env.INTERSWITCH_BASE_URL}/api/v1/customer-insights/demographics`,
{
method: 'POST',
headers: { ...headers, 'Content-Type': 'application/json' },
body: JSON.stringify(data),
}
);
return response.json();
}
Financial History
interface FinancialHistoryRequest {
customerId: string;
idType: 'BVN' | 'PHONE' | 'ACCOUNT';
startDate: string; // YYYY-MM-DD
endDate: string; // YYYY-MM-DD
consent: boolean;
}
interface TransactionRecord {
date: string;
amount: number;
type: 'CREDIT' | 'DEBIT';
description: string;
category: string;
channel: string;
balance?: number;
}
interface FinancialHistoryResponse {
responseCode: string;
data: {
totalCredits: number;
totalDebits: number;
averageBalance: number;
transactions: TransactionRecord[];
incomePattern: {
averageMonthlyIncome: number;
incomeFrequency: string;
primaryIncomeSource: string;
};
};
}
async function getFinancialHistory(
data: FinancialHistoryRequest
): Promise<FinancialHistoryResponse> {
const headers = await getAuthHeaders();
const response = await fetch(
`${process.env.INTERSWITCH_BASE_URL}/api/v1/customer-insights/financial-history`,
{
method: 'POST',
headers: { ...headers, 'Content-Type': 'application/json' },
body: JSON.stringify(data),
}
);
return response.json();
}
Financial Habits
interface FinancialHabitsRequest {
customerId: string;
idType: 'BVN' | 'PHONE' | 'ACCOUNT';
period: number; // Months to analyze
consent: boolean;
}
interface SpendingCategory {
category: string; // e.g., 'Food', 'Transport', 'Bills'
totalAmount: number;
percentage: number;
transactionCount: number;
averageAmount: number;
}
interface FinancialHabitsResponse {
responseCode: string;
data: {
spendingCategories: SpendingCategory[];
savingsRate: number;
transactionFrequency: {
daily: number;
weekly: number;
monthly: number;
};
preferredChannels: {
channel: string; // 'POS', 'ATM', 'Web', 'Mobile'
percentage: number;
}[];
riskScore: number; // 0-100 risk assessment
};
}
async function getFinancialHabits(
data: FinancialHabitsRequest
): Promise<FinancialHabitsResponse> {
const headers = await getAuthHeaders();
const response = await fetch(
`${process.env.INTERSWITCH_BASE_URL}/api/v1/customer-insights/financial-habits`,
{
method: 'POST',
headers: { ...headers, 'Content-Type': 'application/json' },
body: JSON.stringify(data),
}
);
return response.json();
}
Complete KYC Flow
// 1. Get demographics for identity verification
const demographics = await getCustomerDemographics({
customerId: '22123456789', // BVN
idType: 'BVN',
consent: true,
});
console.log('Customer:', demographics.data.firstName, demographics.data.lastName);
// 2. Get financial history for credit assessment
const history = await getFinancialHistory({
customerId: '22123456789',
idType: 'BVN',
startDate: '2024-01-01',
endDate: '2024-12-31',
consent: true,
});
console.log('Monthly income:', history.data.incomePattern.averageMonthlyIncome / 100);
console.log('Total credits:', history.data.totalCredits / 100);
// 3. Get spending habits for risk profiling
const habits = await getFinancialHabits({
customerId: '22123456789',
idType: 'BVN',
period: 6,
consent: true,
});
console.log('Risk score:', habits.data.riskScore);
console.log('Top spending:', habits.data.spendingCategories[0]);
Data Privacy & Compliance
- Customer consent is mandatory — Always set
consent: true only after explicit consent
- NDPR compliance — Follow Nigeria Data Protection Regulation
- Data minimization — Only request data you actually need
- Secure storage — Encrypt all customer insight data at rest
- Access logging — Log all data access for audit trails
- Data retention — Implement retention policies per regulatory requirements
- Right to erasure — Honor customer requests to delete their data
1---2name: interswitch-customer-insights3description: Interswitch Customer Insights API — access customer demographics, financial history, and spending habits for KYC, credit scoring, and personalization. Use this skill whenever performing KYC checks, building credit scoring models, analyzing customer financial behavior, verifying customer identity, or implementing data-driven personalization. Also use when you see references to customer demographics, financial history, spending habits, or /api/v1/customer-insights endpoints.4---56# Interswitch Customer Insights API78Access customer demographics, financial transaction history, and spending patterns for KYC verification, credit scoring, and service personalization.910## Insight Categories1112| Category | Data Available |13| --- | --- |14| Demographics | Name, age, gender, location, phone, email |15| Financial History | Transaction history, account balances, income patterns |16| Financial Habits | Spending categories, frequency, average amounts |1718## Endpoints1920| Endpoint | Method | Description |21| --- | --- | --- |22| `/api/v1/customer-insights/demographics` | POST | Get demographic data |23| `/api/v1/customer-insights/financial-history` | POST | Get transaction history |24| `/api/v1/customer-insights/financial-habits` | POST | Get spending patterns |2526## Customer Demographics2728```typescript29interface DemographicsRequest {30 customerId: string; // BVN, phone, or account number31 idType: 'BVN' | 'PHONE' | 'ACCOUNT';32 consent: boolean; // Customer consent required33}3435interface DemographicsResponse {36 responseCode: string;37 data: {38 firstName: string;39 lastName: string;40 middleName?: string;41 dateOfBirth: string;42 gender: string;43 phoneNumber: string;44 email?: string;45 address?: string;46 state?: string;47 lga?: string;48 nationality: string;49 bvn?: string;50 };51}5253async function getCustomerDemographics(54 data: DemographicsRequest55): Promise<DemographicsResponse> {56 const headers = await getAuthHeaders();5758 const response = await fetch(59 `${process.env.INTERSWITCH_BASE_URL}/api/v1/customer-insights/demographics`,60 {61 method: 'POST',62 headers: { ...headers, 'Content-Type': 'application/json' },63 body: JSON.stringify(data),64 }65 );6667 return response.json();68}69```7071## Financial History7273```typescript74interface FinancialHistoryRequest {75 customerId: string;76 idType: 'BVN' | 'PHONE' | 'ACCOUNT';77 startDate: string; // YYYY-MM-DD78 endDate: string; // YYYY-MM-DD79 consent: boolean;80}8182interface TransactionRecord {83 date: string;84 amount: number;85 type: 'CREDIT' | 'DEBIT';86 description: string;87 category: string;88 channel: string;89 balance?: number;90}9192interface FinancialHistoryResponse {93 responseCode: string;94 data: {95 totalCredits: number;96 totalDebits: number;97 averageBalance: number;98 transactions: TransactionRecord[];99 incomePattern: {100 averageMonthlyIncome: number;101 incomeFrequency: string;102 primaryIncomeSource: string;103 };104 };105}106107async function getFinancialHistory(108 data: FinancialHistoryRequest109): Promise<FinancialHistoryResponse> {110 const headers = await getAuthHeaders();111112 const response = await fetch(113 `${process.env.INTERSWITCH_BASE_URL}/api/v1/customer-insights/financial-history`,114 {115 method: 'POST',116 headers: { ...headers, 'Content-Type': 'application/json' },117 body: JSON.stringify(data),118 }119 );120121 return response.json();122}123```124125## Financial Habits126127```typescript128interface FinancialHabitsRequest {129 customerId: string;130 idType: 'BVN' | 'PHONE' | 'ACCOUNT';131 period: number; // Months to analyze132 consent: boolean;133}134135interface SpendingCategory {136 category: string; // e.g., 'Food', 'Transport', 'Bills'137 totalAmount: number;138 percentage: number;139 transactionCount: number;140 averageAmount: number;141}142143interface FinancialHabitsResponse {144 responseCode: string;145 data: {146 spendingCategories: SpendingCategory[];147 savingsRate: number;148 transactionFrequency: {149 daily: number;150 weekly: number;151 monthly: number;152 };153 preferredChannels: {154 channel: string; // 'POS', 'ATM', 'Web', 'Mobile'155 percentage: number;156 }[];157 riskScore: number; // 0-100 risk assessment158 };159}160161async function getFinancialHabits(162 data: FinancialHabitsRequest163): Promise<FinancialHabitsResponse> {164 const headers = await getAuthHeaders();165166 const response = await fetch(167 `${process.env.INTERSWITCH_BASE_URL}/api/v1/customer-insights/financial-habits`,168 {169 method: 'POST',170 headers: { ...headers, 'Content-Type': 'application/json' },171 body: JSON.stringify(data),172 }173 );174175 return response.json();176}177```178179## Complete KYC Flow180181```typescript182// 1. Get demographics for identity verification183const demographics = await getCustomerDemographics({184 customerId: '22123456789', // BVN185 idType: 'BVN',186 consent: true,187});188189console.log('Customer:', demographics.data.firstName, demographics.data.lastName);190191// 2. Get financial history for credit assessment192const history = await getFinancialHistory({193 customerId: '22123456789',194 idType: 'BVN',195 startDate: '2024-01-01',196 endDate: '2024-12-31',197 consent: true,198});199200console.log('Monthly income:', history.data.incomePattern.averageMonthlyIncome / 100);201console.log('Total credits:', history.data.totalCredits / 100);202203// 3. Get spending habits for risk profiling204const habits = await getFinancialHabits({205 customerId: '22123456789',206 idType: 'BVN',207 period: 6,208 consent: true,209});210211console.log('Risk score:', habits.data.riskScore);212console.log('Top spending:', habits.data.spendingCategories[0]);213```214215## Data Privacy & Compliance2162171. **Customer consent is mandatory** — Always set `consent: true` only after explicit consent2182. **NDPR compliance** — Follow Nigeria Data Protection Regulation2193. **Data minimization** — Only request data you actually need2204. **Secure storage** — Encrypt all customer insight data at rest2215. **Access logging** — Log all data access for audit trails2226. **Data retention** — Implement retention policies per regulatory requirements2237. **Right to erasure** — Honor customer requests to delete their data