PHPackages                             gls-m2-extension/sdk-api-parcel-processing - 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. gls-m2-extension/sdk-api-parcel-processing

ActiveLibrary[API Development](/categories/api)

gls-m2-extension/sdk-api-parcel-processing
==========================================

GLS Web API for Parcel Processing SDK

1.2(10mo ago)03.1kMITPHPPHP ^7.2.0 || ^8.0.0 || ^8.1.0 || ^8.2.0 || ^8.3.0

Since Dec 8Pushed 10mo agoCompare

[ Source](https://github.com/gls-m2-extension/gls-sdk-api-parcel-processing)[ Packagist](https://packagist.org/packages/gls-m2-extension/sdk-api-parcel-processing)[ RSS](/packages/gls-m2-extension-sdk-api-parcel-processing/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (16)Versions (6)Used By (0)

GLS Parcel Processing API SDK
=============================

[](#gls-parcel-processing-api-sdk)

The GLS Parcel Processing API SDK package offers an interface to the following web services:

- GLS Web API for Parcel Processing
- GLS Web API for Parcel Cancellation

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

[](#requirements)

### System Requirements

[](#system-requirements)

- PHP 7.2+ with JSON extension

### Package Requirements

[](#package-requirements)

- `netresearch/jsonmapper`: Mapper for deserialization of JSON response messages into PHP objects
- `php-http/discovery`: Discovery service for HTTP client and message factory implementations
- `php-http/httplug`: Pluggable HTTP client abstraction
- `php-http/logger-plugin`: HTTP client logger plugin for HTTPlug
- `psr/http-client`: PSR-18 HTTP client interfaces
- `psr/http-factory`: PSR-7 HTTP message factory interfaces
- `psr/http-message`: PSR-7 HTTP message interfaces
- `psr/log`: PSR-3 logger interfaces

### Virtual Package Requirements

[](#virtual-package-requirements)

- `psr/http-client-implementation`: Any package that provides a PSR-18 compatible HTTP client
- `psr/http-factory-implementation`: Any package that provides PSR-7 compatible HTTP message factories
- `psr/http-message-implementation`: Any package that provides PSR-7 HTTP messages

### Development Package Requirements

[](#development-package-requirements)

- `nyholm/psr7`: PSR-7 HTTP message factory &amp; message implementation
- `phpunit/phpunit`: Testing framework
- `php-http/mock-client`: HTTPlug mock client implementation
- `phpstan/phpstan`: Static analysis tool
- `squizlabs/php_codesniffer`: Static analysis tool

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

[](#installation)

```
$ composer require glsgroup/sdk-api-parcel-processing
```

Uninstallation
--------------

[](#uninstallation)

```
$ composer remove glsgroup/sdk-api-parcel-processing
```

Testing
-------

[](#testing)

```
$ ./vendor/bin/phpunit -c test/phpunit.xml
```

Features
--------

[](#features)

The GLS Parcel Processing API SDK supports the following features:

- Create shipments with labels
- Cancel parcels

### Create Shipments

[](#create-shipments)

Create shipments with one or more parcels and retrieve shipping labels. Value-added services may be ordered per parcel. Return shipment labels can be requested either standalone ("return only") or together with the regular "way-to" label.

#### Public API

[](#public-api)

The library's components suitable for consumption comprise

- services:
    - service factory
    - shipment service
    - data transfer object builders
- data transfer objects:
    - shipment with parcels
- exceptions

#### Usage

[](#usage)

```
$logger = new \Psr\Log\NullLogger();
$serviceFactory = new \GlsGroup\Sdk\ParcelProcessing\Service\ServiceFactory();
$service = $serviceFactory->createShipmentService('basicAuthUser', 'basicAuthPass', $logger, $sandbox = true);

// REGULAR SHIPMENT
$requestBuilder = new \GlsGroup\Sdk\ParcelProcessing\RequestBuilder\ShipmentRequestBuilder();
$requestBuilder->setShipperAccount($shipperId = '98765 43210');
$requestBuilder->setRecipientAddress(
    $country = 'DE',
    $postalCode = '36286',
    $city = 'Neuenstein',
    $street = 'GLS-Germany-Straße 1 - 7',
    $name = 'Jane Doe'
);
$requestBuilder->addParcel($parcelWeightA = 0.95);
$requestBuilder->addParcel($parcelWeightB = 1.2);
$request = $requestBuilder->create();

$shipment = $service->createShipment($request);

// work with the web service response, e.g. persist label
foreach ($shipment->getLabels() as $i => $label) {
    file_put_contents("/tmp/{$shipment->getConsignmentId()}-{$i}.pdf", $label);
}

// RETURN SHIPMENT
$requestBuilder = new \GlsGroup\Sdk\ParcelProcessing\RequestBuilder\ReturnShipmentRequestBuilder();
$requestBuilder->setShipperAccount($shipperId = '98765 43210');
$requestBuilder->setShipperAddress(
    $country = 'DE',
    $postalCode = '36286',
    $city = 'Neuenstein',
    $street = 'GLS-Germany-Straße 1 - 7',
    $name = 'Jane Doe'
);
$requestBuilder->setRecipientAddress(
    $country = 'DE',
    $postalCode = '36286',
    $city = 'Neuenstein',
    $street = 'GLS Germany-Straße 1 - 7',
    $company = 'GLS Germany'
);
$requestBuilder->addParcel($weight = 0.95, $qrCode = true);
$request = $requestBuilder->create();

$shipment = $service->createShipment($request);
```

### Cancel Parcels

[](#cancel-parcels)

Cancel one or more parcels.

#### Public API

[](#public-api-1)

The library's components suitable for consumption comprise

- services:
    - service factory
    - cancellation service
- exceptions

#### Usage

[](#usage-1)

```
$logger = new \Psr\Log\NullLogger();
$serviceFactory = new \GlsGroup\Sdk\ParcelProcessing\Service\ServiceFactory();
$service = $serviceFactory->createCancellationService('basicAuthUser', 'basicAuthPass', $logger, $sandbox = true);

$cancelledIds = $service->cancelParcels([$parcelIdA = '12345', $parcelIdB = '54321']);
```

###  Health Score

44

—

FairBetter than 91% of packages

Maintenance58

Moderate activity, may be stable

Popularity21

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity72

Established project with proven stability

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

Total

5

Last Release

306d ago

PHP version history (3 changes)1.0.0PHP ^7.1.0

1.1.0PHP ^7.2.0 || ^8.0.0

1.1.1PHP ^7.2.0 || ^8.0.0 || ^8.1.0 || ^8.2.0 || ^8.3.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/f0b3c584549f960c0d6a43220925111120c18bc6c1b031234c50ebc64ddd83b6?d=identicon)[gls-m2-extension](/maintainers/gls-m2-extension)

---

Top Contributors

[![mam08ixo](https://avatars.githubusercontent.com/u/1771622?v=4)](https://github.com/mam08ixo "mam08ixo (14 commits)")[![kooliahmd](https://avatars.githubusercontent.com/u/6509121?v=4)](https://github.com/kooliahmd "kooliahmd (4 commits)")[![Sebastian80](https://avatars.githubusercontent.com/u/6400300?v=4)](https://github.com/Sebastian80 "Sebastian80 (2 commits)")

---

Tags

phpsdkgls

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/gls-m2-extension-sdk-api-parcel-processing/health.svg)

```
[![Health](https://phpackages.com/badges/gls-m2-extension-sdk-api-parcel-processing/health.svg)](https://phpackages.com/packages/gls-m2-extension-sdk-api-parcel-processing)
```

###  Alternatives

[phpro/http-tools

HTTP tools for developing more consistent HTTP implementations.

28137.8k](/packages/phpro-http-tools)[openai-php/client

OpenAI PHP is a supercharged PHP API client that allows you to interact with the Open AI API

5.8k22.6M232](/packages/openai-php-client)[opensearch-project/opensearch-php

PHP Client for OpenSearch

15024.3M64](/packages/opensearch-project-opensearch-php)[getbrevo/brevo-php

Official Brevo provided RESTFul API V3 php library

963.1M35](/packages/getbrevo-brevo-php)[mozex/anthropic-php

Anthropic PHP is a supercharged community-maintained PHP API client that allows you to interact with Anthropic API.

46365.1k13](/packages/mozex-anthropic-php)[swisnl/json-api-client

A PHP package for mapping remote JSON:API resources to Eloquent like models and collections.

211473.2k12](/packages/swisnl-json-api-client)

PHPackages © 2026

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