PHPackages                             evance/apiclient - 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. evance/apiclient

ActiveLibrary[API Development](/categories/api)

evance/apiclient
================

Client library for Evance APIs

133PHPCI failing

Since Jun 3Pushed 8mo ago5 watchersCompare

[ Source](https://github.com/evanceit/evance-api-php-client)[ Packagist](https://packagist.org/packages/evance/apiclient)[ RSS](/packages/evance-apiclient/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependenciesVersions (2)Used By (0)

Evance APIs Client Library for PHP
==================================

[](#evance-apis-client-library-for-php)

A PHP client library for accessing Evance APIs

Work in progress!
-----------------

[](#work-in-progress)

This library is currently a work in progress. It is therefore subject to dramatic changes.

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

[](#requirements)

PHP 5.6 or higher

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

[](#installation)

You can use **Composer** (our preferred method) or download the source.

### Composer

[](#composer)

Once you have [installed composer](https://getcomposer.org), execute the following command in your project root to install this library:

```
composer require evance/apiclient
```

You should ensure you have included the autoloader for your project:

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

### Download

[](#download)

At the moment we do not have a release complete with its dependencies - it'll be coming soon.

Examples
--------

[](#examples)

### Authentication with OAuth 2.0

[](#authentication-with-oauth-20)

This method is for Web Clients requiring user authorisation. Follow the steps below to obtain an access token from Evance.

1. Create your App and credentials.
2. Download the JSON credentials and save them into a configuration directory within you project.
3. Set the path to your credentials as below:

    ```
    use Evance\ApiClient;
    $client = new ApiClient();
    $client->loadAuthConfig('/path/to/client-credentials.json');
    ```
4. Set the scopes required for the API you are going to call.

    ```
    $client->addScope('shipping');
    ```
5. Set your application's redirect URI. The redirect URI must match the authorised redirect URI you set when creating your client credentials.

    ```
    $client->setRedirectUri('https://example.com/callback');
    ```
6. Set a use-once state number. This number will be returned to your callback page so that you may confirm you sent the original request. Therefore, you will need to ensure you can persist the number to the callback page. This may done, for example, within a session variable.

    ```
    $client->setState($nonce);
    ```
7. Get the Evance OAuth 2.0 URL for a user to authorise access. You can either use this URL in redirect or provide a link for the user to click.

    ```
    $url = $client->createAuthorizeUrl();
    ```
8. In the callback script (your redirect URI), you will need to exchange the authorisation code for an access token. You should also verify that **state** is as expected.

    ```
    $token = $client->authenticate($_GET);
    ```

### Authenticating Server-to-server clients

[](#authenticating-server-to-server-clients)

This method is for obtaining single use access tokens. Unlike Web Clients a Server Key does not have a refresh token so a new access token must be obtained every time a token expires.

1. Create your App and credentials.
2. Download the JSON credentials and save them into a configuration directory within you project.
3. Set the path to your credentials as below:

    ```
    use Evance\ApiClient;
    $client = new ApiClient();
    $client->loadAuthConfig('/path/to/server-credentials.json');
    ```
4. Optionally, you may set the scope you wish to grant the access token. Omitting this step will grant the access token full access to the scopes granted to your App.

    ```
    $client->addScope('shipping');
    ```
5. Now you can obtain the access token from Evance.

    ```
    $token = $client->fetchAccessTokenWithJwt();
    ```

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance42

Moderate activity, may be stable

Popularity9

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity21

Early-stage or recently created project

 Bus Factor1

Top contributor holds 52.3% 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4246446?v=4)[Geoff Willings](/maintainers/gwillings)[@gwillings](https://github.com/gwillings)

---

Top Contributors

[![gwillings](https://avatars.githubusercontent.com/u/4246446?v=4)](https://github.com/gwillings "gwillings (23 commits)")[![Andrew-Matthew](https://avatars.githubusercontent.com/u/8606482?v=4)](https://github.com/Andrew-Matthew "Andrew-Matthew (10 commits)")[![mnunn2](https://avatars.githubusercontent.com/u/5892628?v=4)](https://github.com/mnunn2 "mnunn2 (5 commits)")[![kaitoj](https://avatars.githubusercontent.com/u/66623523?v=4)](https://github.com/kaitoj "kaitoj (3 commits)")[![radualexandru1986](https://avatars.githubusercontent.com/u/20443044?v=4)](https://github.com/radualexandru1986 "radualexandru1986 (2 commits)")[![matKamil](https://avatars.githubusercontent.com/u/32133773?v=4)](https://github.com/matKamil "matKamil (1 commits)")

### Embed Badge

![Health badge](/badges/evance-apiclient/health.svg)

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

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35816.3M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24016.2M18](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172437.8k11](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

94452.6k6](/packages/botman-driver-telegram)

PHPackages © 2026

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