Skip to main content

Overview

The Verification class provides methods for verifying various Paystack entities including bank accounts and card BINs. This helps you validate customer information before processing payments.

Methods

resolveAccount

Resolves a bank account number to an account name. This is useful for confirming the account details before initiating a transfer.
const result = await paystack.verification.resolveAccount({
  account_number: "0123456789",
  bank_code: "058"
});

if (result.data) {
  console.log(result.data.data.account_name);
  console.log(result.data.data.account_number);
}

Parameters

account_number
string
required
The bank account number you want to verify
bank_code
string
required
The bank code of the bank where the account is held. You can get this from the listBanks method

Response

status
boolean
Indicates whether the request was successful
message
string
A message describing the result
data
object
The account details

validateAccount

Validates a customer’s account number using their identity information. This provides enhanced verification beyond simple name resolution.
const result = await paystack.verification.validateAccount({
  account_name: "John Doe",
  account_number: "0123456789",
  account_type: "personal",
  bank_code: "058",
  country_code: "NG",
  document_type: "identityNumber",
  document_number: "1234567890"
});

if (result.data) {
  console.log(result.data.data.verified);
  console.log(result.data.data.verificationMessage);
}

Parameters

account_name
string
required
The name on the account
account_number
string
required
The bank account number to validate
account_type
enum
required
The type of account. Options: personal, business
bank_code
string
required
The bank code where the account is held
country_code
string
required
The country code (e.g., “NG” for Nigeria, “GH” for Ghana)
document_type
enum
required
The type of document being used for verification. Options: identityNumber, passportNumber, businessRegistrationNumber
document_number
string
The document number (optional depending on requirements)

Response

status
boolean
Indicates whether the request was successful
message
string
A message describing the result
data
object
The validation result

resolveCardBin

Resolves a card BIN (Bank Identification Number) to get card and bank details. The first 6 digits of a card number make up the BIN.
const result = await paystack.verification.resolveCardBin({
  card_bin: "539983"
});

if (result.data) {
  console.log(result.data.data.bank);
  console.log(result.data.data.brand);
  console.log(result.data.data.card_type);
  console.log(result.data.data.country_name);
}

Parameters

card_bin
string
required
The first 6 digits of the card number

Response

status
boolean
Indicates whether the request was successful
message
string
A message describing the result
data
object
The card BIN details

Error Handling

All methods return a result object with data and error properties. Always check for errors:
const result = await paystack.verification.resolveAccount({
  account_number: "0123456789",
  bank_code: "058"
});

if (result.error) {
  console.error('Verification failed:', result.error.flatten());
} else if (result.data) {
  console.log('Account name:', result.data.data.account_name);
}