PHPackages                             lemonade/vario-online-sdk - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. lemonade/vario-online-sdk

ActiveLibrary[HTTP &amp; Networking](/categories/http)

lemonade/vario-online-sdk
=========================

PHP SDK for the Vario Online API providing typed dataset queries, domain models and PSR-18 HTTP integration for Vario ERP systems.

v1.9.4(2mo ago)121↓66.7%MITPHPPHP ^8.1CI passing

Since Mar 2Pushed 2mo agoCompare

[ Source](https://github.com/johnnyxlemonade/vario-online-sdk)[ Packagist](https://packagist.org/packages/lemonade/vario-online-sdk)[ Docs](https://github.com/johnnyxlemonade/vario-online-sdk)[ RSS](/packages/lemonade-vario-online-sdk/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (27)Versions (21)Used By (0)

Vario Online API PHP SDK (Community Vario ERP Integration Library)
==================================================================

[](#vario-online-api-php-sdk-community-vario-erp-integration-library)

[![PHP Version](https://camo.githubusercontent.com/509d619d85004824fa1b4f3f79a444656e0b33fbf17721ad64d33e7fd21ecc2a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6c656d6f6e6164652f766172696f2d6f6e6c696e652d73646b)](https://packagist.org/packages/lemonade/vario-online-sdk)[![Packagist Version](https://camo.githubusercontent.com/c9abb6a6c586bf310a0996565b047d193dc51b029d6b939c6113d23ae8c2c5d1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c656d6f6e6164652f766172696f2d6f6e6c696e652d73646b)](https://packagist.org/packages/lemonade/vario-online-sdk)[![Downloads](https://camo.githubusercontent.com/9a2b2f578c9d77867b8f405e06fe0115b171f8ab95fac1bbb9493e2c5a2fb743/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c656d6f6e6164652f766172696f2d6f6e6c696e652d73646b)](https://packagist.org/packages/lemonade/vario-online-sdk)[![PHPStan](https://camo.githubusercontent.com/d18b9a987aa81e64470a11caecf72caa66597c9ebd6b307bd1c2cb7a752b0dff/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d6c6576656c25323031302d627269676874677265656e2e737667)](https://phpstan.org/)[![Tests](https://github.com/johnnyxlemonade/vario-online-sdk/actions/workflows/phpunit.yml/badge.svg)](https://github.com/johnnyxlemonade/vario-online-sdk/actions/workflows/phpunit.yml)[![License](https://camo.githubusercontent.com/8bb50fd2278f18fc326bf71f6e88ca8f884f72f179d3e555e20ed30157190d0d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e2e737667)](LICENSE)

A strongly‑typed **PHP SDK for the Vario Online API**, designed for building custom integrations with **Vario ERP systems**.

This project is an **independent community‑maintained client library**for developers who want to integrate PHP applications with the **Vario ERP platform**. It is **not officially affiliated with Vario Software**.

The SDK provides a modern domain‑oriented abstraction layer over the Vario Online API including dataset queries, authentication handling, domain mapping and transport‑agnostic HTTP communication.

It is designed for building **stable ERP integrations** where API payload structures may vary between installations.

More information about Vario ERP:

---

Typical Use Cases
-----------------

[](#typical-use-cases)

This SDK is commonly used for:

- integrating **Vario ERP with e‑commerce platforms**
- synchronizing **products, customers and orders**
- building **data pipelines from Vario datasets**
- exporting ERP data into BI or analytics systems
- creating **custom ERP dashboards or integrations**
- automating ERP workflows

---

Why this SDK exists
-------------------

[](#why-this-sdk-exists)

The official **Vario Online API** exposes data primarily as loosely structured array responses tied directly to backend fields.

While flexible, this creates several challenges:

- dataset column names may differ between installations
- integrations require manual array parsing
- business logic becomes tightly coupled to API payload structure

This SDK introduces a **domain‑oriented integration layer**.

Instead of working with raw arrays, developers interact with **typed domain models** such as:

- `KnownParty`
- `Product`
- `Inventory`

These models are backed by immutable value objects and a configurable mapping layer that isolates application logic from the underlying API schema.

Goals of the SDK:

- stable integration surface
- strong typing and IDE support
- separation between API payloads and application logic
- maintainable ERP integrations

---

Features
--------

[](#features)

- **Typed API facade** (`VarioApi`)
- **Domain-driven read models** (KnownParty, Product)
- Immutable value objects
- **DatasetView → Domain mapping layer**
- **Streaming dataset processing** (`iterate()`, lazy pipelines)
- **Automatic authentication &amp; token refresh**
- **PSR-18 transport layer** (replaceable HTTP client, no vendor lock-in)
- PSR-3 logging support
- Structured request/response logging with duration metrics
- Configurable token storage (memory, session, custom)
- Lazy-loaded API modules
- Unified exception model
- **PHPStan level 10 compliant**

---

Supported Vario API Areas
-------------------------

[](#supported-vario-api-areas)

The SDK provides abstractions for several Vario Online API modules:

- DatasetView API
- KnownParty API
- Product catalog datasets
- Incoming orders
- Outgoing invoices

Additional integrations can be built through the generic DatasetView layer.

---

Architecture Overview
---------------------

[](#architecture-overview)

The SDK is designed as a **layered architecture** that separates application usage, API modules, domain mapping, and transport infrastructure.

Each layer has a clearly defined responsibility, which allows the SDK to remain stable even when the underlying API or HTTP client implementation changes.

The main architectural goals are:

- keep **application code independent from transport details**
- provide **typed domain models instead of raw API arrays**
- isolate **API schema volatility behind a mapping layer**
- allow **replaceable HTTP clients through PSR-18**

```
Application
  │
  ▼
VarioApiFactory
  │
  ├─ VarioClientConfig
  ├─ TokenStorageInterface
  └─ PSR-18 Client Discovery
  │
  ▼
VarioApi (Facade)
  │
  ▼
API Modules
  │
  ├─ Dataset APIs (Queries)
  │     ▼
  │   Mapper / Normalizer Layer
  │     ▼
  │   Domain Read Models (Product, KnownParty…)
  │
  └─ Endpoint APIs (Actions)
        ▼
      Domain Entities / Responses
  │
  ▼
VarioClient (Transport Orchestrator)
  │
  ├─ RequestAuthenticator
  ├─ RequestLogger
  └─ ResponseHandler
  │
  ▼
PSR-18 HTTP Client Interface
  │
  ▼
External HTTP Client
(Guzzle / Symfony HttpClient / Nyholm PSR-7 / Laminas Diactoros / custom)

```

The diagram illustrates the logical architecture layers of the SDK rather than the exact runtime request flow.

Applications interact with the SDK through the `VarioApi` facade created by the `VarioApiFactory`. The factory assembles the complete client stack including configuration, token storage and HTTP transport.

### API Modules

[](#api-modules)

The SDK exposes functionality through **API modules**, each responsible for a specific area of the Vario API.

Two integration styles are supported:

**Dataset APIs (Queries)**
These APIs retrieve data from Vario datasets. The responses are normalized and mapped into **domain read models**.
This layer isolates application logic from dataset column naming and schema changes.

**Endpoint APIs (Actions)**These APIs interact with specific Vario endpoints such as order creation, entity updates or other write operations. They typically return domain entities or response objects directly without passing through the dataset mapping layer.

### Mapping Layer

[](#mapping-layer)

For dataset-based integrations the SDK introduces a **mapping and normalization layer**.

This layer transforms raw DatasetView rows into stable domain models such as:

- `Product`
- `KnownParty`
- `Inventory`

By separating mapping logic from application code, changes in the Vario dataset schema usually require modifying only the mapper configuration rather than the business logic.

### Transport Layer

[](#transport-layer)

The actual communication with the Vario API is orchestrated by `VarioClient`.

The client coordinates:

- authentication and token refresh
- request logging
- response handling and error conversion

The transport boundary follows the **PSR-18 HTTP Client standard**, allowing developers to use any compatible HTTP client implementation such as Guzzle or Symfony HttpClient.

This design ensures that **transport concerns never leak into domain logic**, keeping integrations maintainable and testable.

---

Strategic Design Decisions (ADR)
--------------------------------

[](#strategic-design-decisions-adr)

The development of this SDK was guided by specific architectural principles to ensure enterprise-grade stability and developer experience:

### 1. Zero-Mixed Policy (PHPStan Level 10)

[](#1-zero-mixed-policy-phpstan-level-10)

Unlike most SDKs that rely on `array` and "hope for the best", this library enforces **Level 10 static analysis** with `strict-rules` and `bleedingEdge`. Every API response is mapped through strict **Array Shapes**. This shifts 90% of potential integration bugs from *runtime* to the *static analysis* phase. If the code passes `composer stan`, the data structure is guaranteed.

### 2. Memory-First Streaming &amp; Lazy Pipelines

[](#2-memory-first-streaming--lazy-pipelines)

Vario datasets often contain tens of thousands of records. Most integrations fail here due to `Memory Exhausted` errors. This SDK implements **Streaming Generators** (`iterate()`) and **Lazy Pipelines** as first-class citizens. You can process a 100k+ product catalog on a server with minimal RAM, as only one domain record exists in memory at any given time during iteration.

### 3. Domain-Oriented Mapping Layer

[](#3-domain-oriented-mapping-layer)

The Vario API schema is volatile and often varies between installations. This SDK solves this by introducing a **Mapping Layer**. Your application logic stays coupled to stable, immutable **Domain Models** (`Product`, `KnownParty`, `Inventory`), while the SDK handles the translation from Vario's backend fields. Changing a column name in Vario requires only a 1-line change in the mapper, not a rewrite of your business logic.

### 4. Transport Agnostic (PSR-18)

[](#4-transport-agnostic-psr-18)

By strictly following **PSR-18** and **PSR-17**, the SDK eliminates vendor lock-in. Whether your project uses Guzzle, Symfony HttpClient, or a custom wrapper, the SDK remains stable. This boundary ensures that transport-level concerns (like SSL issues or proxy settings) never leak into your domain mapping logic.

---

Roadmap
-------

[](#roadmap)

The SDK will continue evolving with improvements focused on extensibility, performance and maintainability.

### Middleware Pipeline

[](#middleware-pipeline)

Introduce a **request/response middleware pipeline** to reduce responsibilities currently handled inside `VarioClient`.

Planned processing flow:

```
Request
  ↓
AuthenticationMiddleware
  ↓
LoggingMiddleware
  ↓
RetryMiddleware
  ↓
HTTP Client
  ↓
ResponseMiddleware
  ↓
Result

```

Benefits:

- smaller and simpler `VarioClient`
- clearer separation of transport concerns
- easier testing
- support for custom middleware

### Dataset Streaming Improvements

[](#dataset-streaming-improvements)

Enhancements to large dataset processing:

- improved lazy pipelines
- configurable page prefetching
- better memory diagnostics

### Additional Domain Modules

[](#additional-domain-modules)

Future domain abstractions may include:

- inventory
- warehouse operations
- sales documents
- customer pricing

---

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

[](#requirements)

- PHP 8.1+
- Composer
- Access to Vario Online API (VPN + credentials)
- PSR‑18 HTTP client implementation
- PSR‑3 compatible logger

---

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

[](#installation)

Install the SDK via Composer:

```
composer require lemonade/vario-online-sdk
```

The SDK itself does **not ship with a built‑in HTTP client**.

Instead, it follows the **PSR‑18 HTTP Client standard**, which allows you to use any compatible HTTP client implementation.

Example using **Guzzle**:

```
composer require guzzlehttp/guzzle guzzlehttp/psr7
```

---

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

[](#quick-start)

```
use Lemonade\Vario\VarioApiFactory;
use Lemonade\Vario\VarioClientConfig;
use Lemonade\Vario\ValueObject\DatasetViewQuery;
use Lemonade\Vario\ValueObject\CustomDatasetView;
use Lemonade\Vario\Http\Adapter\GuzzleHttpAdapter;
use Lemonade\Vario\Auth\Storage\InMemoryTokenStorage;

$config = new VarioClientConfig(
    baseUrl: 'https://your-vario-server',
    loginName: 'USER',
    password: 'PASSWORD',
    companyNumber: 'COMPANY'
);

// Example uses Guzzle as the HTTP transport.
// Any PSR-18 compatible HTTP client can be used instead.
$vario = VarioApiFactory::create(
    config: $config,
    httpAdapter: new GuzzleHttpAdapter($config),
    tokenStorage: new InMemoryTokenStorage()
);

$query = DatasetViewQuery::for(
    new CustomDatasetView('Katalog/KatalogCenikAPI'),
    pageLength: 100
);

// Stream dataset rows directly from the Vario API:
foreach ($vario->datasetView()->iterate($query) as $row) {
    print_r($row);
}
```

### Mapping dataset rows to domain models

[](#mapping-dataset-rows-to-domain-models)

The mapping layer converts raw dataset rows into strongly typed domain objects.

```
foreach ($mapper->iterate($vario->datasetView()->iterate($productQuery)) as $product) {

    $identity = $product->identity();
    $price = $product->pricing()?->getPrice();

    echo $identity?->getSku() . ' | ';
    echo $identity?->getName() . ' | ';
    echo $price?->getValue() . PHP_EOL;
}
```

Full examples are available in the `examples/` directory.

---

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

[](#documentation)

Full documentation is available in the project Wiki:

Key documentation pages:

- [Getting Started](https://github.com/johnnyxlemonade/vario-online-sdk/wiki/Getting-Started)
- [Installation](https://github.com/johnnyxlemonade/vario-online-sdk/wiki/Installation)
- [Configuration](https://github.com/johnnyxlemonade/vario-online-sdk/wiki/Configuration)
- [KnownParty Domain](https://github.com/johnnyxlemonade/vario-online-sdk/wiki/KnownParty-Domain)
- [Product Domain](https://github.com/johnnyxlemonade/vario-online-sdk/wiki/Product-Domain)
- [Filtering &amp; Queries](https://github.com/johnnyxlemonade/vario-online-sdk/wiki/Filtering-and-Queries)
- [Logging](https://github.com/johnnyxlemonade/vario-online-sdk/wiki/Logging)
- [Token Storage](https://github.com/johnnyxlemonade/vario-online-sdk/wiki/Token-Storage)
- [Authentication](https://github.com/johnnyxlemonade/vario-online-sdk/wiki/Authentication)
- [Architecture](https://github.com/johnnyxlemonade/vario-online-sdk/wiki/Architecture)

---

Development
-----------

[](#development)

Run static analysis:

```
composer stan
```

Run tests:

```
composer test
```

---

Disclaimer
----------

[](#disclaimer)

This project is an independent open‑source initiative and is not affiliated with or endorsed by Vario Software.

---

License
-------

[](#license)

MIT License

Copyright (c) 2026 Jan Mudrák

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance88

Actively maintained with recent releases

Popularity10

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity51

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

Total

20

Last Release

62d ago

### Community

Maintainers

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

---

Top Contributors

[![johnnyxlemonade](https://avatars.githubusercontent.com/u/3079458?v=4)](https://github.com/johnnyxlemonade "johnnyxlemonade (40 commits)")

---

Tags

api-clienterp-integrationphp-libraryphp-sdkpsr-18variovario-apivario-erpvario-onlinepsr-18api clientphp-sdkERPvariovario-onlinevario-apivario-erperp-integration

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/lemonade-vario-online-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/lemonade-vario-online-sdk/health.svg)](https://phpackages.com/packages/lemonade-vario-online-sdk)
```

###  Alternatives

[phpro/http-tools

HTTP tools for developing more consistent HTTP implementations.

28137.8k](/packages/phpro-http-tools)[elastic/transport

HTTP transport PHP library for Elastic products

1920.6M7](/packages/elastic-transport)[aedart/athenaeum

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

255.2k](/packages/aedart-athenaeum)[art4/requests-psr18-adapter

Use WordPress/Requests as a PSR-18 HTTP client

153.3k](/packages/art4-requests-psr18-adapter)[chillerlan/php-httpinterface

A PSR-7/17/18 http message/client implementation

1417.1k5](/packages/chillerlan-php-httpinterface)[segrax/open-policy-agent

Open Policy Agent client and PSR-7, PSR-15 Authorization Middleware

212.0k](/packages/segrax-open-policy-agent)

PHPackages © 2026

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