kirchdev / laravel-lexware-office
Lexware Office (formerly lexoffice) API client for Laravel: typed resources, rate limiting, retries, and verified webhooks.
Package info
github.com/kirchDev/laravel-lexware-office
pkg:composer/kirchdev/laravel-lexware-office
Requires
- php: ^8.4
- ext-openssl: *
- illuminate/cache: ^13.0
- illuminate/contracts: ^13.0
- illuminate/events: ^13.0
- illuminate/http: ^13.0
- illuminate/routing: ^13.0
- illuminate/support: ^13.0
- spatie/laravel-package-tools: ^1.93.1
Requires (Dev)
- larastan/larastan: ^3.9
- laravel/pint: ^1.29
- orchestra/testbench: ^11.0
- pestphp/pest: ^5.0
- pestphp/pest-plugin-laravel: ^5.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-12-05 17:36:16 UTC
README
๐ฆ laravel-lexware-office
Lexware Office (formerly lexoffice) API client for Laravel: typed resources, rate limiting, retries, and verified webhooks.
use KirchDev\LexwareOffice\Facades\LexwareOffice; $invoice = LexwareOffice::invoices()->get($invoiceId);
Read the exact invoice total with $invoice->totalPrice->totalGrossAmount?->value.
๐ฆ Installation
Requires PHP 8.4+ with OpenSSL and Laravel 13.
composer require kirchdev/laravel-lexware-office
Set LEXWARE_OFFICE_API_KEY to the API key for your organization. The package registers its service provider automatically. Create a Lexware API key
๐ Quick start
Create a customer, then retrieve the contact by the ID in the action result.
use KirchDev\LexwareOffice\Data\{Contact, ContactRole, ContactRoles, Person}; use KirchDev\LexwareOffice\Facades\LexwareOffice; $contacts = LexwareOffice::contacts(); $result = $contacts->create(new Contact( roles: new ContactRoles(customer: new ContactRole()), version: 0, person: new Person(lastName: 'Musterfrau', firstName: 'Inge'), )); $customer = $contacts->get($result->id); foreach ($contacts->list(name: 'Musterfrau', customer: true) as $match) { echo $match->id, PHP_EOL; }
โจ Features
- ๐งพ Sales documents โ Create draft or finalized invoices, quotations and credit notes. Download their PDF or supported e-invoice representation.
- ๐ Files โ Upload voucher bytes as multipart data. Read the file ID and voucher ID from the accepted upload.
- ๐ข Exact decimals โ Use
new Decimal('19.9900')for amounts, tax rates and quantities. The client writes JSON numbers and preserves their precision when reading. - โฑ๏ธ Shared rate limiting โ Workers sharing a cache coordinate requests per API key. The client handles throttling and temporary server failures. Retry and configuration contract
- ๐ก Webhooks โ Register subscriptions and listen for signed events such as
InvoiceStatusChanged. Webhook setup
โ๏ธ Configuration
The default gateway is https://api.lexware.io. Set LEXWARE_OFFICE_CACHE_STORE to a shared cache that supports atomic add and increment for all workers using the same API key. To publish the configuration, run php artisan vendor:publish --tag=lexware-office-config. Configuration
๐ค Contributing
Target dev and run the full gate locally. HTTP tests run against shared fixtures and the official signed webhook example. Development setup
๐ฃ๏ธ Versioning
Releases follow Semantic Versioning through release-please. The first release creates the changelog.