Skip to content

Verification

The Verification resource allows you to perform KYC (Know Your Customer) processes, such as confirming account numbers and validating customer details. This is crucial for ensuring you are sending money to the correct person and preventing fraud.

Resolve Account Number

Confirm that an account number belongs to the expected customer. This feature is available to businesses in Nigeria and Ghana.

Method Signature

php
paystack()->verification()->resolveAccount(string $accountNumber, string $bankCode): array

Parameters

ParameterTypeDescription
accountNumberstringThe account number to resolve.
bankCodestringThe bank code (use paystack()->miscellaneous()->listBanks() to get codes).

Example

php
// Resolve a GTBank account number
$details = paystack()->verification()->resolveAccount('0123456789', '058');

// Accessing the account name
echo $details['data']['account_name']; // e.g., "Stephen Asare"

Validate Account (South Africa)

Confirm the authenticity of a customer's account details. This is a more rigorous check used primarily in South Africa for KYC compliance.

Method Signature

php
paystack()->verification()->validateAccount(array $payload): array

Parameters

ParameterTypeDescription
account_namestringCustomer's registered name.
account_numberstringCustomer's account number.
account_typestringpersonal or business.
bank_codestringThe bank code.
country_codestringISO code (e.g., ZA).
document_typestringidentityNumber, passportNumber, or businessRegistrationNumber.
document_numberstringThe ID number corresponding to the document type.

Example

php
$validation = paystack()->verification()->validateAccount([
    'bank_code' => '632005', // Absa Bank
    'country_code' => 'ZA',
    'account_number' => '0123456789',
    'account_name' => 'Ann Bron',
    'account_type' => 'personal',
    'document_type' => 'identityNumber',
    'document_number' => '1234567890123'
]);

Resolve Card BIN

Get information about a card using its first 6 digits (BIN - Bank Identification Number). This helps identify the card brand, issuing bank, and country.

Method Signature

php
paystack()->verification()->resolveCardBin(string $bin): array

Parameters

ParameterTypeDescription
binstringFirst 6 digits of the card number.

Example

php
$cardInfo = paystack()->verification()->resolveCardBin('539983');

// Output: Mastercard, Guaranty Trust Bank, Nigeria

Use Cases

1. Verifying Beneficiaries Before Transfer

Before adding a transfer recipient, it is best practice to resolve the account number to ensure the name matches what the user provided.

php
$accountNumber = '0001234567';
$bankCode = '058';
$providedName = 'Stephen Asare';

try {
    $resolved = paystack()->verification()->resolveAccount($accountNumber, $bankCode);
    $bankAccountName = $resolved['data']['account_name'];

    // Simple fuzzy match or direct comparison
    if (strtoupper($bankAccountName) === strtoupper($providedName)) {
        // Proceed to create recipient
        paystack()->transferRecipient()->create([
            'type' => 'nuban',
            'name' => $bankAccountName,
            'account_number' => $accountNumber,
            'bank_code' => $bankCode,
            'currency' => 'NGN'
        ]);
    } else {
        throw new Exception("Account name mismatch: $bankAccountName vs $providedName");
    }
} catch (\Exception $e) {
    // Handle invalid account
}

2. Fraud Detection with Card BIN

You can use the BIN resolution to block cards from specific countries or to verify if a card is prepaid vs debit.

php
$bin = substr($cardNumber, 0, 6);
$details = paystack()->verification()->resolveCardBin($bin);

if ($details['data']['country_code'] !== 'NG') {
    // Flag transaction for manual review if you only expect local cards
}

Released under the MIT License.