ercos / invoicing-sdk
v2.2.0
2025-07-15 11:43 UTC
Requires
- php: >=8.1
- guzzlehttp/guzzle: ^7.5
- nesbot/carbon: ^2.66
- phpoption/phpoption: ^1.9
- vlucas/phpdotenv: ^5.5
Requires (Dev)
- phpunit/phpunit: ^10
README
Pré-requis
PHP 8.1
Installation
composer require ercos/invoicing-sdk
Configuration
Ajoutez les variables d'environnement :
INVOICING_BASE_URLURL de l'api de facturation. Examplehttp://localhost:8000INVOICING_APP_TOKENjeton d'authentification
Utilisation
Pour pouvoir communiquer avec l'API, une nouvelle App doit être créée et récupérer le jeton d'authentification.
Chaque application peut ensuite créer plusieurs Vendors et, pour chacun d'entre eux, créer des factures et les paiements correspondants.
Entités existantes :
- Vendor
- Invoice
- InvoiceLineCollection
- MetadataCollection
- Payment
Exemple d'utilisation :
$invoice = Invoice::store(new StoreInvoiceDto(
vendor_id: 1,
date: '2020-10-10',
status: InvoiceStatus::Sent,
customer_name: 'Dev test',
invoice_lines: new InvoiceLineDtoCollection([
new InvoiceLineDto(
name: 'test item',
unit_price_tax_included: 100,
quantity: 1
)
]),
customer_email: 'test@test.com'
));
$invoice->send();