PHPackages                             skylence/exactonline-laravel-api - 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. skylence/exactonline-laravel-api

ActiveLibrary[API Development](/categories/api)

skylence/exactonline-laravel-api
================================

This is my package exactonline-laravel-api

v1.2.1(1mo ago)03MITPHPPHP ^8.3|^8.4CI passing

Since Jan 11Pushed 1mo agoCompare

[ Source](https://github.com/skylence-be/exactonline-laravel-api)[ Packagist](https://packagist.org/packages/skylence/exactonline-laravel-api)[ Docs](https://github.com/skylence/exactonline-laravel-api)[ GitHub Sponsors](https://github.com/skylence)[ RSS](/packages/skylence-exactonline-laravel-api/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (42)Versions (9)Used By (0)

Exact Online Laravel API
========================

[](#exact-online-laravel-api)

A Laravel package for integrating with the Exact Online API. Provides OAuth authentication, entity synchronization, rate limiting, and polymorphic mappings between your Laravel models and Exact Online entities.

Features
--------

[](#features)

- OAuth 2.0 authentication with automatic token refresh
- Sync entities: Accounts, Contacts, Items, Sales Orders, Invoices, and more
- Polymorphic mappings between local models and Exact Online
- Division management and switching
- Rate limit handling with automatic retry
- Webhook support for real-time updates
- Payload validation before API calls
- Custom exception hierarchy for error handling

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

[](#installation)

```
composer require skylence/exactonline-laravel-api
```

Publish and run the migrations:

```
php artisan vendor:publish --tag="exactonline-laravel-api-migrations"
php artisan migrate
```

Optionally publish the config:

```
php artisan vendor:publish --tag="exactonline-laravel-api-config"
```

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

[](#configuration)

Add to your `.env`:

```
EXACT_CLIENT_ID=your-client-id
EXACT_CLIENT_SECRET=your-client-secret
EXACT_REDIRECT_URL=https://your-app.com/exact/oauth/callback
```

OAuth Setup
-----------

[](#oauth-setup)

### 1. Create a Connection

[](#1-create-a-connection)

```
use Skylence\ExactonlineLaravelApi\Models\ExactConnection;

$connection = ExactConnection::create([
    'name' => 'My Connection',
    'client_id' => config('exactonline-laravel-api.oauth.client_id'),
    'client_secret' => 'your-secret', // Auto-encrypted
    'redirect_url' => config('exactonline-laravel-api.oauth.redirect_url'),
    'base_url' => 'https://start.exactonline.nl',
    'is_active' => true,
]);
```

### 2. Initiate OAuth Flow

[](#2-initiate-oauth-flow)

The package provides routes for OAuth:

- `GET /exact/oauth/authorize/{connection}` - Redirects to Exact Online
- `GET /exact/oauth/callback` - Handles the callback

After successful authentication, divisions are automatically synced.

### 3. Select a Division

[](#3-select-a-division)

```
$connection->update(['division' => 123456]);
```

Usage
-----

[](#usage)

### Syncing Entities

[](#syncing-entities)

```
use Skylence\ExactonlineLaravelApi\Support\Config;
use Skylence\ExactonlineLaravelApi\Actions\API\SyncAccountAction;

$action = Config::getAction('sync_account', SyncAccountAction::class);
$result = $action->execute($connection, $localCompany);
```

### Making Your Models Mappable

[](#making-your-models-mappable)

Add the `ExactMappable` trait to models you want to sync:

```
use Skylence\ExactonlineLaravelApi\Concerns\ExactMappable;
use Skylence\ExactonlineLaravelApi\Contracts\HasExactMapping;

class Company extends Model implements HasExactMapping
{
    use ExactMappable;
}
```

This provides:

```
// Check if mapped
$company->hasExactId($connection);

// Get Exact ID
$exactId = $company->getExactId($connection);

// Set Exact ID after sync
$company->setExactId($connection, $exactGuid, 'primary', $exactCode);

// Find by Exact ID
$company = Company::findByExactId($exactGuid, $connection);

// Mappings are auto-deleted when model is deleted
```

### Available Actions

[](#available-actions)

EntityActionsAccountget, get\_all, create, update, syncContactget, get\_all, create, update, syncItemget, get\_all, create, update, syncSales Orderget, get\_all, create, update, syncSales Invoiceget, get\_all, create, syncPurchase Orderget, get\_all, create, update, syncPurchase Invoiceget, get\_all, create, syncQuotationget, get\_all, create, update, syncProjectget, get\_all, create, update, syncGL Accountget, get\_all, create, update, syncDivisionget\_all, syncDocumentget, get\_all, create, sync, downloadAddressget, get\_all, create, update, syncBank Accountget, get\_all, create, update, syncWarehouseget, get\_all, create, update, syncJournalget, get\_all, create, update, syncVAT Codeget, get\_all, create, update, sync### Fetching Data

[](#fetching-data)

```
use Skylence\ExactonlineLaravelApi\Actions\API\GetAccountsAction;

$action = Config::getAction('get_accounts', GetAccountsAction::class);
$accounts = $action->execute($connection, [
    'filter' => "Name eq 'Acme Corp'",
    'select' => 'ID,Name,Email',
]);
```

### Creating Entities

[](#creating-entities)

```
use Skylence\ExactonlineLaravelApi\Actions\API\CreateAccountAction;

$action = Config::getAction('create_account', CreateAccountAction::class);
$result = $action->execute($connection, [
    'Name' => 'New Customer',
    'Email' => 'contact@example.com',
    'Country' => 'NL',
]);
```

Events
------

[](#events)

Events are dispatched after sync operations:

- `AccountSynced`
- `ContactSynced`
- `ItemSynced`
- `SalesOrderSynced`
- `DivisionsSynced`
- ... and more

```
use Skylence\ExactonlineLaravelApi\Events\AccountSynced;

Event::listen(AccountSynced::class, function ($event) {
    // $event->connection
    // $event->model
    // $event->exactId
    // $event->wasCreated
});
```

Exception Handling
------------------

[](#exception-handling)

The package provides a custom exception hierarchy:

```
use Skylence\ExactonlineLaravelApi\Exceptions\ExactOnlineException;
use Skylence\ExactonlineLaravelApi\Exceptions\AuthenticationException;
use Skylence\ExactonlineLaravelApi\Exceptions\ApiException;
use Skylence\ExactonlineLaravelApi\Exceptions\SyncException;
use Skylence\ExactonlineLaravelApi\Exceptions\EntityNotFoundException;

try {
    $action->execute($connection, $data);
} catch (AuthenticationException $e) {
    // OAuth errors (invalid credentials, expired tokens)
} catch (EntityNotFoundException $e) {
    // Entity not found in Exact Online
} catch (SyncException $e) {
    // Sync operation failed
} catch (ApiException $e) {
    // General API errors
    $statusCode = $e->getStatusCode();
    $response = $e->getResponse();
}
```

Rate Limiting
-------------

[](#rate-limiting)

The package automatically handles Exact Online rate limits:

```
// config/exactonline-laravel-api.php
'rate_limiting' => [
    'wait_on_minutely_limit' => true,  // Auto-wait on 60/min limit
    'throw_on_daily_limit' => true,    // Throw on daily limit
    'max_wait_seconds' => 65,
],
```

Payload Validation
------------------

[](#payload-validation)

Payloads are validated before sending to the API:

```
// config/exactonline-laravel-api.php
'validation' => [
    'enabled' => true,
    'strict' => false,  // Fail on unknown fields
],
```

Testing
-------

[](#testing)

```
composer test
```

Credits
-------

[](#credits)

- [Jonas Vanderhaegen](https://github.com/jonasvanderhaegen)

License
-------

[](#license)

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

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance89

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 62.3% 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 ~39 days

Total

4

Last Release

58d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8ad0eeb3e0f0183e243d7edf649313243750f8048918eb00c9c041c5dc379149?d=identicon)[skylence](/maintainers/skylence)

---

Top Contributors

[![jonasvanderhaegen-xve](https://avatars.githubusercontent.com/u/216873699?v=4)](https://github.com/jonasvanderhaegen-xve "jonasvanderhaegen-xve (48 commits)")[![jonasvanderhaegen](https://avatars.githubusercontent.com/u/7755555?v=4)](https://github.com/jonasvanderhaegen "jonasvanderhaegen (25 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (3 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")

---

Tags

laravelpackagelaravelskylenceexactonline-laravel-api

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/skylence-exactonline-laravel-api/health.svg)

```
[![Health](https://phpackages.com/badges/skylence-exactonline-laravel-api/health.svg)](https://phpackages.com/packages/skylence-exactonline-laravel-api)
```

###  Alternatives

[dedoc/scramble

Automatic generation of API documentation for Laravel applications.

2.1k11.2M102](/packages/dedoc-scramble)[spatie/laravel-pdf

Create PDFs in Laravel apps

1.0k4.8M47](/packages/spatie-laravel-pdf)[defstudio/telegraph

A laravel facade to interact with Telegram Bots

811334.1k3](/packages/defstudio-telegraph)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3914.6k](/packages/rawilk-profile-filament-plugin)[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)[harris21/laravel-fuse

Circuit breaker for Laravel queue jobs. Protect your workers from cascading failures.

44855.7k](/packages/harris21-laravel-fuse)

PHPackages © 2026

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