Skip to content

Bank account forms (NUBAN)

Every Nigerian bank account number (NUBAN) has 10 digits, and the last digit is a check digit worked out from the bank’s CBN code and the first 9 digits. naija-data does that calculation, so you can catch a mistyped account number before you send money or call a paid API.

  1. Show a bank dropdown of active banks that have a CBN code (so every choice can be checked).
  2. Check the account number against the chosen bank.
  3. Optionally, confirm the account name with your payment provider (how).
import { banks, getBank, isValidNuban, banksForNuban } from "naija-data";
// 1. Dropdown options: value = id, text = short name
const options = banks()
.filter((b) => b.cbn_code)
.map((b) => ({ value: b.id, label: b.short_name ?? b.name }));
// 2. Check the account number for the chosen bank (id, CBN code or name all work)
isValidNuban("0000014579", "first-bank"); // true
isValidNuban("0000014578", "first-bank"); // false: probably a typo
// Don't know the bank? List the banks the number could belong to.
banksForNuban("0000014579").map((b) => b.name);
getBank("GTB")?.cbn_code; // "058"

OPay, PalmPay and similar wallets are not in the NUBAN check: they have no CBN bank code, and their account number is usually the customer’s phone number without its first 0. To accept them:

import { parsePhone } from "naija-data";
const looksLikeWallet = parsePhone("0" + "8031234567")?.type === "mobile"; // true

Then confirm the account with your payment provider, using the provider’s code for that wallet.

  • Bank status. banks() returns active institutions only. Pass activeOnly = false / active_only=False to include banks that merged or lost their licence (each has status and status_date).
  • Types. type is one of commercial, merchant, non_interest, payment_service_bank, mobile_money_operator, microfinance, mortgage, development_finance.
  • Codes. cbn_code (3 digits for banks, 5 for others) is used for NUBAN; nip_code (6 digits) is the NIBSS instant-payment code where known. Codes confirmed by only one source are listed in unverified_fields.
  • Source: the CBN’s register of licensed financial institutions; codes cross-checked between providers.