PHPackages                             enlivy/enlivy-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. enlivy/enlivy-php

ActiveLibrary[API Development](/categories/api)

enlivy/enlivy-php
=================

Official PHP client library for the Enlivy API

2.5.0(1w ago)0185MITPHPPHP &gt;=8.3

Since Feb 5Pushed 3mo agoCompare

[ Source](https://github.com/enlivy/enlivy-php)[ Packagist](https://packagist.org/packages/enlivy/enlivy-php)[ Docs](https://enlivy.com)[ RSS](/packages/enlivy-enlivy-php/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (10)Dependencies (15)Versions (17)Used By (0)

Enlivy PHP SDK
==============

[](#enlivy-php-sdk)

[![CI](https://github.com/enlivy/enlivy-php/actions/workflows/ci.yml/badge.svg)](https://github.com/enlivy/enlivy-php/actions/workflows/ci.yml)[![Latest Version](https://camo.githubusercontent.com/d2f84d190cb120b83273dc5e8b9eff55fd947fe882fdee733769155b8e33a569/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f656e6c6976792f656e6c6976792d7068702e737667)](https://packagist.org/packages/enlivy/enlivy-php)[![License: MIT](https://camo.githubusercontent.com/08cef40a9105b6526ca22088bc514fbfdbc9aac1ddbf8d4e6c750e3a88a44dca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d626c75652e737667)](LICENSE)

Official PHP client library for the [Enlivy API](https://enlivy.com). Follows [Semantic Versioning](https://semver.org/); breaking changes ship only in major versions, with migration notes in [UPGRADING.md](UPGRADING.md).

Requirements
------------

[](#requirements)

- PHP 8.3+
- `ext-curl`, `ext-json`, `ext-mbstring`

Installation
------------

[](#installation)

```
composer require enlivy/enlivy-php
```

Quick Start
-----------

[](#quick-start)

```
$client = new \Enlivy\EnlivyClient([
    'api_key' => '1|your_api_token',
    'organization_id' => 'org_xxx',
]);

// List invoices
$invoices = $client->invoices->list(['per_page' => 25]);

foreach ($invoices as $invoice) {
    echo $invoice->id . "\n";
}

// Create
$invoice = $client->invoices->create([
    'organization_receiver_user_id' => 'org_user_xxx',
    'status' => 'draft',
    'currency' => 'EUR',
    'payment_method' => 'bank_transfer',
    'delivery_method' => 'email',
    'line_items' => [
        [
            'name_lang_map' => ['en' => 'Consulting Services'],
            'quantity' => 10,
            'price' => 100.00,
            'type' => 'service',
        ],
    ],
]);

// Retrieve with related data
$invoice = $client->invoices->retrieve('org_inv_xxx', [
    'include' => ['sender_user', 'receiver_user', 'line_items'],
]);

// Update
$client->invoices->update('org_inv_xxx', ['status' => 'pending']);

// Delete
$client->invoices->delete('org_inv_xxx');
```

Configuration
-------------

[](#configuration)

```
// Per-client configuration
$client = new \Enlivy\EnlivyClient([
    'api_key' => '1|your_token',
    'organization_id' => 'org_xxx',
    'api_base' => 'https://api.enlivy.com',
    'timeout' => 30,
]);

// Or global configuration
\Enlivy\Enlivy::setApiKey('1|your_token');
\Enlivy\Enlivy::setOrganizationId('org_xxx');
$client = new \Enlivy\EnlivyClient();
```

Documentation
-------------

[](#documentation)

Detailed guides with code examples for every feature:

### Getting Started

[](#getting-started)

GuideDescription[Authentication](docs/authentication.md)API keys, OAuth client credentials, global config[OAuth Server](docs/oauth.md)OAuth 2.0 server for third-party app integrations[Includes (Eager Loading)](docs/includes.md)Load related resources in a single request[Filters](docs/filters.md)Search, sort, paginate, and filter list endpoints### Billing &amp; Invoicing

[](#billing--invoicing)

GuideDescription[Invoices](docs/organization/invoices.md)Create, send, charge, and chase invoices, including scheduled payment reminders[Receipts](docs/organization/receipts.md)Receipt management and tracking[Billing Packages](docs/organization/billing-packages.md)Reusable billing templates with payment plans[Proposals](docs/organization/proposals.md)Send proposals to prospects and customers[Products](docs/organization/products.md)Product and service catalog[Taxes](docs/organization/taxes.md)Tax classes and rates, plus the compliance engine: registrations, the tax-event subledger, and filing periods### CRM &amp; Sales

[](#crm--sales)

GuideDescription[Prospects](docs/organization/prospects.md)Sales pipeline, lead tracking, and CRM[Organization Users](docs/organization/users.md)Customers, employees, and roles[Projects](docs/organization/projects.md)Projects, team members, and permissions### Contracts

[](#contracts)

GuideDescription[Contracts](docs/organization/contracts.md)Contract management, e-signatures, templates, and what references a contract### Banking

[](#banking)

GuideDescription[Bank Accounts](docs/organization/bank-accounts.md)Bank accounts, transactions, and reconciliation### Content &amp; Reports

[](#content--reports)

GuideDescription[Reports](docs/organization/reports.md)Dynamic reports with custom schemas[Files](docs/organization/files.md)File uploads and attachments### Integrations

[](#integrations)

GuideDescription[Event Destinations](docs/organization/event-destinations.md)Real-time event delivery (webhooks, Slack) and signature verification[Event Trails](docs/organization/event-trails.md)Read-only audit history for invoices, receipts, and billing schedules[Customer Portal](docs/organization/customer-portal.md)Client-facing portal for invoices, contracts, and proposals[Integrations](docs/integrations.md)Stripe, ANAF, and other third-party services[AI Agents](docs/ai-agents.md)AI-powered automationError Handling
--------------

[](#error-handling)

```
use Enlivy\Exception\{
    ValidationException,
    NotFoundException,
    AuthenticationException,
    RateLimitException,
};

try {
    $invoice = $client->invoices->retrieve('org_inv_xxx');
} catch (ValidationException $e) {
    $errors = $e->errors(); // ['field' => ['error message']]
} catch (NotFoundException $e) {
    // 404
} catch (AuthenticationException $e) {
    // 401
} catch (RateLimitException $e) {
    $retryAfter = $e->retryAfter(); // seconds
}
```

Pagination
----------

[](#pagination)

```
$invoices = $client->invoices->list(['page' => 1, 'per_page' => 25]);

echo "Page " . $invoices->getCurrentPage() . " of " . $invoices->getTotalPages();

foreach ($invoices as $invoice) {
    echo $invoice->id;
}

// Or iterate every item across all pages; follow-up pages are fetched lazily
foreach ($invoices->autoPagingIterator() as $invoice) {
    echo $invoice->id;
}
```

Request Options
---------------

[](#request-options)

Every service method accepts an optional `RequestOptions` as its last argument:

```
use Enlivy\Util\RequestOptions;

$invoice = $client->invoices->create($params, new RequestOptions(
    organizationId: 'org_other',      // per-request organization override
    idempotencyKey: 'idem_xyz',       // safe write retries
    locale: 'ro',                     // Accept-Language for localized fields
    timeout: 60,                      // per-request timeout (seconds)
    headers: ['X-Custom' => 'value'], // extra headers
));
```

Retries
-------

[](#retries)

Transient failures (connection errors, `429`, `5xx`) are retried automatically with exponential backoff — for `GET` requests, and for writes that carry an `Idempotency-Key`. Configure via `max_retries` on the client (default `2`, `0`disables) or globally with `Enlivy::setMaxNetworkRetries()`.

Response Metadata
-----------------

[](#response-metadata)

Every object the SDK returns carries the raw response it was hydrated from — status code, headers, and the decoded body — via `lastResponse()`. Reach for it when an endpoint returns data alongside the resource in `meta`, such as the inline first-charge result on a newly created billing schedule:

```
$schedule = $client->billingSchedules->fromBillingPackage([/* … */]);

$response = $schedule->lastResponse();
$response?->statusCode;                 // 201
$response?->getHeader('X-Request-Id');
$response?->json['meta']['charge_result'] ?? null;
```

API Discovery
-------------

[](#api-discovery)

The SDK includes a discovery service for programmatic API introspection:

```
// List all available API resources
$resources = $client->discovery->list();

// Get detailed metadata for a specific resource
$invoiceSpec = $client->discovery->resource('organization_invoices');
```

Key Concepts
------------

[](#key-concepts)

### Multilingual Fields

[](#multilingual-fields)

Most text fields use `_lang_map` for multilingual support:

```
'name_lang_map' => [
    'en' => 'Consulting Services',
    'ro' => 'Servicii de Consultanta',
],
```

### ID Prefixes

[](#id-prefixes)

All IDs use prefixes to identify the resource type:

PrefixResource`org_`Organization`org_user_`Organization User`org_inv_`Invoice`org_cont_`Contract`org_pros_`Prospect`org_proj_`Project`org_prod_`Product`org_prop_`ProposalTesting
-------

[](#testing)

```
./vendor/bin/phpunit              # Unit tests
./vendor/bin/phpstan analyse      # Static analysis
```

License
-------

[](#license)

MIT License. See [LICENSE](LICENSE) for details.

Support
-------

[](#support)

- [API Documentation](https://docs.enlivy.com/api)
- [Issues](https://github.com/enlivy/enlivy-php/issues)

###  Health Score

44

—

FairBetter than 90% of packages

Maintenance89

Actively maintained with recent releases

Popularity13

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~12 days

Recently: every ~4 days

Total

16

Last Release

11d ago

Major Versions

0.2.0 → 1.0.02026-06-12

1.1.0 → 2.0.02026-07-19

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/91498903?v=4)[Enlivy](/maintainers/enlivy)[@enlivy](https://github.com/enlivy)

---

Top Contributors

[![robertuniqid](https://avatars.githubusercontent.com/u/3656623?v=4)](https://github.com/robertuniqid "robertuniqid (15 commits)")

---

Tags

apicontractssdkbusinesscrminvoicingenlivyproposals

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/enlivy-enlivy-php/health.svg)

```
[![Health](https://phpackages.com/badges/enlivy-enlivy-php/health.svg)](https://phpackages.com/packages/enlivy-enlivy-php)
```

###  Alternatives

[invoiced/invoiced

Invoiced PHP Library

14121.5k](/packages/invoiced-invoiced)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
