10quality / emizor-php-sdk
PHP SDK for the Emizor 5 REST API.
v1.0.0-rc1
2026-04-06 18:31 UTC
Requires
- php: ^8.2
- guzzlehttp/guzzle: ^7.9
- vlucas/phpdotenv: ^5.6
Requires (Dev)
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^11.5
This package is auto-updated.
Last update: 2026-04-06 18:44:54 UTC
README
PHP SDK for the Emizor 5 REST API with Guzzle transport, .env support, PHPUnit coverage, and static analysis.
Requirements
- PHP
^8.2 - Composer
^2
Features
- Injectable SDK client under the
Emizornamespace. - Guzzle-based HTTP transport with Emizor authentication headers.
- Environment-backed configuration via
EMIZOR_*variables. - Coverage for all endpoints documented in the bundled Emizor 5 REST API reference.
- Enum support for documented API constants such as document and payment types.
- PHPUnit and PHPStan integration for testing and code quality.
Installation
composer install
Or install the package in another project:
composer require 10quality/emizor-php-sdk
Environment Variables
EMIZOR_BASE_URL=https://{your-env}.emizor.com EMIZOR_API_TOKEN=your-api-token EMIZOR_API_SECRET=password
Quick Start
<?php require __DIR__ . '/vendor/autoload.php'; use Dotenv\Dotenv; use Emizor\Emizor; $dotenv = Dotenv::createImmutable(__DIR__); $dotenv->safeLoad(); $emizor = Emizor::fromEnvironment(); $products = $emizor->products()->list(); print_r($products);
Available Endpoints
- Verify NIT:
verifyNit(string $nit) - Create client:
clients()->create(array $payload) - Create invoice or prefactura:
invoices()->create(array $payload, ?InvoiceOptions $options = null) - Generate QR for prefactura:
invoices()->generateQr(array $invoiceIds, bool $publish = false) - Emit prefactura:
invoices()->emitPrefactura(string $originId) - Check invoice status:
invoices()->status(string $originId) - List products:
products()->list(int $page = 1, string $filter = '')
Docs
- Main usage guide: docs/README.md
- Endpoint guide: docs/endpoints.md
- Full workflow sample: docs/samples/all-endpoints.php
- Basic sample: docs/samples/basic-usage.php
Quality Checks
composer analyse
composer test
composer test:coverage