Identity & KYC 4 min read

Implementing BVN Verification with IdentityPass in Node.js

A comprehensive guide on securely verifying Bank Verification Numbers (BVN) using IdentityPass for your Nigerian fintech app.

Written By

Build Studio Editorial

Recently Published

Building a Nigerian App?

Discover all the APIs you need in our curated directory.

Browse APIs

Need Development Support?

Reach out for end-to-end app development, API integration, or hire our expert developers to join your team.

Hire Our Team

BVN Verification with IdentityPass

For any fintech application in Nigeria, Identity Verification and KYC (Know Your Customer) are regulatory requirements. IdentityPass (by Prembly) offers robust APIs to handle this.

Getting Started

First, sign up for an IdentityPass account and retrieve your API keys.

The API Request

We will use Node.js and axios to make a server-side request. Never expose your secret keys in your frontend application.

const axios = require('axios');

async function verifyBVN(bvnNumber) {
    try {
        const response = await axios.post(
            'https://api.myidentitypass.com/api/v2/biometrics/merchant/data/verification/bvn',
            { number: bvnNumber },
            {
                headers: {
                    'x-api-key': process.env.IDENTITYPASS_SECRET_KEY,
                    'app-id': process.env.IDENTITYPASS_APP_ID,
                    'Content-Type': 'application/json'
                }
            }
        );

        if (response.data.status) {
            console.log('BVN Data:', response.data.bvn_data);
            return response.data.bvn_data;
        } else {
            throw new Error('Verification failed');
        }
    } catch (error) {
        console.error('Error verifying BVN:', error.response?.data || error.message);
        throw error;
    }
}

Data Handling & Security

  1. Do not store BVN data indefinitely. Only store the validation status or the minimum required information to prevent data exposure.
  2. Rate Limiting. Ensure your endpoint is rate-limited so users do not abuse the BVN checking service, which costs money per API call.
  3. Always use HTTPS.

By following these steps, you can safely integrate IdentityPass BVN checks into your onboarding flow.

Share this guide:
More Resources

Ready to start building?

Explore the most comprehensive directory of APIs for Nigerian developers and find exactly what you need.

Browse the API Directory