PHPackages                             xavicabot/laravel-holded - 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. xavicabot/laravel-holded

ActiveLibrary[API Development](/categories/api)

xavicabot/laravel-holded
========================

PHP client for the Holded API, ready for Laravel

v3.0(3mo ago)2459↓90.2%MITPHPPHP ^8.2

Since Jul 15Pushed 3mo agoCompare

[ Source](https://github.com/xavicabot/laravel-holded)[ Packagist](https://packagist.org/packages/xavicabot/laravel-holded)[ RSS](/packages/xavicabot-laravel-holded/feed)WikiDiscussions main Synced 3d ago

READMEChangelog (1)Dependencies (11)Versions (23)Used By (0)

Laravel Holded
==============

[](#laravel-holded)

PHP client for the [Holded](https://www.holded.com) API, designed for Laravel 11 and 12.

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

[](#requirements)

LaravelPHP11.x^8.212.x^8.2Installation
------------

[](#installation)

```
composer require xavicabot/laravel-holded
```

Publish the configuration file:

```
php artisan vendor:publish --tag=config --provider="XaviCabot\Laravel\Holded\HoldedServiceProvider"
```

Add to your `.env`:

```
HOLDED_API=your_api_key
```

Usage
-----

[](#usage)

```
use XaviCabot\Laravel\Holded\Facades\Holded;
```

### Contacts

[](#contacts)

```
$contacts = Holded::contact()->list();
$contact  = Holded::contact()->get('contactId');
$new      = Holded::contact()->create(['name' => 'Acme Inc']);
Holded::contact()->update('contactId', ['name' => 'Acme Corp']);
Holded::contact()->delete('contactId');
```

You can also use the `ContactData` DTO for validation and normalization:

```
use XaviCabot\Laravel\Holded\DTOs\ContactData;

$data = new ContactData(
    name: 'Acme Inc',
    email: 'info@acme.com',
    type: 'client',
    countryCode: 'ES',
);

Holded::contact()->create($data);
```

### Documents

[](#documents)

```
use XaviCabot\Laravel\Holded\Enums\DocumentType;

$invoices = Holded::document()->list(page: 1, docType: DocumentType::INVOICE);
$invoice  = Holded::document()->get('docId', DocumentType::INVOICE);
Holded::document()->delete('docId', DocumentType::INVOICE);
```

Create a document using the `DocumentData` DTO:

```
use XaviCabot\Laravel\Holded\DTOs\DocumentData;

$data = new DocumentData(
    date: new DateTime(),
    contactName: 'Acme Inc',
    items: [
        ['description' => 'Consulting', 'quantity' => 10, 'price' => 75.00],
    ],
);

Holded::document()->create($data, DocumentType::INVOICE);
```

Available document types: `INVOICE`, `SALES_RECEIPT`, `CREDIT_NOTE`, `SALES_ORDER`, `PROFORM`, `WAYBILL`, `ESTIMATE`, `PURCHASE`, `PURCHASE_ORDER`, `PURCHASE_REFUND`.

### Attach files

[](#attach-files)

```
Holded::document()->attach('docId', '/path/to/file.pdf', setMain: true, docType: DocumentType::PURCHASE);
```

### Get document PDF

[](#get-document-pdf)

```
$response = Holded::document()->pdf('docId', DocumentType::INVOICE);
$pdfContent = base64_decode($response['data']);
```

### Multi-account

[](#multi-account)

Define accounts in `config/holded.php`:

```
'accounts' => [
    'main' => [
        'api_key' => env('HOLDED_API_MAIN'),
        'base_url' => env('HOLDED_API_URL_MAIN', 'https://api.holded.com/api/invoicing/v1/'),
    ],
],
```

Then use them:

```
Holded::account('main')->contact()->list();
```

Or set credentials at runtime:

```
Holded::withCredentials('API_KEY', 'https://api.holded.com/api/invoicing/v1/')
    ->contact()
    ->list();
```

Error handling
--------------

[](#error-handling)

All API errors throw a `HoldedException` with access to status code and response body:

```
use XaviCabot\Laravel\Holded\Exceptions\HoldedException;

try {
    Holded::contact()->get('invalid-id');
} catch (HoldedException $e) {
    $e->getStatusCode();    // 404
    $e->getResponseBody();  // ['message' => '...']
    $e->isRateLimited();    // true on 429
    $e->isServerError();    // true on 5xx
    $e->isClientError();    // true on 4xx
}
```

Rate-limited (429) and server error (5xx) requests are automatically retried with backoff. Configure in `config/holded.php`:

```
'retry' => [
    'max_retries' => 3,
    'retry_delay' => 1000, // milliseconds
    'retry_on_server_error' => true,
],
```

Testing
-------

[](#testing)

```
composer test
```

License
-------

[](#license)

MIT

###  Health Score

43

—

FairBetter than 89% of packages

Maintenance79

Regular maintenance activity

Popularity15

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity59

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 ~61 days

Total

22

Last Release

109d ago

Major Versions

v1.0.20 → v2.02025-12-17

v2.0 → v3.02026-03-17

PHP version history (2 changes)v1.0.0PHP ^8.1

v3.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/c306544de15f8dabd17b623e794ab75e5905b7d89c2a4b56e7fec629d2a02347?d=identicon)[xavicabot](/maintainers/xavicabot)

---

Top Contributors

[![xavicabot](https://avatars.githubusercontent.com/u/25738574?v=4)](https://github.com/xavicabot "xavicabot (26 commits)")

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/xavicabot-laravel-holded/health.svg)

```
[![Health](https://phpackages.com/badges/xavicabot-laravel-holded/health.svg)](https://phpackages.com/packages/xavicabot-laravel-holded)
```

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M3.1k](/packages/craftcms-cms)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M46](/packages/tencentcloud-tencentcloud-sdk-php)[spatie/laravel-export

Create a static site bundle from a Laravel app

674146.0k6](/packages/spatie-laravel-export)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5022.0k](/packages/simplestats-io-laravel-client)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

273.0k](/packages/eslazarev-wildberries-sdk)[jasara/php-amzn-selling-partner-api

A fluent interface for Amazon's Selling Partner API in PHP

1348.7k1](/packages/jasara-php-amzn-selling-partner-api)

PHPackages © 2026

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