dkd-dobberkau / easybill-api-client
PHP client for the Easybill REST API
Package info
github.com/dkd-dobberkau/easybill-api-client-php
pkg:composer/dkd-dobberkau/easybill-api-client
v1.0.0
2026-01-31 22:01 UTC
Requires
- php: >=8.2
- guzzlehttp/guzzle: ^7.0
- psr/log: ^3.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.0
- phpstan/phpstan: ^1.10
- phpunit/phpunit: ^10.0
README
PHP client for the Easybill REST API.
Requirements
- PHP 8.2+
- Composer
Installation
composer require dkd-dobberkau/easybill-api-client
Usage
use Dkd\EasybillClient\EasybillClient; use Dkd\EasybillClient\DocumentType; $client = new EasybillClient(apiKey: 'your-api-key'); // Get all customers $customers = $client->getCustomers(); // Get invoices for a year $invoices = $client->getInvoices(year: 2025); // Get all documents $documents = $client->getDocuments(); // Get documents of specific type $offers = $client->getDocuments(documentType: DocumentType::OFFER); // Get projects $projects = $client->getProjects();
API
EasybillClient
getCustomers(int $limit = 1000)- Get all customersgetCustomer(int $customerId)- Get single customergetDocuments(?DocumentType $documentType, ?DateTimeImmutable $startDate, ?DateTimeImmutable $endDate, ?int $customerId, ?string $status, int $limit)- Get documentsgetInvoices(?int $year, ?DateTimeImmutable $startDate, ?DateTimeImmutable $endDate, ?int $customerId)- Get invoicesgetDocument(int $documentId, bool $withItems = true)- Get single documentgetDocumentPdf(int $documentId)- Download document PDFgetProjects(?int $customerId, int $limit)- Get projects
Document Types
use Dkd\EasybillClient\DocumentType; DocumentType::INVOICE DocumentType::CREDIT DocumentType::OFFER DocumentType::ORDER DocumentType::RECURRING
Exceptions
EasybillException- Base exceptionEasybillAuthenticationException- Authentication failed (401/403)EasybillRateLimitException- Rate limit exceeded (429)EasybillNotFoundException- Resource not found (404)
Models
EasybillCustomer- Customer dataEasybillDocument- Invoice/document dataEasybillDocumentItem- Line item in documentEasybillProject- Project data
All models are readonly classes with a static fromArray() factory method.
License
MIT