PHPackages                             clicksports/lex-office-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. [HTTP &amp; Networking](/categories/http)
4. /
5. clicksports/lex-office-api

Abandoned → [sysix/lex-office-api](/?search=sysix%2Flex-office-api)Library[HTTP &amp; Networking](/categories/http)

clicksports/lex-office-api
==========================

Simple API Integration for Lexoffice

1.6.0(6mo ago)2348.9k↓33.3%10MITPHPPHP ^8.1CI passing

Since Jun 1Pushed 1mo ago4 watchersCompare

[ Source](https://github.com/Sysix/lexoffice-php-api)[ Packagist](https://packagist.org/packages/clicksports/lex-office-api)[ RSS](/packages/clicksports-lex-office-api/feed)WikiDiscussions development Synced 1mo ago

READMEChangelog (10)Dependencies (8)Versions (34)Used By (0)

Lexoffice PHP API
=================

[](#lexoffice-php-api)

[![tests](https://github.com/sysix/lexoffice-php-api/workflows/tests/badge.svg)](https://github.com/sysix/lexoffice-php-api/workflows/tests/badge.svg)[![test coverage](https://raw.githubusercontent.com/sysix/lexoffice-php-api/badges/.badges/development/coverage.svg)](https://raw.githubusercontent.com/sysix/lexoffice-php-api/badges/.badges/development/coverage.svg)[![type coverage](https://camo.githubusercontent.com/269a0f87a0fba3caf730a97b19cf5176a2e3b7f3ba43fc17d8e391ed9bfe1b21/68747470733a2f2f73686570686572642e6465762f6769746875622f53797369782f6c65786f66666963652d7068702d6170692f636f7665726167652e737667)](https://shepherd.dev/github/Sysix/lexoffice-php-api)[![Latest Stable Version](https://camo.githubusercontent.com/ca4c2112ae77cd598c6554e9106dca8ca376ff8b990d25030b3d1e40ebcd255f/68747470733a2f2f706f7365722e707567782e6f72672f73797369782f6c65782d6f66666963652d6170692f76)](//packagist.org/packages/sysix/lex-office-api)[![License](https://camo.githubusercontent.com/2f6d58d75ae539f5a57596b881bf06ca21ef62e6caf0c6e9db7edaf07c589cbc/68747470733a2f2f706f7365722e707567782e6f72672f73797369782f6c65782d6f66666963652d6170692f6c6963656e7365)](//packagist.org/packages/sysix/lex-office-api)

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

[](#requirements)

PHP: &gt;= 8.1 Extensions:

- [Composer](https://getcomposer.org/)
- [PHP-JSON](https://www.php.net/manual/en/book.json.php)
- [PSR-18 HTTP-Client](https://packagist.org/providers/psr/http-client-implementation)

Install
-------

[](#install)

composer: `composer require sysix/lex-office-api`

Usage
-----

[](#usage)

Search for the [official API Documentation](https://developers.lexoffice.io/docs/). You need an [API Key](https://app.lexoffice.de/addons/public-api) for that.

### Basic

[](#basic)

```
// store keys in .env file
$apiKey = getenv('LEXOFFICE_API_KEY');

// in this example we are using guzzlehttp/guzzle package, it can be any PSR-18 HTTP Client
// see: https://packagist.org/providers/psr/http-client-implementation
$httpClient = \GuzzleHttp\Client();
$api = new \Sysix\LexOffice\Api($apiKey, $httpClient);
```

### Optimize your HTTP Client

[](#optimize-your-http-client)

This library only prepares the `\Psr\Http\Message\RequestInterface` for the HTTP Client and returns its Response. There are almost no error checks, no caching and no rate limiting. Your PSR-18 HTTP Client should come with a way to deal with it.

Here is a example with `guzzlehttp/guzzle` , `kevinrob/guzzle-cache-middleware` and `spatie/guzzle-rate-limiter-middleware`:

```
$apiKey = getenv('LEXOFFICE_API_KEY');

$stack = \GuzzleHttp\HandlerStack::create();
$stack->push(new \Kevinrob\GuzzleCache\CacheMiddleware(), 'cache');
$stack->push(\Spatie\GuzzleRateLimiterMiddleware\RateLimiterMiddleware::perSecond(2));

$httpClient = \GuzzleHttp\Client(['handler' => $stack]);
$api = new \Sysix\LexOffice\Api($apiKey, $httpClient);
```

Endpoints
---------

[](#endpoints)

### Article Endpoint

[](#article-endpoint)

```
/** @var \Sysix\LexOffice\Api $api */
$client = $api->article();

// filters
$client->size = 100;
$client->sortDirection = 'DESC';

$client->articleNumber = 'LXW-BUHA-2024-001';
$client->gtin = '9783648170632';
$client->type = 'PRODUCT';

// get a page
$response = $client->getPage(0);

// other methods
$response = $client->get($entityId);
$response = $client->create($data);
$response = $client->update($entityId, $data);
$response = $client->delete($entityId);
```

### Contact Endpoint

[](#contact-endpoint)

```
$client = $api->contact();

// filters
$client->size = 100;
$client->email = 'john.doe@example.com';
$client->name = 'John Doe';
$client->number = 123456;
$client->customer = true;
$client->vendor = false;

// get a page
$response = $client->getPage(0);

// other methods
$response = $client->get($entityId);
$response = $client->create($data);
$response = $client->update($entityId, $data);
```

### Country Endpoint

[](#country-endpoint)

```
$response = $api->country()->getAll();
```

### Credit Notes Endpoint

[](#credit-notes-endpoint)

```
$voucherList = $api->creditNote()->getVoucherListClient(); // see VoucherlistClient Documentation
$response = $api->creditNote()->get($entityId);
$response = $api->creditNote()->create($data);
$response = $api->creditNote()->create($data, true); // finalized
$response = $api->creditNote()->pursue($precedingSalesVoucherId, $data);
$response = $api->creditNote()->pursue($precedingSalesVoucherId, $data, true); // finalized
$response = $api->creditNote()->file($entityId); // get file content
$response = $api->creditNote()->file($entityId, 'application/xml'); // as XRechnung

// deprecated methods:
$response = $api->creditNote()->document($entityId); // get document ID
$response = $api->creditNote()->document($entityId, true); // get file content
$response = $api->creditNote()->document($entityId, true, 'application/xml'); // as XRechnung
```

### Deliverys Notes Endpoint

[](#deliverys-notes-endpoint)

```
$voucherList = $api->deliveryNote()->getVoucherListClient(); // see VoucherlistClient Documentation
$response = $api->deliveryNote()->get($entityId);
$response = $api->deliveryNote()->create($data);
$response = $api->deliveryNote()->pursue($precedingSalesVoucherId, $data);
$response = $api->deliveryNote()->file($entityId); // get file content

// deprecated methods:
$response = $api->deliveryNote()->document($entityId); // get document ID
$response = $api->deliveryNote()->document($entityId, true); // get file content
```

### Down Payment Invoices Endpoint

[](#down-payment-invoices-endpoint)

```
$voucherList = $api->downPaymentInvoice()->getVoucherListClient(); // see VoucherlistClient Documentation
$response = $api->downPaymentInvoice()->get($entityId);
$response = $api->downPaymentInvoice()->create($data);
$response = $api->downPaymentInvoice()->file($entityId); // get file content
$response = $api->downPaymentInvoice()->file($entityId, 'application/xml'); // as XRechnung

// deprecated methods:
$response = $api->downPaymentInvoice()->document($entityId); // get document ID
$response = $api->downPaymentInvoice()->document($entityId, true); // get file content
$response = $api->downPaymentInvoice()->document($entityId, true, 'application/xml'); // as XRechnung
```

### Dunnings Endpoint

[](#dunnings-endpoint)

```
$response = $api->dunning()->get($entityId);
$response = $api->dunning()->pursue($precedingSalesVoucherId, $data);
$response = $api->dunning()->file($entityId); // get file content

// deprecated methods:
$response = $api->dunning()->document($entityId); // get document ID
$response = $api->dunning()->document($entityId, true); // get file content
```

### Event Subscriptions Endpooint

[](#event-subscriptions-endpooint)

```
$response = $api->event()->get($entityId);
$response = $api->event()->create($data);
$response = $api->event()->delete($entityId);
$response = $api->event()->getAll();
```

### File Endpoint

[](#file-endpoint)

```
$response = $api->file()->upload($filePath, $voucherType);
$response = $api->file()->get($entityId); // accept every file
$response = $api->file()->get($entityId, 'image/*'); // accept only images
$response = $api->file()->get($entityId, 'application/xml'); // get XRechung XML File (if possible)
```

### Invoices Endpoint

[](#invoices-endpoint)

```
$voucherList = $api->invoice()->getVoucherListClient(); // see VoucherlistClient Documentation
$response = $api->invoice()->get($entityId);
$response = $api->invoice()->create($data);
$response = $api->invoice()->create($data, true); // finalized
$response = $api->invoice()->pursue($precedingSalesVoucherId, $data);
$response = $api->invoice()->pursue($precedingSalesVoucherId, $data, true); // finalized
$response = $api->invoice()->file($entityId); // get file content
$response = $api->invoice()->file($entityId, 'application/xml'); // as XRechnung

// deprecated methods:
$response = $api->invoice()->document($entityId); // get document ID
$response = $api->invoice()->document($entityId, true); // get file content
$response = $api->invoice()->document($entityId, true, 'application/xml'); // as XRechung XML File
```

### Order Confirmation Endpoint

[](#order-confirmation-endpoint)

```
$voucherList = $api->orderConfirmation()->getVoucherListClient(); // see VoucherlistClient Documentation
$response = $api->orderConfirmation()->get($entityId);
$response = $api->orderConfirmation()->create($data);
$response = $api->orderConfirmation()->pursue($precedingSalesVoucherId, $data);
$response = $api->orderConfirmation()->file($entityId); // get file content

// deprecated methods:
$response = $api->orderConfirmation()->document($entityId); // get document ID
$response = $api->orderConfirmation()->document($entityId, true); // get file content
```

### Payment Endpoint

[](#payment--endpoint)

```
$response = $api->payment()->get($entityId);
```

### Payment Conditions Endpoint

[](#payment-conditions-endpoint)

```
$response = $api->paymentCondition()->getAll();
```

### Posting Categories Endpoint

[](#posting-categories-endpoint)

```
$response = $api->postingCategory()->getAll();
```

### Print Layouts Endpoint

[](#print-layouts-endpoint)

```
$response = $api->printLayout()->getAll();
```

### Profile Endpoint

[](#profile-endpoint)

```
$response = $api->profile()->get();
```

### Quotation Endpoint

[](#quotation-endpoint)

```
$voucherList = $api->quotation()->getVoucherListClient(); // see VoucherlistClient Documentation
$response = $api->quotation()->get($entityId);
$response = $api->quotation()->create($data);
$response = $api->quotation()->create($data, true); // finalized
$response = $api->quotation()->file($entityId); // get file content

// deprecated methods:
$response = $api->quotation()->document($entityId); // get document ID
$response = $api->quotation()->document($entityId, true); // get file content
```

### Recurring Templates Endpoint

[](#recurring-templates-endpoint)

```
$client = $api->recurringTemplate();

// filters
$client->size = 100;
$client->sortDirection = 'DESC';
$client->sortColumn = 'updatedDate';

// get a page
$response = $client->getPage(0);

// other methods
$response = $api->recurringTemplate()->get($entityId);
```

### Voucher Endpoint

[](#voucher-endpoint)

```
$response = $api->voucher()->get($entityId);
$response = $api->voucher()->create($data);
$response = $api->voucher()->update($entityId, $data);
$response = $api->voucher()->upload($entitiyId, $filepath);
```

### Voucherlist Endpoint

[](#voucherlist-endpoint)

```
$client = $api->voucherlist();

$client->size = 100;
$client->sortDirection = 'DESC';
$client->sortColumn = 'voucherNumber';

// filters required
$client->types = [
    'salesinvoice',
    'salescreditnote',
    'purchaseinvoice',
    'purchasecreditnote',
    'invoice',
    'downpaymentinvoice',
    'creditnote',
    'orderconfirmation',
    'quotation'
];
$client->statuses = [
    'draft',
    'open',
    'paid',
    'paidoff',
    'voided',
    //'overdue', overdue can only be fetched alone
    'accepted',
    'rejected'
];

// filters optional
$client->archived = true;
$client->contactId = 'some-uuid-string';
$client->voucherDateFrom = new \DateTime('2023-12-01');
$client->voucherDateTo = new \DateTime('2023-12-01');
$client->createdDateFrom = new \DateTime('2023-12-01');;
$client->createdDateTo = new \DateTime('2023-12-01');
$client->updatedDateFrom = new \DateTime('2023-12-01');
$client->updatedDateTo = new \DateTime('2023-12-01');

// get a page
$response = $client->getPage(0);
```

Utils
-----

[](#utils)

### get JSON from Success and Error Response

[](#get-json-from-success-and-error-response)

```
// can be possible null because the response body can be empty
$json = \Sysix\LexOffice\Utils::getJsonFromResponse($response); // as object
$json = \Sysix\LexOffice\Utils::getJsonFromResponse($response, true); // as associative array
```

###  Health Score

58

—

FairBetter than 98% of packages

Maintenance84

Actively maintained with recent releases

Popularity38

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity75

Established project with proven stability

 Bus Factor1

Top contributor holds 83.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 ~85 days

Recently: every ~130 days

Total

24

Last Release

195d ago

Major Versions

0.17.0 → 1.0.02023-12-08

PHP version history (4 changes)0.9.0PHP ^7.4

0.12.1PHP ^7.4 | ^8

0.17.0PHP ^8

1.0.0PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/e6fa8700d652a25a8cd00c5b77306ddb975d73b40852fabdafb8e982e1adbf94?d=identicon)[Sysix](/maintainers/Sysix)

---

Top Contributors

[![Sysix](https://avatars.githubusercontent.com/u/3897725?v=4)](https://github.com/Sysix "Sysix (281 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (35 commits)")[![servusrene](https://avatars.githubusercontent.com/u/48084558?v=4)](https://github.com/servusrene "servusrene (14 commits)")[![antondollmaier](https://avatars.githubusercontent.com/u/1730675?v=4)](https://github.com/antondollmaier "antondollmaier (1 commits)")[![hinnerk-a](https://avatars.githubusercontent.com/u/185016?v=4)](https://github.com/hinnerk-a "hinnerk-a (1 commits)")[![MLDMoritz](https://avatars.githubusercontent.com/u/46711821?v=4)](https://github.com/MLDMoritz "MLDMoritz (1 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")[![aschempp](https://avatars.githubusercontent.com/u/1073273?v=4)](https://github.com/aschempp "aschempp (1 commits)")[![drscream](https://avatars.githubusercontent.com/u/315645?v=4)](https://github.com/drscream "drscream (1 commits)")

---

Tags

apiapi-clientlexofficephppsr-18apirestlex-officelexoffice

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Psalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/clicksports-lex-office-api/health.svg)

```
[![Health](https://phpackages.com/badges/clicksports-lex-office-api/health.svg)](https://phpackages.com/packages/clicksports-lex-office-api)
```

###  Alternatives

[shopify/shopify-api

Shopify API Library for PHP

4634.8M16](/packages/shopify-shopify-api)[sysix/lex-office-api

Simple API Integration for Lexoffice

2370.6k](/packages/sysix-lex-office-api)[onesignal/onesignal-php-api

A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com

34170.2k2](/packages/onesignal-onesignal-php-api)[ory/hydra-client

Documentation for all of Ory Hydra's APIs.

17435.9k](/packages/ory-hydra-client)[zenditplatform/zendit-php-sdk

PHP client for Zendit API

1204.3k](/packages/zenditplatform-zendit-php-sdk)[huaweicloud/huaweicloud-sdk-php

Huawei Cloud SDK for PHP

1829.2k2](/packages/huaweicloud-huaweicloud-sdk-php)

PHPackages © 2026

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