API Documentation for Payout Verification Functionality V1 & V2

This documentation provides step-by-step guidance for developers to integrate functionalities for verifying payout transactions status using PHP cURL or NodeJs. Each section includes the method, endpoint, request parameters, and sample responses.


GET https://mybundlepay.com/ng/api/verify-payout/{id}

HEADERS

Authorization* string

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

Accept application/json

BODY PARAMS

The id parameter is a required string representing the unique payout ID.


< ?php
// API endpoint for verifyWithdrawal
$url = "https://mybundlepay.com/ng/api/verify-payout"; // Replace with your actual endpoint URL

// Replace {bearer_token} with the actual token
$bearerToken = "{bearer_token}";

// Transaction reference to be verified
$txnRef = "sample_txn_ref"; // Replace with the actual txn_ref value

// Initialize cURL
$ch = curl_init();

// Set cURL options
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true); // HTTP POST
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query([
    'txn_ref' => $txnRef
])); // Data to be sent in the request body
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "Authorization: Bearer $bearerToken",
    "Accept: application/json",
    "Content-Type: application/x-www-form-urlencoded",
]);

// Execute cURL request
$response = curl_exec($ch);

// Check for cURL errors
if (curl_errno($ch)) {
    echo "cURL Error: " . curl_error($ch);
    curl_close($ch);
    exit;
}

// Close the cURL session
curl_close($ch);

// Decode and process the response
$responseData = json_decode($response, true);

if (isset($responseData['status'])) {
    if ($responseData['status'] === 'success') {
        // Handle successful transactions
        echo "Transaction Successful:\n";

        // Check if the response indicates 'SUCCESS' or 'completed'
        if (isset($responseData['data']['status']) && $responseData['data']['status'] === 'SUCCESS') {
            echo "Status: SUCCESS (API V2)\n";
        } elseif (isset($responseData['data']['status']) && $responseData['data']['status'] === 'completed') {
            echo "Status: completed (API V1)\n";
        }

        // Print transaction details
        print_r($responseData['data']);
    } else {
        // Handle failed transactions
        echo "Transaction Failed:\n";
        echo $responseData['message'] . "\n";

        if (isset($responseData['data'])) {
            echo "Additional Data:\n";
            print_r($responseData['data']);
        }
    }
} else {
    echo "Invalid API response:\n";
    echo $response;
}
?>


                        

const axios = require('axios');

// API endpoint for verifyWithdrawal
const url = "https://mybundlepay.com/ng/api/verifyWithdrawal"; // Replace with your actual endpoint URL

// Replace {bearer_token} with the actual token
const bearerToken = "{bearer_token}";

// Transaction reference to be verified
const txnRef = "sample_txn_ref"; // Replace with the actual txn_ref value

// Request payload
const data = new URLSearchParams({
    txn_ref: txnRef
}).toString();

// Request configuration
const config = {
    method: 'post',
    url: url,
    headers: {
        'Authorization': `Bearer ${bearerToken}`,
        'Accept': 'application/json',
        'Content-Type': 'application/x-www-form-urlencoded'
    },
    data: data
};

// Make the request
axios(config)
    .then(response => {
        const responseData = response.data;

        if (responseData.status) {
            if (responseData.status === 'success') {
                console.log("Transaction Successful:");

                // Check if the response indicates 'SUCCESS' or 'completed'
                if (responseData.data?.status === 'SUCCESS') {
                    console.log("Status: SUCCESS (API V2)");
                } else if (responseData.data?.status === 'completed') {
                    console.log("Status: completed (API V1)");
                }

                // Print transaction details
                console.log(responseData.data);
            } else {
                console.error("Transaction Failed:");
                console.error(responseData.message);

                if (responseData.data) {
                    console.log("Additional Data:");
                    console.log(responseData.data);
                }
            }
        } else {
            console.error("Invalid API response:");
            console.error(responseData);
        }
    })
    .catch(error => {
        console.error("Error occurred:", error.message);
    });


                        

Pending Transaction Response


{
    "status": "success",
    "data": {
        "id": "txn_12345",
        "amount": 10000,
        "status": "PENDING",
        "bank_name": "First Bank of Nigeria",
        "account_number": "1234567890",
        "account_name": "John Doe"
    }
}

                        

Completed Transaction Response


Transaction Successful:
Status: completed (API V1)
Array
(
    [txn_ref] => sample_txn_ref
    [amount] => 5000
    [bank_name] => Test Bank
    [acct_name] => Test User
    [status] => completed
    [created_at] => 2025-01-10 14:00:00
)

Transaction Successful:
Status: SUCCESS (API V2)
Array
(
    [txn_ref] => sample_txn_ref
    [amount] => 5000
    [destination_account_name] => Mybundlepay User
    [destination_bank_name] => Mybundlepay Bank
    [status] => SUCCESS
    [created_at] => 2025-01-10 14:00:00
)