Retrieve Account Number

  • Home
  • Retrieve Account Number
image

This documentation provides information on how to use PHP and cURL to make a POST request to the "Retrieve Account Number" API. This API allows you to retrieve an account number by providing a payment reference. The example below demonstrates how to use this API with PHP.

Prerequisites

Before using this API, ensure you have the following:

  • A running local development environment.
  • Knowledge of the API endpoint's URL, API Key, and Merchant ID.
  • PHP installed on your local server.

Request Details

  • URL: The URL for making the POST request to the "Retrieve Account Number" API is http://localhost/virtual/api/retrieve_account_number. Note that this URL points to a local development environment; ensure it matches your specific setup in a production environment.
  • Request Method: This API uses the HTTP POST method for data submission.
  • Request Headers:
  • Content-Type: Set to application/json to specify that the request body contains JSON data.
  • API-Key: Replace with your actual API key provided for authentication purposes.
  • Merchant-Id: Replace with your actual Merchant ID, which identifies your merchant account.
  • Request Body: The request body is a JSON object containing the payment reference for which you want to retrieve an account number.

Response

The response from the API will be stored in the $response variable in the provided PHP code. You can process and use this response data as needed within your PHP application.

Error Handling

It's essential to implement proper error handling in your code to address potential issues, such as network errors or API responses indicating errors. You can parse the API response to check for error messages or status codes and handle them accordingly.

Sample response
JSON
                                {
    "response_code": 0,
    "response_message": "Successful",
    "data": {
        "id": "233389999002",
        "account_name": "IFY HUG",
        "account_number": "4011536001",
        "bank_name": "Premium Trust Bank"
    }
}                            
Connect with Us

Experience seamless connectivity with NectaPay. Discover innovative solutions, personalized support, and a vibrant community. Let's build a brighter future together.

image
image