dkd-dobberkau/easybill-api-client

PHP client for the Easybill REST API

Maintainers

Package info

github.com/dkd-dobberkau/easybill-api-client-php

pkg:composer/dkd-dobberkau/easybill-api-client

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.0 2026-01-31 22:01 UTC

This package is auto-updated.

Last update: 2026-03-29 01:14:17 UTC


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 customers
  • getCustomer(int $customerId) - Get single customer
  • getDocuments(?DocumentType $documentType, ?DateTimeImmutable $startDate, ?DateTimeImmutable $endDate, ?int $customerId, ?string $status, int $limit) - Get documents
  • getInvoices(?int $year, ?DateTimeImmutable $startDate, ?DateTimeImmutable $endDate, ?int $customerId) - Get invoices
  • getDocument(int $documentId, bool $withItems = true) - Get single document
  • getDocumentPdf(int $documentId) - Download document PDF
  • getProjects(?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 exception
  • EasybillAuthenticationException - Authentication failed (401/403)
  • EasybillRateLimitException - Rate limit exceeded (429)
  • EasybillNotFoundException - Resource not found (404)

Models

  • EasybillCustomer - Customer data
  • EasybillDocument - Invoice/document data
  • EasybillDocumentItem - Line item in document
  • EasybillProject - Project data

All models are readonly classes with a static fromArray() factory method.

License

MIT