Our ready-made SDK helps you connect and integrate your app or website to the API gateway. Jump into the code, get started with Node.js!
// Load API
var Topups = require('./topups.js');

// Instantiate API request with valid header parameters i.e Authentication, Accept, Content-Type
var topups = new Topups("a12f4f9a99be83f1e631e379834864e7","application/json","application/json");

// Call API with valid body parameters i.e mobile, amount, note, name, email, country, network, currency
topups.send_airtime("254722000000","100","AIR0000001","Jane Wanjiku","jane.wanjiku@example.com","KE","Safaricom","KES", 200, function(err, response) {
    // Process API response
    console.log(response);
});

API Reference Send Airtime
// Load API
                            var Topups = require('./topups.js');
                            
                            // Instantiate API request with valid header parameters i.e Authentication, Accept, Content-Type
                            var topups = new Topups("a12f4f9a99be83f1e631e379834864e7","application/json","application/json");
                            
                            // Call API with valid body parameters i.e mobile, amount, note, name, email, country, network, currency, payment_network, payment_mobile, payment_name, payment_email
                            topups.buy_airtime("254722000000","100","AIR0000001","Jane Wanjiku","jane.wanjiku@example.com","KE","Safaricom","KES","M-Pesa","254722002000","Joe Omondi","joe.omondi@example.com" 200, function(err, response) {
                                // Process API response
                                console.log(response);
                            });
                            

API Reference Buy Airtime
// Load API
var Topups = require('./topups.js');

// Instantiate API request with valid header parameters i.e Authentication, Accept, Content-Type
var topups = new Topups("a12f4f9a99be83f1e631e379834864e7","application/json","application/json");

// Call API with valid body parameters i.e mobile, agent_number, store_number, amount, note, name, email, agent_name, country, network, currency
topups.send_agent_float("254722000000","678910","678910","1000","FLT0000001","Jane Wanjiku","jane.wanjiku@example.com","JANE ENTERPRISES","KE","M-Pesa","KES", 200, function(err, response) {
    // Process API response
    console.log(response);
});

API Reference Send Agent Float
// Load API
var Topups = require('./topups.js');

// Instantiate API request with valid header parameters i.e Authentication, Accept, Content-Type
var topups = new Topups("a12f4f9a99be83f1e631e379834864e7","application/json","application/json");

// Call API with valid body parameters i.e sender, recipient, message, note, name, email, country, network
topups.send_sms("DEMO","254722000000","Jane, thank you for repaying your loan.","SMS0000001","Jane Wanjiku","jane.wanjiku@example.com","KE","Safaricom", 200, function(err, response) {
    // Process API response
    console.log(response);
});

API Reference Send SMS
// Load API
var Topups = require('./topups.js');

// Instantiate API request with valid header parameters i.e Authentication, Accept, Content-Type
var topups = new Topups("a12f4f9a99be83f1e631e379834864e7","application/json","application/json");

// Call API with valid body parameters i.e channel_type
topups.get_balance("Airtime", 200, function(err, response) {
    // Process API response
    console.log(response);
});

API Reference Get Balance