PHPackages                             memurame/abacus-php-rest-api - 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. memurame/abacus-php-rest-api

ActiveLibrary[API Development](/categories/api)

memurame/abacus-php-rest-api
============================

Abacus REST API Client

0.6.0(1y ago)1181MITPHP

Since Nov 1Pushed 1y ago1 watchersCompare

[ Source](https://github.com/Memurame/abacus-php-rest-api)[ Packagist](https://packagist.org/packages/memurame/abacus-php-rest-api)[ Docs](https://github.com/Memurame/abacus-php-rest-api)[ RSS](/packages/memurame-abacus-php-rest-api/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (4)Versions (7)Used By (0)

Abacus PHP REST API
===================

[](#abacus-php-rest-api)

This repository addresses the [Abacus REST API](https://apihub.abacus.ch/) and thus simplifies the handling of requests. This was developed by me for my own purposes. You are also welcome to use it yourself and help develop it further.

**This repository is still in its infancy. It will therefore not yet have many functions.**

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

[](#requirements)

- PHP 8.3
- Composer
- Abacus API Token

Install
-------

[](#install)

```
composer require memurame/abacus-php-rest-api

```

How to use the API client
-------------------------

[](#how-to-use-the-api-client)

### Example code

[](#example-code)

You can find example code within the directory examples.

### The Client object

[](#the-client-object)

Your starting point is the AbacusClient object:

```
use AbacusAPIClient\AbacusClient;

$abacusClient = new AbacusClient([
    'base_url'      => 'https://abacus.domain.ch',
    'client_id'     => '',
    'client_secret' => '',
    'mandant'       => '7777'
]);

```

### Fetching all Resource object

[](#fetching-all-resource-object)

To read all objects without filtering:

```
use AbacusAPIClient\ResourceType;
$addresses = $abacusClient->resource(ResourceType::ADDRESSES)->run();
```

### Fetching a single Resource object

[](#fetching-a-single-resource-object)

To read a single objects by Id:

```
use AbacusAPIClient\ResourceType;
$address = $abacusClient->resource(ResourceType::ADDRESSES)->id('02b95ac0-e9ed-e201-175a-c2d220524153')->run();
```

### Query builder

[](#query-builder)

You have the option to include various queries with the request. You can attach any of these functions to a request. As an example, I have listed all possible queries for you

```
use AbacusAPIClient\ResourceType;
$addresses = $abacusClient->resource(ResourceType::SUBJECTS)
    ->filter('SubjectId', 'eq', 8)
    ->limit(3)
    ->order('Id', 'desc')
    ->select('FirstName')
    ->expand('Addresses', 'Communications')
    ->all()
    ->run();
```

#### filter

[](#filter)

You can search for a key and its value. You can see how the string is structured in the link below [https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec\_SystemQueryOptionfilter](https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionfilter)

#### limit

[](#limit)

You can specify how many results you want. Does not work together with all() [https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec\_SystemQueryOptiontop](https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptiontop)

#### order

[](#order)

Define which key to sort by and in which direction. [https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec\_SystemQueryOptionorderby](https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionorderby)

#### select

[](#select)

Define which values you want back. The ID is always included. [https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec\_SystemQueryOptionselect](https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)

#### expand

[](#expand)

You can attach related entities here. [https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec\_SystemQueryOptionexpand](https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)

#### all

[](#all)

Abacus does not output all data records, it works with \[@odata.nextLink\]. As long as @odata.nextLink exists, it has data records that can still be retrieved. A request is made with the all() function until all data records have been retrieved.

### Get all Values of the object

[](#get-all-values-of-the-object)

To get all available Values of the Address:

```
$values = $address->getValues();
```

This returns an array of all data.

### Get a single value of the object

[](#get-a-single-value-of-the-object)

Returns a single value based on its key:

```
$values = $address->getValue('SubjectId');
```

This returns an string.

### Change values

[](#change-values)

Set a new value for one or more keys.

```
$address->setValue('City', 'Solothurn');
OR
$address->setValues([
    'City' => 'Solothurn',
    'PostCode' => 3232
]);
```

### Save changes

[](#save-changes)

Saves the changes made with getValue or getValues.

```
$address->save();
```

### create new object

[](#create-new-object)

```
use AbacusAPIClient\ResourceType;
$address = $abacusClient->resource(ResourceType::ADDRESSES);
$address->setValues({
    'SubjectId' => 0,
    'Street'    => 'Hausenstrasse',
    ...
    ...
})

$address->save();
```

Available resource types and their access methods
-------------------------------------------------

[](#available-resource-types-and-their-access-methods)

To be able to use the 'short form' for the resource type, add a

```
use AbacusAPIClient\ResourceType;
```

to your code. You then can reference the resource type like

```
$abacusClient->resource( ResourceType::ADDRESSES );
```

Resource typeCategoryExpandImplemented &amp; testedACCOUNTDOCUMENTSFinanceAccount, Storage✔ACCOUNTSFinanceCurrency, Enterprise, ReferenceAccount, Documents✔ADDRESSESCRMSubject✔COMMUNICATIONSCRMLink, Subject✔COSTCENTREDOCUMENTSFinanceCostCentre, Storage✔COSTCENTRESFinanceEnterprise, Documents✔GENERALLEDGERENTRIESFinanceCrossDivisionHeader, FollowUpHeader,CollectiveHeader, Division, Journal, AccrualHeader, CrossDivisionPositions, FollowUpPositions, CollectivePositions, AccrualPositions, Documents✔GENERALLEDGERENTRYDOCUMENTSFinanceGeneralLedgerEntry, Storage✔JOURNALSFinanceEnterprise, GeneralLedgerEntries✔LINKDOCUMENTSCRMLink, Storage✔LINKTYPESCRMLinks✔LINKSCRMTargetSubject, LinkType, SourceSubject, Communications, Documents, SubjectGroupingEntries✔SUBJECTDOCUMENTSCRMSubject, Storage✔SUBJECTGROUPINGENTRIESCRMContactPersonReference, SubjectReference, ContainingSubjectGrouping✔SUBJECTGROUPINGSCRMEntries✔SUBJECTSCRMProjects, BeneficiaryAccounts, Divisions, Enterprises, Customers, CustomerInvoicesForReminder, CustomerInvoicesForSubject, Employee, Addresses, Communications, TargetLinks, SourceLinks, Documents, SubjectGroupingEntries✔

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance42

Moderate activity, may be stable

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity33

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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 ~16 days

Total

6

Last Release

482d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6cdb6851d74906a58628420672c82bd5a7e870aa84b5bfc9f0ad93d02a3b9d42?d=identicon)[Memurame](/maintainers/Memurame)

---

Top Contributors

[![Memurame](https://avatars.githubusercontent.com/u/15847494?v=4)](https://github.com/Memurame "Memurame (11 commits)")

---

Tags

apiabacus

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/memurame-abacus-php-rest-api/health.svg)

```
[![Health](https://phpackages.com/badges/memurame-abacus-php-rest-api/health.svg)](https://phpackages.com/packages/memurame-abacus-php-rest-api)
```

###  Alternatives

[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k7.6M74](/packages/openai-php-laravel)[get-stream/stream-chat

A PHP client for Stream Chat (https://getstream.io/chat/)

301.8M2](/packages/get-stream-stream-chat)

PHPackages © 2026

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