PHPackages                             christianruhstaller/bexio-api-php-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. christianruhstaller/bexio-api-php-client

ActiveLibrary[API Development](/categories/api)

christianruhstaller/bexio-api-php-client
========================================

Client library for bexio API

0.3.0(5y ago)1134.7k↓40%6[3 issues](https://github.com/christianruhstaller/bexio-api-php-client/issues)MITPHP

Since Aug 31Pushed 1y ago4 watchersCompare

[ Source](https://github.com/christianruhstaller/bexio-api-php-client)[ Packagist](https://packagist.org/packages/christianruhstaller/bexio-api-php-client)[ RSS](/packages/christianruhstaller-bexio-api-php-client/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (1)Versions (6)Used By (0)

bexio API PHP Client
====================

[](#bexio-api-php-client)

The bexio API Client Library enables you to work with the bexio API. This is an early version and is still in development.

See the [bexio API documentation](https://docs.bexio.com) for more information how to use the API.

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

[](#installation)

You can use **Composer** or download the library.

Require this package with composer:

```
composer require christianruhstaller/bexio-api-php-client
```

Include the autoloader:

```
require_once '/path/to/your-project/vendor/autoload.php';
```

Examples
--------

[](#examples)

Get access token

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

$clientId = 'CLIENT_ID'; // The client id of your app
$clientSecret = 'CLIENT_SECRET'; // The client secret of your app
$redirectUri = 'http://localhost/bexio-api-php-client.php'; // Set here your Url where this script gets called
$scope = 'openid offline_access'; // A whitespace-separated list of scopes (see https://docs.bexio.com/#section/Authentication/API-Scopes).
$state = '8OTs2JTDcWDaPqV7o9aHVWqM'; // A random sequence. Should be used as a protection against CSRF-Attacks
$credentialsPath = 'client_credentials.json'; // Set the path where the credentials file will be stored

$client = new \Bexio\Client(
    [
        'clientId'     => $clientId,
        'clientSecret' => $clientSecret,
    ]
);
$client->setRedirectUri($redirectUri);

// If code is not set we need to get the authentication code
if (!isset($_GET['code'])) {
    $redirectTo = \Bexio\Client::OAUTH2_AUTH_URL.'?'.http_build_query(
            [
                'response_type' => 'code',
                'client_id'     => $clientId,
                'redirect_uri'  => $redirectUri,
                'scope'         => $scope,
                'state'         => $state,
            ]
        );

    header('Location: '.$redirectTo);
    exit;
} else {
    $accessToken = $client->fetchAccessTokenWithAuthCode($_GET['code']);
    file_put_contents($credentialsFile, json_encode($accessToken));
    exit;
}
```

Init client

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

    $client = new \Bexio\Client([
        'clientId' => 'CLIENT_ID',
        'clientSecret' => 'CLIENT_SECRET',
    ]);

    $credentialsPath = 'PATH_TO_CREDENTIAL_FILE';

    if (!file_exists($credentialsPath)) {
        throw new \Exception('Credentials file not found for OAuth: '.$credentialsPath);
    }

    $accessToken = file_get_contents($credentialsPath);
    $client->setAccessToken($accessToken);

    if ($client->isAccessTokenExpired()) {
        $client->refreshToken($client->getRefreshToken());
        file_put_contents($credentialsPath, $client->getAccessToken());
    }
```

Get contacts

```
    $bexio = new \Bexio\Resource\Contact($client);

    $contacts = $bexio->getContacts();
```

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance25

Infrequent updates — may be unmaintained

Popularity37

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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

Total

4

Last Release

2023d ago

### Community

Maintainers

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

---

Top Contributors

[![christianruhstaller](https://avatars.githubusercontent.com/u/13237645?v=4)](https://github.com/christianruhstaller "christianruhstaller (19 commits)")[![xoo-herbert](https://avatars.githubusercontent.com/u/45823127?v=4)](https://github.com/xoo-herbert "xoo-herbert (11 commits)")[![simoor](https://avatars.githubusercontent.com/u/10817707?v=4)](https://github.com/simoor "simoor (5 commits)")[![lukasNo1](https://avatars.githubusercontent.com/u/19799373?v=4)](https://github.com/lukasNo1 "lukasNo1 (3 commits)")[![cbaconnier](https://avatars.githubusercontent.com/u/4738184?v=4)](https://github.com/cbaconnier "cbaconnier (2 commits)")[![Tomasz-Silpion](https://avatars.githubusercontent.com/u/5328659?v=4)](https://github.com/Tomasz-Silpion "Tomasz-Silpion (2 commits)")

---

Tags

bexio

### Embed Badge

![Health badge](/badges/christianruhstaller-bexio-api-php-client/health.svg)

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

###  Alternatives

[stymiee/authnetjson

Library that abstracts Authorize.Net's JSON APIs. This includes the Advanced Integration Method (AIM), Automated Recurring Billing (ARB), Customer Information Manager (CIM), Transaction Reporting, Simple Integration Method (SIM), and Webhooks.

19545.7k](/packages/stymiee-authnetjson)[michaeldrennen/geonames

A Laravel (php) package that interfaces with the geolocation services on geonames.org.

9514.0k](/packages/michaeldrennen-geonames)[luyadev/luya-headless

LUYA headless API client

1025.6k3](/packages/luyadev-luya-headless)[mrteye/gdax

API for GDAX A service provided by coinbase. (Unofficial)

195.2k](/packages/mrteye-gdax)

PHPackages © 2026

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