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

ActivePackage[API Development](/categories/api)

afosto/api-client
=================

Afosto API client

0.5.4(3y ago)143.6k—0%4[2 PRs](https://github.com/afosto/api-client/pulls)Apache-2.0PHP

Since Apr 29Pushed 3y agoCompare

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

READMEChangelog (10)Dependencies (6)Versions (19)Used By (0)

Synopsis
--------

[](#synopsis)

This is the official API client for the Afosto API. This client, written in PHP should make your work when it comes to interacting with the API a lot easier.

Code Example
------------

[](#code-example)

Connect to the API using your OAUTH2 client and secret, use a cache driver to store the credentials and start interacting.

```
$storage = new SessionStorage();
App::run($storage, CLIENT_ID, CLIENT_SECRET);
```

For example store new customer data and use the newly assigned id right away for a new sale.

```
$customer = Customer::model();
$customer->email = 'support@afosto.com';
$customer->name = 'Peter Bakker';
$customer->is_female = false;
$customer->save();
```

```
$sale = new Sale::model();
$sale->customer_id = $customer->id;
```

Also it is possible to paginate and then traverse through objects that are connected based on relations.

```
foreach (Product::model()->paginate(50) as $page => $products) {
    foreach ($products as $product) {
        foreach ($product->collections as $collection) {
            echo $collection->name;
        }
    }
}
```

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

[](#installation)

You should use [Composer](https://getcomposer.org/) to install this client, using the following command:

```
composer require afosto/api-client
```

After this create a new file config.php in the base dir of the project and set the values accordingly as specified in config.example.php.

API Reference
-------------

[](#api-reference)

Visit [the docs](https://docs.afosto.com) for the full list of documentation and use the inline documentation.

Tests
-----

[](#tests)

Todo.

Contributors
------------

[](#contributors)

You are welcome to contribute to this library, any questions can asked directly at the lead API developer [Sjoerd](mailto:sjoerd@afosto.com). Moreso you are encouraged to do pull-requests if you find your code complementairy to the client.

License
-------

[](#license)

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity30

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 67.6% 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 ~198 days

Recently: every ~527 days

Total

13

Last Release

1275d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9396ebbc376698bfad31f77a42ee333fbc38b559f0ae79ad651ea5ebadbdb8de?d=identicon)[afosto](/maintainers/afosto)

---

Top Contributors

[![bakkerpeter](https://avatars.githubusercontent.com/u/23257320?v=4)](https://github.com/bakkerpeter "bakkerpeter (25 commits)")[![Grendel7](https://avatars.githubusercontent.com/u/1823324?v=4)](https://github.com/Grendel7 "Grendel7 (7 commits)")[![TerraSkye](https://avatars.githubusercontent.com/u/5426161?v=4)](https://github.com/TerraSkye "TerraSkye (4 commits)")[![Tomassie91](https://avatars.githubusercontent.com/u/645351?v=4)](https://github.com/Tomassie91 "Tomassie91 (1 commits)")

---

Tags

apiclientv2afosto

### Embed Badge

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

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

###  Alternatives

[gorkalaucirica/hipchat-v2-api-client

Hipchat v2 API client

80223.4k6](/packages/gorkalaucirica-hipchat-v2-api-client)[deepseek-php/deepseek-php-client

deepseek PHP client is a robust and community-driven PHP client library for seamless integration with the Deepseek API, offering efficient access to advanced AI and data processing capabilities.

47073.9k5](/packages/deepseek-php-deepseek-php-client)[tristanjahier/zoho-crm

A PHP client for the API of Zoho CRM.

2414.3k](/packages/tristanjahier-zoho-crm)

PHPackages © 2026

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