PHPackages                             andyfraussen/laravel-dokapi-client - 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. andyfraussen/laravel-dokapi-client

ActiveLibrary[API Development](/categories/api)

andyfraussen/laravel-dokapi-client
==================================

A comprehensive, fluent Laravel client for the Dokapi Peppol API with full DTO support and OAuth2 integration

v1.1.0(3mo ago)02MITPHPPHP ^8.3|^8.4|^8.5

Since Jan 26Pushed 3mo agoCompare

[ Source](https://github.com/andyfraussen/laravel-dokapi-client)[ Packagist](https://packagist.org/packages/andyfraussen/laravel-dokapi-client)[ RSS](/packages/andyfraussen-laravel-dokapi-client/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (6)Versions (3)Used By (0)

Laravel Dokapi Client
=====================

[](#laravel-dokapi-client)

[![Latest Version on Packagist](https://camo.githubusercontent.com/4048943a32c20dc459441c604017ace9d556d40ecddc154a477784428c313326/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616e6479667261757373656e2f6c61726176656c2d646f6b6170692d636c69656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/andyfraussen/laravel-dokapi-client)[![Total Downloads](https://camo.githubusercontent.com/aeb9b240f3380c26666f4b58becfddd7caf0d247f7224cbe0fedce6a630021ed/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616e6479667261757373656e2f6c61726176656c2d646f6b6170692d636c69656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/andyfraussen/laravel-dokapi-client)[![License](https://camo.githubusercontent.com/65cac181b6d39822cd37972eb1ddc9660f35c2f20203bc965e450c7325d343d9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f616e6479667261757373656e2f6c61726176656c2d646f6b6170692d636c69656e742e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)

A sleek, fluent, and strongly-typed Laravel client for the **Dokapi Peppol API**. Built for modern PHP 8.3+ and Laravel 11/12 environments.

Introduction
------------

[](#introduction)

Dokapi for Laravel provides a high-level, expressive interface for interacting with the Dokapi Peppol infrastructure. It abstracts away the complexities of OAuth2 authentication, token management, and raw API calls, allowing you to focus on building your application.

- **Developer Experience First:** A fluent, discoverable API that feels native to Laravel.
- **Type Safety:** Extensive use of DTOs ensures your IDE understands every response.
- **Production Ready:** Built-in OAuth2 caching, signature verification, and granular error handling.
- **Future Proof:** Fully optimized for PHP 8.3+ and Laravel 11/12.

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

[](#installation)

You may install the package via Composer:

```
composer require andyfraussen/laravel-dokapi-client
```

Next, you should publish the configuration file:

```
php artisan vendor:publish --provider="AndyFraussen\Dokapi\DokapiServiceProvider" --tag="dokapi-config"
```

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

[](#configuration)

After publishing the configuration, you may define your Dokapi credentials in your `.env` file:

```
DOKAPI_CLIENT_ID=your-client-id
DOKAPI_CLIENT_SECRET=your-client-secret
DOKAPI_BASE_URL=https://peppol-api.dokapi-stg.io/v1
DOKAPI_TOKEN_URL=https://dev-portal.dokapi.io/api/oauth2/token
DOKAPI_ACCESS_TOKEN=
DOKAPI_TIMEOUT=30
DOKAPI_CONNECT_TIMEOUT=10
DOKAPI_VERIFY=true
DOKAPI_USER_AGENT=andyfraussen/laravel-dokapi-client
```

The default `DOKAPI_BASE_URL` points to the staging environment defined in Dokapi's OpenAPI spec. Use the production base URL provided by Dokapi when you move to production. If you already have an access token, set `DOKAPI_ACCESS_TOKEN` to bypass OAuth2.

For advanced HTTP tuning (proxies, custom headers, TLS options), you can pass Guzzle options via the `dokapi.http` config key.

Usage
-----

[](#usage)

### The Fluent API

[](#the-fluent-api)

The recommended way to interact with Dokapi is through the fluent API provided by the `Dokapi` facade.

```
use AndyFraussen\Dokapi\Facades\Dokapi;

// Send a document with a single call
$response = Dokapi::api()->outgoingDocuments->sendDto($payload, $xml);

echo $response->document->ulid;
```

### Outgoing Documents

[](#outgoing-documents)

You can easily send Peppol documents using our expressive request builders:

```
use AndyFraussen\Dokapi\Dto\ParticipantIdentifier;
use AndyFraussen\Dokapi\Requests\OutgoingDocumentRequest;

$request = new OutgoingDocumentRequest(
    sender: ParticipantIdentifier::of('0208:0123456789'),
    receiver: ParticipantIdentifier::of('0208:9876543210'),
    c1CountryCode: 'BE',
    documentTypeIdentifier: $docType,
    processIdentifier: $process,
    externalReference: 'inv-2026-001'
);

$response = Dokapi::sendOutgoingDocument($request, $xml);
```

### Error Handling

[](#error-handling)

All non-2xx responses throw a `DokapiRequestException` subclass (auth, validation, not found, rate limit, server, or client errors). You can access the raw response body with `getResponseBody()` or a parsed `ProblemDetail` (when available) with `getProblemDetail()`.

Participant registrations can also return a 207 response with a `ProblemDetail` payload. In that case, `registerDto()` returns a `ProblemDetail` instance instead of a success DTO.

### Webhook Signature Verification

[](#webhook-signature-verification)

Security is paramount. Verify incoming webhooks with ease:

```
use AndyFraussen\Dokapi\Facades\Dokapi;

$isValid = Dokapi::webhooks()->verifySignature(
    payload: $request->getContent(),
    signature: $request->header('X-Dokapi-Signature'),
    secret: config('dokapi.webhook_secret')
);
```

Testing
-------

[](#testing)

```
composer test
```

Static Analysis
---------------

[](#static-analysis)

We maintain a high standard of code quality using Larastan (PHPStan):

```
composer phpstan
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance81

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity53

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

Total

2

Last Release

102d ago

### Community

Maintainers

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

---

Top Contributors

[![andyfraussen](https://avatars.githubusercontent.com/u/46563720?v=4)](https://github.com/andyfraussen "andyfraussen (2 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

### Embed Badge

![Health badge](/badges/andyfraussen-laravel-dokapi-client/health.svg)

```
[![Health](https://phpackages.com/badges/andyfraussen-laravel-dokapi-client/health.svg)](https://phpackages.com/packages/andyfraussen-laravel-dokapi-client)
```

###  Alternatives

[vluzrmos/slack-api

Wrapper for Slack.com WEB API.

102589.1k3](/packages/vluzrmos-slack-api)[ashallendesign/laravel-exchange-rates

A wrapper package for interacting with the exchangeratesapi.io API.

485677.8k](/packages/ashallendesign-laravel-exchange-rates)[skagarwal/google-places-api

Google Places Api

1913.0M8](/packages/skagarwal-google-places-api)[dcblogdev/laravel-microsoft-graph

A Laravel Microsoft Graph API (Office365) package

168285.5k1](/packages/dcblogdev-laravel-microsoft-graph)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[jasara/php-amzn-selling-partner-api

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

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

PHPackages © 2026

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