PHPackages                             pobo-builder/php-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. [API Development](/categories/api)
4. /
5. pobo-builder/php-sdk

ActiveLibrary[API Development](/categories/api)

pobo-builder/php-sdk
====================

Official PHP SDK for Pobo API V2 - product content management and webhooks

v1.3.0(2mo ago)088[1 PRs](https://github.com/pobo-builder/php-sdk/pulls)MITPHPPHP ^8.1CI passing

Since Dec 27Pushed 1mo agoCompare

[ Source](https://github.com/pobo-builder/php-sdk)[ Packagist](https://packagist.org/packages/pobo-builder/php-sdk)[ Docs](https://github.com/pobo-builder/php-sdk)[ RSS](/packages/pobo-builder-php-sdk/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (2)Versions (14)Used By (0)

Pobo PHP SDK
============

[](#pobo-php-sdk)

[![Tests](https://github.com/pobo-builder/php-sdk/actions/workflows/tests.yml/badge.svg)](https://github.com/pobo-builder/php-sdk/actions/workflows/tests.yml)[![Latest Stable Version](https://camo.githubusercontent.com/1082fc1c01fa86ab42ff78ae01f28df1c755dec037774d56f9470de6dd66466a/68747470733a2f2f706f7365722e707567782e6f72672f706f626f2d6275696c6465722f7068702d73646b2f762f737461626c65)](https://packagist.org/packages/pobo-builder/php-sdk)[![License](https://camo.githubusercontent.com/5507e0e186845d06d00939fe36999da1ff215e08e42f35f476292c762e46aac6/68747470733a2f2f706f7365722e707567782e6f72672f706f626f2d6275696c6465722f7068702d73646b2f6c6963656e7365)](https://packagist.org/packages/pobo-builder/php-sdk)

Official PHP SDK for [Pobo API V2](https://api.pobo.space) - product content management and webhooks.

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

[](#requirements)

- PHP 8.1+
- ext-curl
- ext-json

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

[](#installation)

```
composer require pobo-builder/php-sdk
```

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

[](#quick-start)

### API Client

[](#api-client)

```
use Pobo\Sdk\PoboClient;

$client = new PoboClient(
    apiToken: 'your-api-token',
    baseUrl: 'https://api.pobo.space', // optional
    timeout: 30 // optional, in seconds
);
```

Import
------

[](#import)

### Import Order

[](#import-order)

```
1. Parameters (no dependencies)
2. Categories (no dependencies)
3. Products (depends on categories and parameters)
4. Blogs (no dependencies)

```

### Import Parameters

[](#import-parameters)

```
use Pobo\Sdk\DTO\Parameter;
use Pobo\Sdk\DTO\ParameterValue;

$parameters = [
    new Parameter(
        id: 1,
        name: 'Color',
        values: [
            new ParameterValue(id: 1, value: 'Red'),
            new ParameterValue(id: 2, value: 'Blue'),
        ],
    ),
    new Parameter(
        id: 2,
        name: 'Size',
        values: [
            new ParameterValue(id: 3, value: 'S'),
            new ParameterValue(id: 4, value: 'M'),
        ],
    ),
];

$result = $client->importParameters($parameters);
echo sprintf('Imported: %d, Values: %d', $result->imported, $result->valuesImported);
```

### Import Categories

[](#import-categories)

```
use Pobo\Sdk\DTO\Category;
use Pobo\Sdk\DTO\LocalizedString;
use Pobo\Sdk\Enum\Language;

$categories = [
    new Category(
        id: 'CAT-001',
        isVisible: true,
        name: LocalizedString::create('Electronics')
            ->withTranslation(Language::CS, 'Elektronika')
            ->withTranslation(Language::SK, 'Elektronika'),
        url: LocalizedString::create('https://example.com/electronics')
            ->withTranslation(Language::CS, 'https://example.com/cs/elektronika')
            ->withTranslation(Language::SK, 'https://example.com/sk/elektronika'),
        description: LocalizedString::create('All electronics')
            ->withTranslation(Language::CS, 'Veškerá elektronika')
            ->withTranslation(Language::SK, 'Všetka elektronika'),
        images: ['https://example.com/images/electronics.jpg'],
    ),
    new Category(
        id: 'CAT-002',
        isVisible: true,
        name: LocalizedString::create('Phones')
            ->withTranslation(Language::CS, 'Telefony')
            ->withTranslation(Language::SK, 'Telefóny'),
        url: LocalizedString::create('https://example.com/phones')
            ->withTranslation(Language::CS, 'https://example.com/cs/telefony')
            ->withTranslation(Language::SK, 'https://example.com/sk/telefony'),
    ),
];

$result = $client->importCategories($categories);
echo sprintf('Imported: %d, Updated: %d', $result->imported, $result->updated);
```

### Import Products

[](#import-products)

```
use Pobo\Sdk\DTO\Product;
use Pobo\Sdk\DTO\LocalizedString;
use Pobo\Sdk\Enum\Language;

$products = [
    new Product(
        id: 'PROD-001',
        isVisible: true,
        name: LocalizedString::create('iPhone 15')
            ->withTranslation(Language::CS, 'iPhone 15')
            ->withTranslation(Language::SK, 'iPhone 15'),
        url: LocalizedString::create('https://example.com/iphone-15')
            ->withTranslation(Language::CS, 'https://example.com/cs/iphone-15')
            ->withTranslation(Language::SK, 'https://example.com/sk/iphone-15'),
        shortDescription: LocalizedString::create('Latest iPhone model')
            ->withTranslation(Language::CS, 'Nejnovější model iPhone')
            ->withTranslation(Language::SK, 'Najnovší model iPhone'),
        description: LocalizedString::create('The best iPhone ever.')
            ->withTranslation(Language::CS, 'Nejlepší iPhone vůbec.')
            ->withTranslation(Language::SK, 'Najlepší iPhone vôbec.'),
        images: ['https://example.com/images/iphone-1.jpg'],
        categoriesIds: ['CAT-001', 'CAT-002'],
        parametersIds: [1, 2],
    ),
    new Product(
        id: 'PROD-002',
        isVisible: true,
        name: LocalizedString::create('Samsung Galaxy S24')
            ->withTranslation(Language::CS, 'Samsung Galaxy S24')
            ->withTranslation(Language::SK, 'Samsung Galaxy S24'),
        url: LocalizedString::create('https://example.com/samsung-s24')
            ->withTranslation(Language::CS, 'https://example.com/cs/samsung-s24')
            ->withTranslation(Language::SK, 'https://example.com/sk/samsung-s24'),
        categoriesIds: ['CAT-001'],
        parametersIds: [1, 3],
    ),
];

$result = $client->importProducts($products);

if ($result->hasErrors() === true) {
    foreach ($result->errors as $error) {
        echo sprintf('Error: %s', implode(', ', $error['errors']));
    }
}
```

### Import Blogs

[](#import-blogs)

```
use Pobo\Sdk\DTO\Blog;
use Pobo\Sdk\DTO\LocalizedString;
use Pobo\Sdk\Enum\Language;

$blogs = [
    new Blog(
        id: 'BLOG-001',
        isVisible: true,
        name: LocalizedString::create('New Product Launch')
            ->withTranslation(Language::CS, 'Uvedení nového produktu')
            ->withTranslation(Language::SK, 'Uvedenie nového produktu'),
        url: LocalizedString::create('https://example.com/blog/new-product')
            ->withTranslation(Language::CS, 'https://example.com/cs/blog/novy-produkt')
            ->withTranslation(Language::SK, 'https://example.com/sk/blog/novy-produkt'),
        category: 'news',
        description: LocalizedString::create('We are excited to announce...')
            ->withTranslation(Language::CS, 'S radostí oznamujeme...')
            ->withTranslation(Language::SK, 'S radosťou oznamujeme...'),
        images: ['https://example.com/images/blog-1.jpg'],
    ),
    new Blog(
        id: 'BLOG-002',
        isVisible: true,
        name: LocalizedString::create('How to Choose')
            ->withTranslation(Language::CS, 'Jak vybrat')
            ->withTranslation(Language::SK, 'Ako vybrať'),
        url: LocalizedString::create('https://example.com/blog/how-to-choose')
            ->withTranslation(Language::CS, 'https://example.com/cs/blog/jak-vybrat')
            ->withTranslation(Language::SK, 'https://example.com/sk/blog/ako-vybrat'),
        category: 'tips',
    ),
];

$result = $client->importBlogs($blogs);
echo sprintf('Imported: %d, Updated: %d', $result->imported, $result->updated);
```

Delete
------

[](#delete)

### Delete Products

[](#delete-products)

```
$result = $client->deleteProducts(['PROD-001', 'PROD-002', 'PROD-003']);

echo sprintf('Deleted: %d, Skipped: %d', $result->deleted, $result->skipped);

if ($result->hasErrors() === true) {
    foreach ($result->errors as $error) {
        echo sprintf('ID %s: %s', $error['id'], implode(', ', $error['errors']));
    }
}
```

### Delete Categories

[](#delete-categories)

```
$result = $client->deleteCategories(['CAT-001', 'CAT-002']);
echo sprintf('Deleted: %d', $result->deleted);
```

### Delete Blogs

[](#delete-blogs)

```
$result = $client->deleteBlogs(['BLOG-001', 'BLOG-002']);
echo sprintf('Deleted: %d', $result->deleted);
```

> **Note:** Delete performs a soft-delete.

Export
------

[](#export)

### Export Products

[](#export-products)

```
$response = $client->getProducts(page: 1, perPage: 50);

foreach ($response->data as $product) {
    echo sprintf("%s: %s\n", $product->id, $product->name->getDefault());
}

echo sprintf('Page %d of %d', $response->currentPage, $response->getTotalPages());

// Iterate through all products (handles pagination automatically)
foreach ($client->iterateProducts() as $product) {
    echo sprintf("%s: %s\n", $product->id, $product->name->getDefault());
}

// Filter by last update time
$since = new DateTime('2024-01-01 00:00:00');
$response = $client->getProducts(lastUpdateFrom: $since);

// Filter only edited products
$response = $client->getProducts(isEdited: true);

// Include optional content (marketplace HTML, raw widget JSON)
use Pobo\Sdk\Enum\IncludeContent;

$response = $client->getProducts(include: [IncludeContent::MARKETPLACE, IncludeContent::NESTED]);
```

### Export Categories

[](#export-categories)

```
$response = $client->getCategories();

foreach ($response->data as $category) {
    echo sprintf("%s: %s\n", $category->id, $category->name->getDefault());
}

// Iterate through all categories
foreach ($client->iterateCategories() as $category) {
    processCategory($category);
}
```

### Export Blogs

[](#export-blogs)

```
$response = $client->getBlogs();

foreach ($response->data as $blog) {
    echo sprintf("%s: %s\n", $blog->id, $blog->name->getDefault());
}

// Iterate through all blogs
foreach ($client->iterateBlogs() as $blog) {
    processBlog($blog);
}
```

Content (HTML/Marketplace/Nested)
---------------------------------

[](#content-htmlmarketplacenested)

By default, only `content.html` is returned. Use the `include` parameter to request additional content:

ValueDescription`marketplace`HTML content for marketplace (no custom CSS)`nested`Raw widget JSON from widget tables```
use Pobo\Sdk\Enum\IncludeContent;
use Pobo\Sdk\Enum\Language;

// Include marketplace and nested content
foreach ($client->iterateProducts(include: [IncludeContent::MARKETPLACE, IncludeContent::NESTED]) as $product) {
    if ($product->content !== null) {
        // Get HTML content for web (always included)
        $htmlCs = $product->content->getHtml(Language::CS);
        $htmlSk = $product->content->getHtml(Language::SK);
        $htmlEn = $product->content->getHtml(Language::EN);

        // Get content for marketplace (requires include: ['marketplace'])
        $marketplaceCs = $product->content->getMarketplace(Language::CS);
        $marketplaceSk = $product->content->getMarketplace(Language::SK);

        // Get raw widget JSON (requires include: ['nested'])
        $nested = $product->content->getNested();

        // Get default content
        $htmlDefault = $product->content->getHtmlDefault();
        $marketplaceDefault = $product->content->getMarketplaceDefault();
    }
}

// Same for categories
foreach ($client->iterateCategories(include: [IncludeContent::NESTED]) as $category) {
    if ($category->content !== null) {
        echo $category->content->getHtml(Language::CS);
        $nested = $category->content->getNested();
    }
}

// Same for blogs
foreach ($client->iterateBlogs(include: [IncludeContent::MARKETPLACE]) as $blog) {
    if ($blog->content !== null) {
        echo $blog->content->getHtml(Language::CS);
        echo $blog->content->getMarketplace(Language::CS);
    }
}
```

Webhook Handler
---------------

[](#webhook-handler)

### Basic Usage

[](#basic-usage)

```
use Pobo\Sdk\WebhookHandler;
use Pobo\Sdk\Enum\WebhookEvent;
use Pobo\Sdk\Exception\WebhookException;

$handler = new WebhookHandler(webhookSecret: 'your-webhook-secret');

try {
    $payload = $handler->handleFromGlobals();

    match ($payload->event) {
        WebhookEvent::PRODUCTS_UPDATE => syncProducts($client),
        WebhookEvent::CATEGORIES_UPDATE => syncCategories($client),
        WebhookEvent::BLOGS_UPDATE => syncBlogs($client),
    };

    http_response_code(200);
    echo json_encode(['status' => 'ok']);

} catch (WebhookException $e) {
    http_response_code(401);
    echo json_encode(['error' => $e->getMessage()]);
}
```

### Manual Handling

[](#manual-handling)

```
$payload = $handler->handle(
    payload: file_get_contents('php://input'),
    signature: $_SERVER['HTTP_X_WEBHOOK_SIGNATURE'] ?? ''
);
```

### Webhook Payload

[](#webhook-payload)

```
$payload->event;     // WebhookEvent enum
$payload->timestamp; // DateTimeInterface
$payload->eshopId;   // int
```

Error Handling
--------------

[](#error-handling)

```
use Pobo\Sdk\Exception\ApiException;
use Pobo\Sdk\Exception\ValidationException;
use Pobo\Sdk\Exception\WebhookException;

try {
    $result = $client->importProducts($products);
} catch (ValidationException $e) {
    echo sprintf('Validation error: %s', $e->getMessage());
    print_r($e->errors);
} catch (ApiException $e) {
    echo sprintf('API error (%d): %s', $e->httpCode, $e->getMessage());
    print_r($e->responseBody);
}
```

Localized Strings
-----------------

[](#localized-strings)

```
use Pobo\Sdk\DTO\LocalizedString;
use Pobo\Sdk\Enum\Language;

// Create with default value
$name = LocalizedString::create('Default Name');

// Add translations using fluent interface
$name = $name
    ->withTranslation(Language::CS, 'Czech Name')
    ->withTranslation(Language::SK, 'Slovak Name')
    ->withTranslation(Language::EN, 'English Name');

// Get values
$name->getDefault();         // 'Default Name'
$name->get(Language::CS);    // 'Czech Name'
$name->toArray();            // ['default' => '...', 'cs' => '...', ...]
```

### Supported Languages

[](#supported-languages)

CodeLanguage`default`Default (required)`cs`Czech`sk`Slovak`en`English`de`German`pl`Polish`hu`HungarianAPI Methods
-----------

[](#api-methods)

MethodDescription`importProducts(array $products)`Bulk import products (max 100)`importCategories(array $categories)`Bulk import categories (max 100)`importParameters(array $parameters)`Bulk import parameters (max 100)`importBlogs(array $blogs)`Bulk import blogs (max 100)`deleteProducts(array $ids)`Bulk delete products (max 100)`deleteCategories(array $ids)`Bulk delete categories (max 100)`deleteBlogs(array $ids)`Bulk delete blogs (max 100)`getProducts(?int $page, ?int $perPage, ?DateTime $lastUpdateFrom, ?bool $isEdited, ?array $include)`Get products page`getCategories(?int $page, ?int $perPage, ?DateTime $lastUpdateFrom, ?bool $isEdited, ?array $include)`Get categories page`getBlogs(?int $page, ?int $perPage, ?DateTime $lastUpdateFrom, ?bool $isEdited, ?array $include)`Get blogs page`iterateProducts(?DateTime $lastUpdateFrom, ?bool $isEdited, ?array $include)`Iterate all products`iterateCategories(?DateTime $lastUpdateFrom, ?bool $isEdited, ?array $include)`Iterate all categories`iterateBlogs(?DateTime $lastUpdateFrom, ?bool $isEdited, ?array $include)`Iterate all blogsLimits
------

[](#limits)

LimitValueMax items per import request100Max items per delete request100Max items per export page100Product/Category ID length255 charsName length250 charsURL length255 charsImage URL length650 charsDescription length65,000 charsSEO description length500 charsLicense
-------

[](#license)

MIT License

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance88

Actively maintained with recent releases

Popularity13

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 70% 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 ~10 days

Recently: every ~18 days

Total

8

Last Release

69d ago

### Community

Maintainers

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

---

Top Contributors

[![smety-cz](https://avatars.githubusercontent.com/u/80474481?v=4)](https://github.com/smety-cz "smety-cz (14 commits)")[![smety](https://avatars.githubusercontent.com/u/22744053?v=4)](https://github.com/smety "smety (6 commits)")

---

Tags

buildercontentcontent-based-recommendationcontent-managementcontent-management-systemcontent-management-system-for-studentdrag-and-droppagerich-textrich-text-editorwysiwygwysiwyg-editorwysiwyg-editorswysiwyg-html-editorwysiwyg-js-editorapisdkecommercepoboproduct-content

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/pobo-builder-php-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/pobo-builder-php-sdk/health.svg)](https://phpackages.com/packages/pobo-builder-php-sdk)
```

###  Alternatives

[deepseek-php/deepseek-php-client

deepseek PHP client is a robust and community-driven PHP client library for seamless integration with the Deepseek API, offering efficient access to advanced AI and data processing capabilities.

47073.9k5](/packages/deepseek-php-deepseek-php-client)

PHPackages © 2026

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