PHPackages                             fayda/fayda-php-sdk - 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. fayda/fayda-php-sdk

ActiveLibrary[API Development](/categories/api)

fayda/fayda-php-sdk
===================

PHP SDK for Fayda API

v1.0.2(2y ago)1456MITPHPPHP &gt;=7.1

Since Oct 24Pushed 2y ago1 watchersCompare

[ Source](https://github.com/Fayda-Community/fayda-php-sdk)[ Packagist](https://packagist.org/packages/fayda/fayda-php-sdk)[ Docs](https://github.com/Fayda-Community/fayda-php-sdk)[ RSS](/packages/fayda-fayda-php-sdk/feed)WikiDiscussions main Synced today

READMEChangelog (2)Dependencies (4)Versions (4)Used By (0)

PHP SDK - Fayda Platform
========================

[](#php-sdk---fayda-platform)

❗This repository is work in progress. It is not ready yet and may change a lot.

> Read the official specification

document [Fayda Platform API Specification](https://nidp.atlassian.net/wiki/spaces/FAPIQ/pages/633733136/Fayda+Platform+API+Specification).

> In order to receive the latest change notifications, please `Watch` this repository.

[![Latest Version](https://camo.githubusercontent.com/6bc96a9bcad912b7bfec6b6c79608d0e6b2fc91a3838240c654f903e6a827962/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f46617964612d436f6d6d756e6974792f66617964612d7068702d73646b2e737667)](https://github.com/Fayda-Community/fayda-php-sdk/releases)[![PHP Version](https://camo.githubusercontent.com/2e333e893a711b4f7ead506abc34de7ca1ac5ad298a0f872b82911438a5db22e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f66617964612f66617964612d7068702d73646b2e7376673f636f6c6f723d677265656e)](https://secure.php.net)[![Build Status](https://camo.githubusercontent.com/40c9f822d5d53c5b7c75ebf13d4cc930e251be3e73529966deef057933e46df4/68747470733a2f2f7472617669732d63692e6f72672f46617964612d436f6d6d756e6974792f66617964612d7068702d73646b2e7376673f6272616e63683d6d61696e)](https://travis-ci.org/Fayda-Community/fayda-php-sdk)[![Total Downloads](https://camo.githubusercontent.com/33cda936fecede0bfc7b7b1df929ba12fd7b1f490aca6a614ec962190911d4ca/68747470733a2f2f706f7365722e707567782e6f72672f66617964612f66617964612d7068702d73646b2f646f776e6c6f616473)](https://packagist.org/packages/fayda/fayda-php-sdk)[![License](https://camo.githubusercontent.com/ad83c92af230ca853c2d3d4eeae793c7eca9ebafe32bce76c433455b67411253/68747470733a2f2f706f7365722e707567782e6f72672f66617964612f66617964612d7068702d73646b2f6c6963656e7365)](LICENSE)

Requirements
------------

[](#requirements)

DependencyRequirement[PHP](https://secure.php.net/manual/en/install.php)`>=7.1  Install package via [Composer](https://getcomposer.org/).

```
composer require "fayda/fayda-php-sdk"
```

Usage
-----

[](#usage)

### Choose environment

[](#choose-environment)

EnvironmentBaseUri*Production*`https://prod.fayda.et`*Development*`https://auth-api.fayda.et`(DEFAULT)```
// Switch to the prod environment
FaydaApi::setBaseUri('https://prod.fayda.et');
```

### Debug mode &amp; logging

[](#debug-mode--logging)

```
// Debug mode will record the logs of API to files in the directory "FaydaApi::getLogPath()" according to the minimum log level "FaydaApi::getLogLevel()".
FaydaApi::setDebugMode(true);

// Logging in your code
// FaydaApi::setLogPath('/tmp');
// FaydaApi::setLogLevel(Monolog\Logger::DEBUG);
FaydaApi::getLogger()->debug("I'm a debug message");
```

### Examples

[](#examples)

> See the [examples](examples) folder for more.

#### Example API - OTP Request Service

[](#example-api---otp-request-service)

```
use Fayda\SDK\Api\Otp;
use Fayda\SDK\Auth;
use Fayda\SDK\Exceptions\BusinessException;
use Fayda\SDK\Exceptions\HttpException;
use Fayda\SDK\Exceptions\InvalidApiUriException;

// Set the base uri for your environment. Default is https://auth-api.fayda.et
//FaydaApi::setBaseUri('https://prod.fayda.et');

try {

    $api = new Otp();

    $transactionId = time(); // unique transaction id
    $individualId = ''; // your Fayda FIN/FCN

    $result = $api->requestNew($transactionId, $individualId);

    print "============ OTP Request Result ============\n";
    print json_encode($result) . "\n\n";

    $otp = readline("Enter OTP: ");

    print "============  eKyc ============\n";
    $dataKyc = new DataKyc();
    $authentication = $dataKyc->authenticate(
        $result['transactionID'], // transactionID from the previous request
        $individualId,
        $otp,
        [
            'otp' => false,
            'demo' => true,
            'bio' => false,
        ]
    );
    print json_encode($authentication) . "\n\n";

} catch (HttpException $e) {
    print $e->getMessage();
} catch (BusinessException $e) {
    print $e->getMessage();
} catch (InvalidApiUriException $e) {
    print $e->getMessage();
}
```

Using Docker
------------

[](#using-docker)

Set up docker environment.

1. `cp .env.example .env`
2. edit `.env` file with your credentials.
3. `docker-compose up -d`

Run the examples inside docker. See the output on console to verify the results.

#### Request OTP and do kyc

[](#request-otp-and-do-kyc)

`docker-compose exec fayda php ./examples/Example.php`

Run tests
---------

[](#run-tests)

> Modify your API key in `phpunit.xml` first.

```
# Add your API configuration items into the environmental variable first

export FAYDA_BASE_URL=https://dev.fayda.et

export FAYDA_VERSION=1.0
export FAYDA_ENV=prod

export FAYDA_SKIP_VERIFY_TLS=0
export FAYDA_DEBUG_MODE=1

composer test
```

License
-------

[](#license)

[MIT](LICENSE)

[![Ethiopian National ID](nid_logo.png "Fayda")](nid_logo.png)

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity40

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 ~46 days

Total

3

Last Release

891d ago

PHP version history (2 changes)v1.0.0PHP &gt;=7.1 &lt;8.2

v1.0.1PHP &gt;=7.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/512656?v=4)[Anteneh Gebeyaw](/maintainers/agebeyaw)[@agebeyaw](https://github.com/agebeyaw)

---

Top Contributors

[![agebeyaw](https://avatars.githubusercontent.com/u/512656?v=4)](https://github.com/agebeyaw "agebeyaw (1 commits)")

---

Tags

apisdkfayda

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/fayda-fayda-php-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/fayda-fayda-php-sdk/health.svg)](https://phpackages.com/packages/fayda-fayda-php-sdk)
```

###  Alternatives

[google/apiclient

Client library for Google APIs

9.8k205.9M1.1k](/packages/google-apiclient)[craftcms/cms

Craft CMS

3.6k3.6M3.0k](/packages/craftcms-cms)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[checkout/checkout-sdk-php

Checkout.com SDK for PHP

563.6M13](/packages/checkout-checkout-sdk-php)[xeroapi/xero-php-oauth2

Xero official PHP SDK for oAuth2 generated with OpenAPI spec 3

1054.7M18](/packages/xeroapi-xero-php-oauth2)[resend/resend-php

Resend PHP library.

617.2M42](/packages/resend-resend-php)

PHPackages © 2026

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