VTU AFRICAVTUAfrica.com.ng

  • MAIN NAVIGATION
  • Introduction
  • Discounts & Prices
  • Balance Check
  • Airtime
    • Airtime VTU
    • Airtime Share
  • Data Bundle
    • Data (All Networks)
    • Smile Data
  • Cable TV Subcription
    • Cable TV Verification
    • Cable TV Subscription
  • Electricity bills
    • Meter Verification
    • Electricity Bills
  • Examination PINS
  • Bank Transfer
    • Verify Account Number
    • Send Money
  • Recharge Card PINS
  • Bet Wallet funding
  • Airtime2Cash Conversion
  • Bulk SMS
  • Transaction Status
    • Transaction Query
    • Transaction History
    • Resend Webhook
    • API Response Codes
  • How To Videos
  • Back To Home Page
  • Home SOFTWARE RESELLER
  • My Account

    • Login
    • Register

Re-Send Webhook API Integration

Webhook API Integration

This section contains your RESTful API to resend Webhook Notification.

 

Authentication

The VTU Africa API uses API Key for Authentication.

Please use your APIKEY for authentication



You can send or Re-Send the transaction details to a specified webhookURL or to the webhookURL in your VTU Africa profile.

Re-Send Webhook Notification.

Webhook Notification can be sent or resent with the endpoint below:

Base URL: https://vtuafrica.com.ng/portal/api/merchant-verify/

Parameters: as specified in the parameters below:

 

PARAMETERS Required/Optional TYPE DESCRIPTION
apikey R String The reseller gateway API key created at www.vtuafrica.com.ng
serviceName R String This is the Name of the service you are performing.
In this case it is: Webhook
ref R String This is the unique ReferenceID of the transaction you want to resend
webhookURL O URL This is a webhook URL where the notification will be resent.
If not provided, the webhook in your profile will be used. Please include http:// or https://

 

SAMPLE CODE


$host ="https://www.vtuafrica.com.ng/portal/api/merchant-verify/?apikey=1234&serviceName=Webhook&ref=123456789&webhookURL=https://testing.com/webhook/";

//Initialize cURL.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $host);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);

// Set custom headers (OPTIONAL)
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Accept: application/json, text/plain, */*'
]); 

// Set the User-Agent 
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/151.0.0.0 Safari/537.36');

$data = curl_exec($ch);

//Close the cURL handle.
curl_close($ch);

$response = json_decode($data);

 

EXPECTED RESPONSE


 {"code":101,"description":{"Status":"Completed","ref":"8687391176","service":"Exam PIN","network":"serviceID","ProductName":"NECO Result Checking TOKENs","quantity":3,"pins":"940972691411,940972691412","Token":"940972691411,940972691412","downloadLink":"https://vtuafrica.com.ng/portal/transaction-history/print.php?ref=8687391176","amount":"2150","debit":"6450","credit":"0","charge":"0","comi":"","channel":"API","Previous_Balance":"10,456.42","After_Balance":"4,006.42","Current_Balance":"10,756.42","dateTime":"3 October 2026, 02:31 PM","message":"The Transaction was Completed Successfully",""webhookStatus":"Completed","webhookResponse":"Webhook Data Sent received"}}

 

 

EXPECTED WEBHOOK PAYLOAD

    
{"ref":"8687391176","service":"Exam PIN","network":"serviceID","ProductName":"NECO Result Checking TOKENs","quantity":3,"pins":"940972691411,940972691412","Token":"940972691411,940972691412","downloadLink":"https://vtuafrica.com.ng/portal/transaction-history/print.php?ref=8687391176","status":"Completed","amount":"2150","debit":"6450","credit":"0","charge":"0","comi":"","channel":"API","Previous_Balance":"10,456.42","After_Balance":"4,006.42","Current_Balance":"10,756.42","dateTime":"3 October 2026, 02:31 PM","message":"The Transaction was Completed Successfully"}     

 

 

Verifying Webhook Signatures

To ensure that webhook events sent to your server genuinely originate from our platform and have not been tampered with during transit, we sign every payload.
Each webhook request includes an Authorization header. This header contains a cryptographic signature generated using your account's API Key and the raw JSON request body.

Verification Steps

1. Retrieve the raw POST request body (the exact JSON payload).
2. Retrieve the signature from the incoming Authorization HTTP header.
3. Compute a SHA256 HMAC hash of the raw body using your private API Key as the secret key.
4. Compare your generated hash with the signature in the header. If they match, the request is authentic.

PHP Implementation Example

    

// 1. Get the raw POST payload
$payload = file_get_contents('php://input');

// 2. Retrieve the signature from the Authorization header
$headers = getallheaders();
$received_signature = $headers['Authorization'] ?? '';

// If getallheaders() is unavailable on your server, use this fallback:
// $received_signature = $_SERVER['HTTP_AUTHORIZATION'] ?? '';

// 3. Your private API Key (Keep this secret and load it from your environment variables)
$api_key = "YOUR_API_KEY"; 

// 4. Calculate the expected signature
$expected_signature = hash_hmac('sha256', $payload, $api_key);

// 5. Securely compare the signatures (using hash_equals to prevent timing attacks)
if (hash_equals($expected_signature, $received_signature)) {
    // Signature is valid! Process the webhook event safely.
    http_response_code(200);
    echo json_encode(["status" => "success"]);
} else {
    // Signature mismatch! Reject the request.
    http_response_code(401);
    echo json_encode(["error" => "Invalid signature"]);
    exit;
}
    





OTHER SERVICES


CopyRight © 2016 - VTUAfrica.com.ng. All Rights Reserved
Site Designed by: EMMALEX ICT SOLUTIONS | Powered by RESELLER HOSTING