PHPackages                             napp/fenerum-api-client - 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. napp/fenerum-api-client

ActiveLibrary[API Development](/categories/api)

napp/fenerum-api-client
=======================

API Client for Fenerum

1.1.2(6y ago)25[1 issues](https://github.com/Napp/fenerum-api-client/issues)MITPHPPHP ^7.2CI failing

Since Nov 13Pushed 6y ago1 watchersCompare

[ Source](https://github.com/Napp/fenerum-api-client)[ Packagist](https://packagist.org/packages/napp/fenerum-api-client)[ Docs](https://github.com/napp/fenerum-api-client)[ RSS](/packages/napp-fenerum-api-client/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (10)Versions (8)Used By (0)

API Client for Fenerum
======================

[](#api-client-for-fenerum)

[![Latest Version on Packagist](https://camo.githubusercontent.com/7b74d9fb4fc24e63d8169797b562be2085b13781e648453e105125f57c3cc9fd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e6170702f66656e6572756d2d6170692d636c69656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/napp/fenerum-api-client)[![Build Status](https://camo.githubusercontent.com/d74ed747ae8d8817c8f641ca9d4778ded3b03e317a8ec6bba0480119639018d6/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6e6170702f66656e6572756d2d6170692d636c69656e742f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/napp/fenerum-api-client)[![Quality Score](https://camo.githubusercontent.com/855a8103a379d37b1117edce1333bbac098e054fff64f7bf050ce3a2458391d4/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6e6170702f66656e6572756d2d6170692d636c69656e742e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/napp/fenerum-api-client)[![Total Downloads](https://camo.githubusercontent.com/2f8878350432bf4c6ea695435092b9c5826723b4c013a66108a4c964a0479e73/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6e6170702f66656e6572756d2d6170692d636c69656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/napp/fenerum-api-client)[![Code Coverage](https://camo.githubusercontent.com/664f52961396c65b3f0853d5362fb2c3f8c7648822a706ef38cf398b3ba9db36/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4e6170702f66656e6572756d2d6170692d636c69656e742f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Napp/fenerum-api-client/?branch=master)

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

[](#installation)

You can install the package via composer:

```
composer require napp/fenerum-api-client
```

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

[](#installation-1)

1. Add to `.env` - Fenerum API Token and a user/pass combo to allow Fenerum to post webhook events.

```
FENERUM_API_TOKEN=
FENERUM_AUTH_USERNAME=myuser
FENERUM_AUTH_PASSWORD=mypass
```

2. add FenerumServiceProvider to config/app.php

```
[
    ...
    \Fenerum\FenerumServiceProvider::class,
    ...
]
```

3. Add route to receive webhooks

```
Route::post('my-webhook-url', '\Fenerum\Webhooks\Http\Controllers\WebhookController@handle');
```

4. Register events in app/Providers/EventServiceProvider

```
AccountCreated::class => [
    MyAccountCreatedListener::class
],
AccountUpdated::class => [
    MyAccountUpdatedListener::class
],
CancelSubscription::class => [
    MyCancelSubscriptionListener::class
],
```

### Webhook Events supported

[](#webhook-events-supported)

- AccountCreated
- AccountUpdated
- CancelSubscription
- NewActivity
- NewInvoice
- PaidInvoice
- PlanTermsCreated
- PlanTermsUpdated
- RenewSubscriptionSoon

Usage
-----

[](#usage)

```
// use DI to resolve dependencies
$accounts = app(\Fenerum\ApiService::class)->account();

// or without DI
$client = new \Fenerum\ApiClient();
$fenerum = new \Fenerum\ApiService($client);
$accounts = $fenerum->account();
```

### Examples

[](#examples)

#### Get accounts

[](#get-accounts)

```
use Fenerum\ApiService;

$accounts = app(ApiService::class)->account()->listAccounts();
```

#### Update Subscription - User Seats

[](#update-subscription---user-seats)

```
// find account with id "1234"
$myAccount = $fenerum->account()->getAccount('1234');

// get the first subscription
$subId = $myAccount['subscription_set'][0]['uuid'];

// update subscription user seat count
$updatedSubscription = $fenerum->subscription()->updateSubscription([
    'quantity' => 59
], $subId);
```

#### Create account and add subscription (simple version)

[](#create-account-and-add-subscription-simple-version)

```
/** @var \Fenerum\ApiService $fenerum */
$fenerum = app(\Fenerum\ApiService::class);

$localAccountCode = '12345678';
$planTermId = 'c82a888e-2149-4b3c-8e14-ff5086e49417';

// create an account
$fenerum->account()->createAccount([
    'company_name' => 'Foo Bar Inc',
    'code' => $localAccountCode,
    'legal_address' => 'Road 123',
    'legal_zipcode' => '90210',
    'legal_city' => 'Hollywood',
    'legal_country' => 'US',
    'billing_same_as_legal' => true,
    'language' => 'en',
    'legal_vat_number' => 'US22223344',
]);

// add subscription to the account
$result = $fenerum->subscription()->createSubscription([
   'account' => $localAccountCode,
   'terms' => $planTermId,
   'collection_method' => 'invoice',
   'start_date' => now()->endOfMonth()->toIso8601String(),
   'payment_terms' => 14
]);
```

#### Create account and add recipient, contract, discount and a subscription (advanced version)

[](#create-account-and-add-recipient-contract-discount-and-a-subscription-advanced-version)

```
/** @var \Fenerum\ApiService $fenerum */
$fenerum = app(\Fenerum\ApiService::class);

$localAccountCode = '12345678';
$planTermId = 'c82a888e-2149-4b3c-8e14-ff5086e49417';

// create an account
$account = $fenerum->account()->createAccount([
    'company_name' => 'Foo Bar Inc',
    'code' => $localAccountCode,
    'legal_address' => 'Road 123',
    'legal_zipcode' => '90210',
    'legal_city' => 'Hollywood',
    'legal_country' => 'US',
    'billing_same_as_legal' => true,
    'language' => 'en',
    'legal_vat_number' => 'US22223344',
]);

// create a recipient
$fenerum->recipient()->createRecipient([
    'account' => $account['uuid'],
    'name' => 'John Doe',
    'email' => 'john@doe.com',
    'receive_invoice' => true,
    'receive_payment_confirmation' => true,
    'receive_subscription_notifications' => true,
]);

// assign a 24 month contract to the account
$contract = $fenerum->contract()->createContract([
    'plan_terms' => $planTermId,
    'start_date' => now()->startOfDay()->toIso8601String(),
    'commitment_length' => 24
], $localAccountCode);

// add 10% discounting
$fenerum->contractTier()->createContractTier([
    'minimum_quantity' => 1,
    'discount' => '10',
    'discount_type' => 'percent',
], $localAccountCode, $contract['uuid']);

// add subscription to the account
$result = $fenerum->subscription()->createSubscription([
   'account' => $localAccountCode,
   'terms' => $planTermId,
   'collection_method' => 'invoice',
   'start_date' => now()->endOfMonth()->toIso8601String(),
   'payment_terms' => 14
]);
```

#### Download invoice

[](#download-invoice)

```
$invoice = app(\Fenerum\ApiService::class)
            ->invoice()
            ->getInvoice('24260f57-f190-4cfa-a2a0-d8a8d827bda8');

$filePath = public_path('invoice_'.$invoice['invoice_number'].'.pdf');
file_put_contents($filePath, base64_decode($invoice['pdf_base64']));

return response()->download($filePath)->deleteFileAfterSend(true);
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Credits
-------

[](#credits)

- [Napp](https://github.com/napp)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

22

—

LowBetter than 23% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

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

Recently: every ~27 days

Total

6

Last Release

2255d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1e24155f0d3ab61799ca35477a940edce613075a20d1073f2241905271f29d23?d=identicon)[viezel](/maintainers/viezel)

---

Tags

apiapi-clientfenerumwebhookwebhook-receiverapiwebhooksfenerum

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/napp-fenerum-api-client/health.svg)

```
[![Health](https://phpackages.com/badges/napp-fenerum-api-client/health.svg)](https://phpackages.com/packages/napp-fenerum-api-client)
```

###  Alternatives

[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[andreaselia/laravel-api-to-postman

Generate a Postman collection automatically from your Laravel API

1.0k586.2k3](/packages/andreaselia-laravel-api-to-postman)[flat3/lodata

OData v4.01 Producer for Laravel

96320.9k](/packages/flat3-lodata)[api-ecosystem-for-laravel/dingo-api

A RESTful API package for the Laravel and Lumen frameworks.

3121.5M10](/packages/api-ecosystem-for-laravel-dingo-api)[smodav/mpesa

M-Pesa API implementation

16363.7k1](/packages/smodav-mpesa)[ardakilic/mutlucell

Mutlucell SMS API wrapper for sending sms text messages for Laravel

457.3k](/packages/ardakilic-mutlucell)

PHPackages © 2026

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