PHPackages                             baltyre/b2b-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. baltyre/b2b-client

ActiveLibrary

baltyre/b2b-client
==================

v1.1.0(2y ago)117PHPPHP ^8.0

Since Mar 5Pushed 2y ago1 watchersCompare

[ Source](https://github.com/baltyre/b2b-client)[ Packagist](https://packagist.org/packages/baltyre/b2b-client)[ RSS](/packages/baltyre-b2b-client/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (3)Used By (0)

Client SDK for Baltyre B2B API
==============================

[](#client-sdk-for-baltyre-b2b-api)

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

[](#introduction)

This package offers services to loading data from Baltyre B2B API. It maps raw JSON data to pretty DTO's (data transfer objects), that is nice e.g. for hinting properties in your IDE.

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

[](#installation)

The recommended way to install is via Composer:

```
composer require baltyre/b2b-client

```

It requires PHP version 8.0 and supports PHP up to 8.2.

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

[](#configuration)

You can create and configure services manualy:

```
use Baltyre\B2BClient\ApiConnector;
use Baltyre\B2BClient\CatalogLoader;
use Baltyre\B2BClient\PriceListLoader;
use Baltyre\B2BClient\StockLoader;

$apiKey = "";
$baseUrl = "https://b2b.baltyre.com/api";
// for HU customers: $baseUrl = "https://b2b.baltyre.hu/api";
// for AT customers: $baseUrl = "https://b2b.osterreifen.com/api";

$connector = new ApiConnector($baseUrl, $apiKey);
$catalog = new CatalogLoader($connector);
$pricelist = new PriceListLoader($connector);
$stock = new StockLoader($connector);
```

Usage
-----

[](#usage)

### Catalog

[](#catalog)

To get all products just call:

```
$collection = $catalog->load();
```

This returns a `ProductCollection` that constains `ProductData` objects with next properties:

```
class ProductData
{
    public string $code;                        // product code (PLU if present, otherwise CDB)
    public string $cdb;                         // product CDB code
    public ?string $plu;                        // product PLU code
    public string $name;                        // product name
    public ?string $ean;                        // EAN
    public ?string $manufacturer_code;          // code from manufacturer
    public ?Manufacturer $manufacturer;
    public ?Pattern $pattern;
    public ?ParameterCollection $parameters;    // collection that containst `Parameter` objects
    public ?CategoryCollection $categories;     // collection that containst `Category` objects
    public ?Volume $volume;
    public ?Weight $weight;
}
```

For better readability are data separated to value objects.

```
class Manufacturer
{
    public string $code;                        // manufacturer internal code
    public string $name;                        // manufacturer public name
    public ?Picture $picture;
}

class Pattern
{
    public string $name;
    public ?string $description;
    public ?string $season;
    public ?string $purpose;
    public ?Picture $picture;
    public ?PictureCollection $pictures;        // collection that containst `Picture` objects
}

class Parameter
{
    public string $code;                        // parameter internal code
    public string $name;                        // parameter public name
    public ?string $value;                      // parameter value
}

class Category
{
    public string $code;                        // category internal code
    public string $name;                        // category public name
}
```

Objects of `Pattern` and `Manufacturer` can contain pictures, which are represented by the `Picture` object.

```
class Picture
{
    public string $uri;
}
```

Default size of each picture is 600×600px and is provided in JPG format. If you need a picture in a different size or format, you can use the built-in method:

```
$resizedPicture      = $picture->withFormat(1000, 1000);
$resizedPictureInPng = $picture->withFormat(800, 800, Picture::PNG);
```

### Pricelist

[](#pricelist)

To load pricelist call:

```
$collection = $pricelist->load();
```

This returns a `PriceListCollection` that constains `ProductPricing` objects with next properties:

```
class ProductPricing
{
    public string $code;                        // product code (PLU if present, otherwise CDB)
    public string $cdb;                         // product CDB code
    public ?string $plu;                        // product PLU code
    public ?PricePolicy $price;
}

class PricePolicy
{
    public Price $sale;                         // end-customer price
    public Price $purchase;                     // your purchase (discounted) price
}
```

### Stock

[](#stock)

To load stock resources call:

```
$collection = $stock->load();
```

This returns a `StockCollection` that constains `ProductStocks` objects with next properties:

```
class ProductStocks
{
    public string $code;                        // product code (PLU if present, otherwise CDB)
    public string $cdb;                         // product CDB code
    public ?string $plu;                        // product PLU code
    public ?ResourceCollection $stock;          // collection that containst `StockResource` objects
}

class StockResource
{
    public string $code;                        // stock code
    public string $name;                        // stock name
    public int $days;                           // approximate delivery time from order confirmation
    public int $quantity;                       // number of pcs in this stock
    public bool $moreThanQuantity;              // determines if quantity is exact or minimal
}
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

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

Total

2

Last Release

788d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/787fceb9450b06865f623aeaf8612bfedaa52bd9c84ab9e643bb2ceb4b51dfc1?d=identicon)[baltyre](/maintainers/baltyre)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/baltyre-b2b-client/health.svg)

```
[![Health](https://phpackages.com/badges/baltyre-b2b-client/health.svg)](https://phpackages.com/packages/baltyre-b2b-client)
```

PHPackages © 2026

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