baraja-core / zasilkovna
Zasilkovna SOAP and REST client in PHP
Installs: 3 859
Dependents: 1
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 21
pkg:composer/baraja-core/zasilkovna
Requires
- php: ^8.0
- spatie/array-to-xml: ^3.0
- tecnickcom/tcpdf: ^6.3
Requires (Dev)
- jetbrains/phpstorm-attributes: ^1.0
- phpstan/phpstan: ^0.12.74
- phpstan/phpstan-nette: ^0.12.14
- roave/security-advisories: dev-master
- spaze/phpstan-disallowed-calls: ^1.1
- tracy/tracy: ^2.8
This package is auto-updated.
Last update: 2026-02-10 08:31:48 UTC
README
Installation
Install using Composer:
$ composer require baraja-core/zasilkovna
Documentation
See http://www.zasilkovna.cz/popis-api/ for more info
Example code
$api = new Baraja\Zasilkovna\ApiRest($apiPassword, $apiKey);
// OR Soap implementation $api = new Baraja\Zasilkovna\ApiSoap($apiPassword, $apiKey);
$branch = new Branch($apiKey, new BranchStorageSqLite()); // There are multiple implementations of IBranchStorage BranchStorageSqLite using SQLite, BranchStorageFile using file in /tmp and BranchStorageMemory using simple variable (SLOW), You can implement your own by implementing IBranchStorage interface
$label = new Label($api, $branch);
// To greate new packet
$transporterPackage = new PacketAttributes(
'ORDERID',
'FirstName',
'LastName',
null,
'addressId',
null,
'Company',
'Email',
'Phone',
null,
null,
null,
'www',
false,
'Street',
'StreetNumber',
'City',
'ZipCode'
);
$api->createPacket($transporterPackage);
// Generate A4 label
$label->generateLabelFull($pdf, $transporterPackage);
// Generate A2 label
$label->generateLabelQuarter($pdf, $transporterPackage);
// Get full branch list as array
$branch->getBranchList();
// Returns branch detail by ID
$branch->find($branchId);