Build With MyBundlePay

One integration for payments, cards, bills and payouts.

MyBundlePay gives developers a clean payment gateway, virtual account funding, payout rails, card issuing tools, bill payments, webhooks and merchant-ready checkout experiences.

REST APIs JSON based
Webhooks Real time events
Sandbox Test first

API Test Console

Test the current endpoint directly from the documentation. Secret keys stay inside this browser session.

Enter your test key, review the sample body for this page, then send a request.

API Documentation for Payout Functionality

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


GET https://mybundlepay.com/ng/api/payout

HEADERS

Authorization* string

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

Accept application/json

REQUEST PARAMETERS*

The request body parameters include the required amount (integer) representing the withdrawal amount, bank_code (string) for the bank code from the fetch banks endpoint, account_number (string) for the recipient's bank account number, and account_name (string) for the recipient's account name.

Notes for Developers


1. API Key Security: Ensure the API key is stored securely, such as in environment variables.
2. Error Handling: Always implement error handling for failed requests or invalid responses.
3. Rate Limits: Check the API provider’s documentation for rate limits and implement retry mechanisms if needed.
4. Currency Unit: The amounts currency unit (e.g.,NGN).
5. Test vs. Live: Use test API keys for development and testing, and ensure live keys are only used in production.


< ?php
// Data to be sent as query parameters
$data = [
    "amount" => 1000,
    "bank_code" => "001",
    "acct_no" => "1234567890",
    "acct_name" => "John Doe",
    "ref_id" => "trx_h8934h3984h3j40",
    "reason" => "Payment for services" // Custom reason for the transaction
];

// Build the query string from the data array
$queryString = http_build_query($data);

// Set up the cURL session for GET
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://mybundlepay.com/ng/api/payout?" . $queryString);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Authorization: Bearer {secret_key}', // Replace {secret_key} with your actual secret key
    'Content-Type: application/json',
]);

// Execute the request
$response = curl_exec($ch);
curl_close($ch);

echo $response;
?>

                        

const axios = require('axios');

// Data to be sent in the request body
const data = {
  amount: 1000,
  bank_code: "001",
  account_number: "1234567890",
  account_name: "John Doe",
  ref_id: "trx_h8934h3984h3j40",
  reason: "Payment for service"
};

// API URL
const url = "https://mybundlepay.com/ng/api/payout";

// Secret key for Authorization header
const secretKey = 'YOUR_SECRET_KEY'; // Replace with your actual secret key

// Send POST request using axios
axios.post(url, data, {
  headers: {
    'Authorization': `Bearer ${secretKey}`,
    'Content-Type': 'application/json'
  }
})
  .then(response => {
    console.log(response.data); // Handle successful response
  })
  .catch(error => {
    console.error('Error:', error); // Handle any errors
  });

                        

Successful Request Response


{
    "status": "success",
    "data": {
        "ref_id": "txn_12345",
        "amount": 1000,
        "status": "COMPLETED",
        "bank_name": "First Bank of Nigeria",
        "account_number": "1234567890",
        "account_name": "John Doe"
    }
}

                        

Error Response


{
    "status": "failed",
    "message": "Insufficient balance."
}