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

ActiveLibrary[API Development](/categories/api)

stkf/bexio-api-php-client
=========================

Client library for bexio API. Forked from https://github.com/christianruhstaller/bexio-api-php-client

0.3.1(3y ago)046MITPHP

Since Aug 31Pushed 1y agoCompare

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

READMEChangelogDependencies (1)Versions (7)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 stkf/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

29

—

LowBetter than 59% of packages

Maintenance30

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community12

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

Total

5

Last Release

1229d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0912c7ff864d3c7e671465e89eff4f3123a2ab1a87b4579037875ccf447db5f8?d=identicon)[stkf](/maintainers/stkf)

---

Top Contributors

[![christianruhstaller](https://avatars.githubusercontent.com/u/13237645?v=4)](https://github.com/christianruhstaller "christianruhstaller (18 commits)")[![TheyCallMeSticky](https://avatars.githubusercontent.com/u/38670781?v=4)](https://github.com/TheyCallMeSticky "TheyCallMeSticky (13 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 (3 commits)")[![lukasNo1](https://avatars.githubusercontent.com/u/19799373?v=4)](https://github.com/lukasNo1 "lukasNo1 (3 commits)")[![Tomasz-Silpion](https://avatars.githubusercontent.com/u/5328659?v=4)](https://github.com/Tomasz-Silpion "Tomasz-Silpion (2 commits)")[![cbaconnier](https://avatars.githubusercontent.com/u/4738184?v=4)](https://github.com/cbaconnier "cbaconnier (2 commits)")

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/stkf-bexio-api-php-client/health.svg)](https://phpackages.com/packages/stkf-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)[christianruhstaller/bexio-api-php-client

Client library for bexio API

1134.7k](/packages/christianruhstaller-bexio-api-php-client)[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)
