PHPackages                             prosperoking/kudaopenapi - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. prosperoking/kudaopenapi

ActiveLibrary[API Development](/categories/api)

prosperoking/kudaopenapi
========================

A Simple library to communicate with kuda openapi

v0.2.5(11mo ago)21.3k1[2 issues](https://github.com/prosperoking/kudaopenapi/issues)MITPHP

Since Dec 21Pushed 11mo ago1 watchersCompare

[ Source](https://github.com/prosperoking/kudaopenapi)[ Packagist](https://packagist.org/packages/prosperoking/kudaopenapi)[ Docs](https://github.com/prosperoking/kudaopenapi)[ RSS](/packages/prosperoking-kudaopenapi/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (2)Versions (8)Used By (0)

Kuda Open Api For PHP
=====================

[](#kuda-open-api-for-php)

I needed to work with the kuda openapi but it seems that the progress for the work on the openapi-php library is not ready yet. This library can help fill that gap till they have one ready.

Installation
------------

[](#installation)

```
> composer require prosperoking/kudaopenapi
```

Usage
-----

[](#usage)

Usage is takes into account the kudaOpenApi v1 and v2. The v1 makes use of private and public key pairs while the v2 uses an apiKey and email combination without the need to encrypt the body. Below are ways to utilize any of the api

### For api v2

[](#for-api-v2)

> You can get your api key/keys from the kuda developer portal [here](https://developer.kudabank.com/)

Test and live environment urls in use are

- Test:
- Live:

```
include './vendor/autoload.php';

use Prosperoking\KudaOpenApi\KudaOpenApiV2;

$email = "youremail@here.com"
// You can generate this on the developer dashboard
$apiKey = 'xxxxxxxxxxx';

// initialize the object and pass the path or string of your key in pem format
$openApi = KudaOpenApiV2::initLive($email, $apiKey);
// And for test environment
$openApi = KudaOpenApiV2::initTest($email, $apiKey);

// You can also Use the constructor
$openApi = new KudaOpenApiV2($email,$openApi, null, $baseUrl )

try {
    // this will return the account NIBBS information
    var_dump($openApi->getAccountInfo([
        'beneficiaryAccountNumber'=> '1115744617',
        'beneficiaryBankCode'=>'999058',
    ]));

} catch (\Exception $th) {
    var_dump($th->getMessage());
}
```

v2 comes with a cache driver to avoid making unneeded calls for authentication making it 1 request every 12 minutes will help improve the speed of your requests. You can also write your own cache driver and supply for the client to use and example with laravel will look something like this:

> Cache should last a max of 15 minutes

```
use Prosperoking\KudaOpenApi\Contracts\IAuthCacheDriver
class MyAwesomeCacheDriver implements IAuthCacheDriver {
    public function setAuthToken(string $value): bool
    {
        // You may decide to encrypt  the value before saving it
        return Cache::set('kuda_key', $value, now()->addMinutes(12);
    }
    public function getAuthToken(): ?string
    {
        // And Decrypt it here before returning it
        return Cache::get('kuda_key');
    }
}
```

And pass it to the client with any of the methods

```
include './vendor/autoload.php';

use Prosperoking\KudaOpenApi\KudaOpenApiV2;

$email = "youremail@here.com"
// You can generate this on the developer dashboard
$apiKey = 'xxxxxxxxxxx';

// init your cache driver
$myCacheDriver = new MyAwesomeCacheDriver()

// initialize the object and pass the path or string of your key in pem format
$openApi = KudaOpenApiV2::initLive($email, $apiKey, $myCacheDriver);
// And for test environment
$openApi = KudaOpenApiV2::initTest($email, $apiKey, $myCacheDriver);

// You can set the cache driver using the set cache driver method

$openApi->setCacheDriver($myCacheDriver);

// You can also Use the constructor
$openApi = new KudaOpenApiV2($email,$openApi, $myCacheDriver, $baseUrl )
```

### For api v1

[](#for-api-v1)

```
include './vendor/autoload.php';

use Prosperoking\KudaOpenApi\KudaOpenApi;

$client = "your_client_id_here"
$baseUrl = 'https://sandbox.kudabank.com/v1';

// initialize the object and pass the path or string of your key in pem format
$openApi = new KudaOpenApi(
    __DIR__.'/private.pem',
    __DIR__.'/public.pem',

try {
    // this will return the account NIBSS information
    var_dump($openApi->getAccountInfo([
        'beneficiaryAccountNumber'=> '1115744617',
        'beneficiaryBankCode'=>'999058',
    ]));

    // or You can make use of makeRequest method
    $payload = [
        'beneficiaryAccountNumber'=> '1115744615',
        'beneficiaryBankCode'=>'999058'
    ];
    $requestRef= "myunique_identifier"
    // this will return the account information
    var_dump($openApi->makeRequest(
        ServiceTypes::NAME_ENQUIRY,
        $payload,
        $requestRef
    ));

} catch (\Exception $th) {
    var_dump($th->getMessage());
}
```

> note that if you don't pass a referenceid the libray will generate one for you using php bin2hex(random\_bytes(10))

You can also make request using the **makeRequest** method

```
use Prosperoking\KudaOpenApi\KudaOpenApi;
use Prosperoking\KudaOpenApi\ServiceTypes;

$client = "your client id here"
$baseUrl = 'https://sandbox.kudabank.com/v1';
// initialize the object and pass the path or string of your key in pem format
$openApi = new KudaOpenApi(
    __DIR__.'/private.pem',
    __DIR__.'/public.pem',
    $clientId,
    $baseUrl
);
try {
    $payload = [
        'beneficiaryAccountNumber'=> '1115744615',
        'beneficiaryBankCode'=>'999058'
    ];
    $requestRef= "myunique_identifier"
    // this will return the account information
    var_dump($openApi->makeRequest(
        ServiceTypes::NAME_ENQUIRY,
        $payload,
        $requestRef
    ));

} catch (\Exception $th) {
    var_dump($th->getMessage());
}
```

Road Map
--------

[](#road-map)

Here are what I intend to add:

- Create a simple api base similar to kuda openapi-node ☑
- Make Simple Classes to create payloads to be used in the makeRequest object to help intelisense support. ⏳
- Add support for laravel ⏳
- Create tests ⏳

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance32

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~272 days

Recently: every ~251 days

Total

7

Last Release

339d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0a23cd260ac5920154731b86f35035be9333b0d115fabe0fc2fb9ea2a5956b68?d=identicon)[prosperoking](/maintainers/prosperoking)

---

Top Contributors

[![prosperoking](https://avatars.githubusercontent.com/u/12105518?v=4)](https://github.com/prosperoking "prosperoking (15 commits)")

---

Tags

phpKudaKuda openapi

### Embed Badge

![Health badge](/badges/prosperoking-kudaopenapi/health.svg)

```
[![Health](https://phpackages.com/badges/prosperoking-kudaopenapi/health.svg)](https://phpackages.com/packages/prosperoking-kudaopenapi)
```

###  Alternatives

[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.5k311.5k5](/packages/theodo-group-llphant)[mailchimp/transactional

458.9M16](/packages/mailchimp-transactional)[resend/resend-php

Resend PHP library.

574.7M21](/packages/resend-resend-php)[comgate/sdk

Comgate PHP SDK

13327.8k](/packages/comgate-sdk)[fenguoz/bsc-php

Support Binance's BNB and BEP20, which include functions such as address creation, balance query, transaction transfer, query the latest blockchain, query information based on the blockchain, and query information based on the transaction hash

4720.9k](/packages/fenguoz-bsc-php)[scriptdevelop/whatsapp-manager

Paquete para manejo de WhatsApp Business API en Laravel

762.6k](/packages/scriptdevelop-whatsapp-manager)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
