dkd-dobberkau/easybill-api-client
最新稳定版本:v1.0.0
Composer 安装命令:
composer require dkd-dobberkau/easybill-api-client
包简介
PHP client for the Easybill REST API
README 文档
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
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-01-31