API Documentation for Bank Validation Functionality

This documentation provides step-by-step guidance for developers to integrate functionalities for validating bank account V1 using PHP cURL or NodeJs. Each section includes the method, endpoint, request parameters, and sample responses.


POST https://mybundlepay.com/api/resolve-bank-account

HEADERS

Authorization* string

Pass your {secret_key} as a bearer token in the request header to authorize this call

Accept: application/json

REQUEST PARAMETERS*

Parameter Type Required Description Example
account_number string Yes The account number you want to validate. Must be a valid bank account number with a maximum length of 10. "1234567890"
bank_code string Yes The code identifying the bank where the account is held. This must correspond to a valid bank in the system. "044"

Details for Request Parameters:


  1. account_number:
    • This is the account number you want to validate.
    • It must be a string, even if it contains only numeric characters.
    • Ensure the length does not exceed 10 characters to meet validation requirements.
    • Example: "1234567890"
  2. bank_code:
    • This parameter identifies the bank associated with the provided account number.
    • Use the correct code for the bank as defined in the system. You can fetch the list of valid bank codes using the Fetch Banks API.
    • Example: "044" (Code for Access Bank in Nigeria).

< ?php
$token = 'sec-live-your-token-here';

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://mybundlepay.com/api/resolve-bank-account');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
    'account_number' => '2328990453',
    'bank_code' => '043'
]));

curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Authorization: Bearer ' . $token,
    'Content-Type: application/json',
    'Accept: application/json',
]);

$response = curl_exec($ch);
curl_close($ch);

echo $response;
?>

                                

const axios = require('axios');

const url = "https://mybundlepay.com/api/resolve-bank-account";
const secretKey = "{secret_key}";

const requestBody = {
    account_number: "1234567890",
    bank_code: "044"
};

const headers = {
    Authorization: `Bearer ${secretKey}`,
    "Content-Type": "application/json",
    Accept: "application/json",
};

const validateBankAccount = async () => {
    try {
        const response = await axios.post(url, requestBody, { headers });
        const responseData = response.data;

        if (responseData.status === "success") {
            console.log("Account validation successful:", responseData.data);
        } else {
            console.log("Validation failed:", responseData.message);
        }
    } catch (error) {
        console.error("API error:", error.response?.data?.message || error.message);
    }
};

validateBankAccount();

                                

Live Token Success Response


{
    "status": "success",
    "message": "Account resolved successfully.",
    "data": {
        "account_number": "1234567890",
        "account_name": "Ahamad Musa",
    }
}

                        

Test Token Success Response


{
    "status": "success",
    "message": "success",
    "data": {
        "account_number": "1234567890",
        "account_name": "MYBUNDLEPAY TEST",
    }
}

                        

Error Response (Invalid Bank Code)


{
    "status": "failed",
    "message": "Bank code is either incorrect or not supported."
}

                        

Error Response (KYC Not Approved)


{
    "status": "failed",
    "message": "KYC not approved"
}