PHPackages                             ulozenka/api-v3 - 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. ulozenka/api-v3

AbandonedArchivedLibrary[API Development](/categories/api)

ulozenka/api-v3
===============

Uloženka APIv3 library

0.4.0(9y ago)2154.0k↓43.4%13[5 issues](https://github.com/ulozenka/api-v3/issues)[3 PRs](https://github.com/ulozenka/api-v3/pulls)LGPL-3.0PHPPHP &gt;= 5.4.0

Since Nov 29Pushed 7y ago3 watchersCompare

[ Source](https://github.com/ulozenka/api-v3)[ Packagist](https://packagist.org/packages/ulozenka/api-v3)[ Docs](https://www.ulozenka.cz/)[ RSS](/packages/ulozenka-api-v3/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (7)Dependencies (2)Versions (11)Used By (0)

Uloženka APIv3 library
======================

[](#uloženka-apiv3-library)

[![Build Status](https://camo.githubusercontent.com/8e91cb973915597c9f757cbb8abb6112aa6d473d4ca52b83e2af9501793dec4e/68747470733a2f2f7472617669732d63692e6f72672f756c6f7a656e6b612f6170692d76332e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/ulozenka/api-v3)[![Latest Stable Version](https://camo.githubusercontent.com/fa6a0e5ed6863bea3229d419ab9ee4e91416f8abdb8debf9454b8ff10e4e229c/68747470733a2f2f706f7365722e707567782e6f72672f756c6f7a656e6b612f6170692d76332f762f737461626c65)](https://packagist.org/packages/ulozenka/api-v3) [![Total Downloads](https://camo.githubusercontent.com/51e990c2c124c536db06bee7b541aa64b78c2e1c3c7862abad4c3b3c20bce1a8/68747470733a2f2f706f7365722e707567782e6f72672f756c6f7a656e6b612f6170692d76332f646f776e6c6f616473)](https://packagist.org/packages/ulozenka/api-v3) [![License](https://camo.githubusercontent.com/8a02c2047afa3fd9de8eaed2fb20bbafb0ab15a9900537b51c971df7f5c0d28b/68747470733a2f2f706f7365722e707567782e6f72672f756c6f7a656e6b612f6170692d76332f6c6963656e7365)](https://packagist.org/packages/ulozenka/api-v3)

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

[](#requirements)

- PHP 5.4 or higher
- [bitbang/http](https://packagist.org/packages/bitbang/http)

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

[](#installation)

ℹ️ Examples below relates to the dev-master.

Install ulozenka/api-v3 using [Composer](http://getcomposer.org/)

```
$ composer require ulozenka/api-v3:dev-master
```

Usage
-----

[](#usage)

\###Create consignment

```
$endpoint = \UlozenkaLib\APIv3\Enum\Endpoint::PRODUCTION;
$shopId = 5158;
$apiKey = 'my_secret_api_key_i_have_generated_in_my_ulozenka_shop_settings';

$api = new \UlozenkaLib\APIv3\Api($endpoint, $shopId, $apiKey);

// create receiver of the consignment
$receiver = new UlozenkaLib\APIv3\Model\Consignment\Receiver();
$receiver->setName('John');
$receiver->setSurname('Doe');
$receiver->setPhone('+420602602602');
$receiver->setEmail('foo@ulozenka.cz');

// my consignment identification
$orderNumber = "123123";

// parcel count
$parcelCount = 2;

// transport service to be used
$transportServiceId = \UlozenkaLib\APIv3\Enum\TransportService::ULOZENKA;

// create a consignment request
$consignmentRequest = new UlozenkaLib\APIv3\Resource\Consignments\Request\ConsignmentRequest($receiver, $orderNumber, $parcelCount, $transportServiceId);
$consignmentRequest->setDestinationBranchId(1);
$consignmentRequest->setCashOnDelivery(200);
$consignmentRequest->setCurrency('CZK');
$consignmentRequest->setWeight(3.21);

// send the request and process the response
$createConsignmentResponse = $api->createConsignment($consignmentRequest);
if ($createConsignmentResponse->isSuccess()) {
    var_dump($createConsignmentResponse->getConsignment());
} else {
    $errors = $createConsignmentResponse->getErrors();
    foreach ($errors as $error) {
        echo $error->getCode() . ' ' . $error->getDescription() . PHP_EOL;
    }
}
```

\###Get destination branches for transport service

```
$endpoint = \UlozenkaLib\APIv3\Enum\Endpoint::PRODUCTION;
$shopId = 5158;

$api = new \UlozenkaLib\APIv3\Api($endpoint);

$transportServiceId = \UlozenkaLib\APIv3\Enum\TransportService::ULOZENKA;

// get the destination branches for transport service Ulozenka with respect to settings of the shop with id $shopId
$getTransportServiceBranchesResponse = $api->getTransportServiceBranches($transportServiceId, $shopId, true);

// process the response
if ($getTransportServiceBranchesResponse->isSuccess()) {
    foreach ($getTransportServiceBranchesResponse->getDestinationBranches() as $branch) {
        echo $branch->getId() . ' ' . $branch->getName() . PHP_EOL;
    }
} else {
    $errors = $getTransportServiceBranchesResponse->getErrors();
    foreach ($errors as $error) {
        echo $error->getCode() . ' ' . $error->getDescription() . PHP_EOL;
    }
}
```

\###Get labels for consignments

```
$endpoint = \UlozenkaLib\APIv3\Enum\Endpoint::PRODUCTION;
$shopId = 5158;
$apiKey = 'my_secret_api_key_i_have_generated_in_my_ulozenka_shop_settings';

$api = new \UlozenkaLib\APIv3\Api($endpoint, $shopId, $apiKey);

// array of consignment id or partner_consignment_id values
$consignments = [2701036, 2779198, "051580033333"];

// send the request
$labelsResponse = $api->getLabels($consignments, \UlozenkaLib\APIv3\Enum\Attributes\LabelAttr::TYPE_PDF, $firstPosition = 1, $labelsPerPage = 1, $shopId, $apiKey);

// process the response
if ($labelsResponse->isSuccess()) {
	$pdf = fopen ('out.pdf','w');
	fwrite ($pdf, $labelsResponse->getLabelsString());
	fclose ($pdf);
} else {
    $errors = $labelsResponse->getErrors();
    foreach ($errors as $error) {
        echo $error->getCode() . ' ' . $error->getDescription() . PHP_EOL;
    }
}
```

\###Status history

```
$shopId = 5158;
$apiKey = 'my_secret_api_key_i_have_generated_in_my_ulozenka_shop_settings';

$api = new \UlozenkaLib\APIv3\Api();

$dateLimit = new DateTime('YESTERDAY');

// get statuses that has been published since yesterday's midnight
$statusHistoryResponse = $api->getStatusHistory(null, $dateLimit, $shopId, $apiKey);

// process the response
if ($statusHistoryResponse->isSuccess()) {
    foreach ($statusHistoryResponse->getData() as $consignmentStatus) {
        echo 'Consignment id: ' . $consignmentStatus->getConsignment()->getId() . PHP_EOL;
        echo 'Status time: ' . $consignmentStatus->getDateTime()->format('Y-m-d H:i:s') . PHP_EOL;
        echo 'Status name: ' . $consignmentStatus->getStatus()->getName() . PHP_EOL . PHP_EOL;
    }
} else {
    $errors = $statusHistoryResponse->getErrors();
    foreach ($errors as $error) {
        echo $error->getCode() . ' ' . $error->getDescription() . PHP_EOL;
    }
}
```

\###Tracking

```
$api = new \UlozenkaLib\APIv3\Api();

$consignment = 444000;

$trackingResponse = $api->getTracking($consignment);

// process the response
if ($trackingResponse->isSuccess()) {
    echo 'Consignment id: ' . $trackingResponse->getConsignment()->getId() . PHP_EOL;
    echo 'Transport service: ' . $trackingResponse->getTransportService()->getName() . PHP_EOL;
    foreach ($trackingResponse->getStatuses() as $status) {
        echo $status->getDate()->format('Y-m-d H:i:s') . ' ' . $status->getName() . PHP_EOL;
    }
} else {
    $errors = $trackingResponse->getErrors();
    foreach ($errors as $error) {
        echo $error->getCode() . ' ' . $error->getDescription() . PHP_EOL;
    }
}
```

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity39

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 59.6% 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 ~25 days

Recently: every ~53 days

Total

10

Last Release

3619d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8537901?v=4)[ulozenka](/maintainers/ulozenka)[@ulozenka](https://github.com/ulozenka)

---

Top Contributors

[![petaak](https://avatars.githubusercontent.com/u/8841381?v=4)](https://github.com/petaak "petaak (28 commits)")[![jaroslavlibal](https://avatars.githubusercontent.com/u/450740?v=4)](https://github.com/jaroslavlibal "jaroslavlibal (18 commits)")[![radoslavius](https://avatars.githubusercontent.com/u/3509024?v=4)](https://github.com/radoslavius "radoslavius (1 commits)")

---

Tags

apitransportrestapiulozenka

### Embed Badge

![Health badge](/badges/ulozenka-api-v3/health.svg)

```
[![Health](https://phpackages.com/badges/ulozenka-api-v3/health.svg)](https://phpackages.com/packages/ulozenka-api-v3)
```

###  Alternatives

[phplicengine/bitly

Bitly API v4

21291.7k](/packages/phplicengine-bitly)[m165437/laravel-blueprint-docs

API Blueprint Renderer for Laravel

22779.5k](/packages/m165437-laravel-blueprint-docs)

PHPackages © 2026

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