Download the PHP package very-code-com/suus-php without Composer
On this page you can find all versions of the php package very-code-com/suus-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download very-code-com/suus-php
More information about very-code-com/suus-php
Files in very-code-com/suus-php
Package suus-php
Short Description PHP client for the SUUS Logistics SOAP API (addOrder, getEvents, getDocument, getColliNo). First open-source PHP library for SUUS / Rohlig Logistics integration.
License Apache-2.0
Homepage https://github.com/very-code-com/suus-php
Informations about the package suus-php
suus-php
PHP client library for the SUUS Logistics (Rohlig Logistics) SOAP API.
The first open-source PHP package for SUUS/Rohlig freight integration - create shipments, track statuses, download documents, and handle multi-country business-day scheduling.
Requirements
- PHP 8.2+
ext-curlext-dom
Installation
Quick Start
See examples/ for complete, runnable scripts.
Configuration
| Env variable | Required | Default | Description |
|---|---|---|---|
SUUS_LOGIN |
yes | - | API login (e.g. ws_yourlogin) |
SUUS_PASSWORD |
yes | - | API password |
SUUS_ENV |
no | production |
sandbox or production |
SUUS_TIMEOUT |
no | 30 |
Request timeout (seconds) |
SUUS_CONNECT_TIMEOUT |
no | 10 |
Connection timeout (seconds) |
API Reference
createShipment(ShipmentOrder $order): ShipmentResult
Creates a shipment via SUUS addOrder. Validates locally first.
Returns ShipmentResult with shipmentNo, reference, trackingUrl.
→ additional services
fetchStatus(string $shipmentNo): StatusResult
Polls events via SUUS getEvents.
Returns StatusResult with status (ShipmentStatus enum), rawLatestCode, events[].
Note:
getEventsalways returnsPRJ000001in sandbox mode.
→ full example
Status mapping:
| SUUS native codes | Normalized ShipmentStatus |
|---|---|
J_CR, KOL, M_KOL |
Created |
LOAD, ZALF, ZAL, M_DYS, WTRF |
InTransit |
ROZF, UNDI, UNLO |
Delivered |
ANUL |
Cancelled |
ZWRON, ZTF |
Failed |
fetchDocument(string $shipmentNo, DocumentType $type): string
Downloads a document as raw PDF bytes via SUUS getDocument.
DocumentType |
Description |
|---|---|
Label |
Standard A4 shipping label |
LabelA6 |
Thermal printer label (A6) |
ShippingOrder |
Shipping order document |
LoadingList |
Loading list |
fetchLabel(string $shipmentNo): string
Convenience shortcut for fetchDocument(…, DocumentType::Label).
→ full example
getColliNumbers(string $shipmentNo): array
Returns per-package (colli) tracking numbers for multi-package shipments.
Package Types
PackageSymbol |
Description |
|---|---|
KAR |
Cardboard box |
EUR |
EUR pallet |
JED |
Disposable pallet |
PLT |
Standard pallet |
SKR |
Crate / chest |
ROL |
Roll |
DPL |
Double pallet |
DHP |
Large heavy package |
CHP |
Heavy package |
AGD |
Appliance |
INN |
Other |
WIA |
Bucket |
HB |
Half-block |
International Routes & Incoterms
incoterms is required whenever sender or receiver is not in Poland.
| Route | Incoterms required | Notes |
|---|---|---|
PL→PL |
No | Domestic, no restrictions |
PL→DE |
Yes | |
PL→AT |
Yes | |
PL→CH |
Yes | Swiss customs docs required |
DE→DE |
No | |
DE→AT |
Yes | |
DE→CH |
Yes | Swiss customs docs required |
Supported incoterms: EXW, FCA, FAS, FOB, CFR, CIF, CPT, CIP, DAP, DDP.
Business-Day Calendars
The library ships calendars for all countries where SUUS operates.
SuusClient defaults to PolishCalendar (required +2 PL business days advance notice).
Auto-detection: SuusClient automatically picks the right calendar based on the sender's country code - no manual configuration needed for standard routes.
| Class | Country | Holidays included |
|---|---|---|
PolishCalendar |
PL - Poland | 9 fixed + 4 Easter-based (Western) |
GermanCalendar |
DE - Germany | 5 federal fixed + 4 Easter-based (federal only, no Bundesland) |
AustriaCalendar |
AT - Austria | 9 fixed + 4 Easter-based (Western) |
SwitzerlandCalendar |
CH - Switzerland | 4 widely-observed fixed + 4 Easter-based (22/26 cantons) |
CzechCalendar |
CZ - Czech Rep. | 11 fixed + Good Friday + Easter Monday (Western) |
SlovakCalendar |
SK - Slovakia | 13 fixed + Good Friday + Easter Monday (Western) |
HungarianCalendar |
HU - Hungary | 8 fixed + 4 Easter-based (Western) |
RomanianCalendar |
RO - Romania | 10 fixed + 5 Easter-based (Orthodox Easter - differs from Western by up to 5 weeks) |
SlovenianCalendar |
SI - Slovenia | 12 fixed + Easter Sun/Mon + Whit Sunday (Western) |
To override (e.g. force a specific calendar regardless of sender country):
All calendars implement BusinessCalendarInterface and work standalone:
CalendarFactory::forCountry(string $cc) returns the right instance for any supported country code; unknown codes fall back to PolishCalendar.
→ full example
Exceptions
All exceptions extend VeryCodeCom\Suus\Exception\SuusException.
| Exception | Trigger |
|---|---|
SuusValidationException |
Local validation failed (date, incoterms, package limits) |
SuusAuthException |
SUUS rejects credentials (DRG00001) |
SuusDuplicateReferenceException |
Reference already exists (PRJ00310) |
SuusApiException |
Other SUUS API errors - contains returnCode, errorCodes |
SuusTransportException |
Network error or non-200 HTTP response |
SuusResponseParseException |
SUUS returned unparseable XML |
Dependency Injection & Testing
The client accepts a custom TransportInterface, PSR-3 logger, and calendar override:
→ testing example
Known SUUS API Quirks
lenghtCmtypo - SUUS uses<lenghtCm>(missing onet). Preserved intentionally.- PHP's
SoapClientis incompatible - SUUS uses RPC/encoded SOAP 1.1. This library uses raw cURL with manually constructed XML. - Response namespace quirk - SUUS SOAP responses swap
xmlns:cwandxmlns:ns1. Child elements carry no namespace prefix. getEvents/getDocumentalways fail in sandbox - OnlyaddOrderreturns real data in the test environment.- Loading date minimum - SUUS requires +2 Polish business days advance notice.
<auth>in every body - Unlike most SOAP services, SUUS embeds the auth block inside every operation's body, not in the SOAP header.
Running Tests
The smoke test (test_sandbox.php) hits the sandbox endpoint directly and prints the full XML exchange — useful for verifying credentials and connectivity without running the full test suite. A successful run looks like:
License
NOTICE for attribution requirements.
You may use, distribute, and modify this library freely. You must retain the NOTICE file and copyright notices in any redistribution or derivative work.
Built by Very Code. Contributions welcome - open an issue or PR.