
Real-time Nigeria Bank Account Validation API Tutorial
Picture this: You're creating a financial app specifically for the Nigerian market and you need to verify bank account numbers quickly and accurately. Instead of struggling with complicated integrations or manual checks, you can use a seamless API that does the work for you. Discover how the Real-time Nigeria Bank Account Validation API can transform your validation process, ensuring precision and efficiency every step of the way. 🍹🖥️
This tutorial provides step-by-step instructions on how to utilize the Real-time Nigeria Bank Account Validation API. With this API, you can instantly validate Nigerian bank account numbers and retrieve the associated account and bank names in real time.
#Getting Started
Before diving into the API, you need to sign up for an account and generate an API token. This token will be essential for authenticating your requests to the API.
-
Sign up for an account. Complete the necessary details and submit the form to activate your account.
-
After signing up, access your account dashboard.
-
Proceed to the API tokens section by following this link.
-
Here, you can generate a new API token, which will be included in the Authorization header of your API requests.
#Requirements
To utilize this API, the primary prerequisites are an active account and an API token. No additional software or hardware installations are necessary.
#API Usage
The primary API endpoint is http://nubapi.com/api/verify
. This endpoint requires two parameters: account_number
and bank_code
.
Here's a glimpse of a typical API response:
{ "account_number": "12345678910", "account_name": "John Timothy Emmanuel", "first_name": "John", "last_name": "Timothy", "other_name": "Emmanuel", "Bank_name": "Paycom", "bank_code": "999992"}
This response offers comprehensive account details based on the provided account number and bank code. The account_name field displays the full name of the account holder, while the first_name, last_name, and other_name fields break down the account holder's name. The bank_name and bank_code fields specify the bank's name and its corresponding code.
For additional utility, the API also provides the following endpoints:
#Code Examples
To further simplify the integration process, below are code examples in Python and PHP that demonstrate the API's usage:
#Python
import requests headers = { 'Authorization': 'Bearer Your_Bearer_Token', # Ensure to replace with your genuine Bearer token} params = { 'account_number': '12345678910', 'bank_code': '999992',} response = requests.get('http://nubapi.com/api/verify', headers=headers, params=params) data = response.json() print(f"Account Name: {data['account_name']}")print(f"First Name: {data['first_name']}")print(f"Last Name: {data['last_name']}")print(f"Other Name: {data['other_name']}")print(f"Account Number: {data['account_number']}")print(f"Bank Code: {data['bank_code']}")print(f"Bank Name: {data['Bank_name']}")
#PHP
Utilizing the GuzzleHttp\Client:
use GuzzleHttp\Client;use GuzzleHttp\Exception\RequestException; try { $client = new Client(); $queryParams = [ 'account_number' => '12345678910', 'bank_code' => '999992' ]; $response = $client->get('http://nubapi.com/api/verify', [ 'query' => $queryParams, 'headers' => [ 'Authorization' => 'Bearer Your_Bearer_Token' // Remember to replace with your actual Bearer token ] ]); $data = json_decode($response->getBody(), true); echo "Account Name: " . $data['account_name'] . PHP_EOL; echo "First Name: " . $data['first_name'] . PHP_EOL; echo "Last Name: " . $data['last_name'] . PHP_EOL; echo "Other Name: " . $data['other_name'] . PHP_EOL; echo "Account Number: " . $data['account_number'] . PHP_EOL; echo "Bank Code: " . $data['bank_code'] . PHP_EOL; echo "Bank Name: " . $data['Bank_name'] . PHP_EOL;} catch (RequestException $e) { echo 'API Request Error: ' . $e->getMessage();}
Ensure to replace "Your_Bearer_Token" with your actual Bearer token in the code samples. Also, adjust 12345678910 and 999992 to the specific account number and bank code you aim to query.
#Conclusion
The Real-time Nigeria Bank Account Validation API is an invaluable resource for authenticating Nigerian bank account numbers. With a few lines of code, you can seamlessly integrate it into your application, enabling real-time bank account validation. This functionality is especially beneficial for financial platforms, payment gateways, and any application necessitating bank account number verification.
For a comprehensive guide, please consult the official documentation.
Happy coding adventures!