PHPackages                             gnahx/php-gls-shipping-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. gnahx/php-gls-shipping-sdk

ActiveLibrary[API Development](/categories/api)

gnahx/php-gls-shipping-sdk
==========================

SDK for GLS Web API for Parcel Processing

1.0.1(12mo ago)02MITPHPPHP ^8.0.0

Since May 13Pushed 12mo agoCompare

[ Source](https://github.com/check24-simonpuglisi/php-gls-shipping-sdk)[ Packagist](https://packagist.org/packages/gnahx/php-gls-shipping-sdk)[ RSS](/packages/gnahx-php-gls-shipping-sdk/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (17)Versions (3)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 c24-toys/php-gls-shipping-sdk
```

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

[](#uninstallation)

```
$ composer remove c24-toys/php-gls-shipping-sdk
```

Testing
-------

[](#testing)

```
$ composer test
```

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 \C24Toys\GLS\Sdk\ParcelProcessing\Service\ServiceFactory();
$service = $serviceFactory->createShipmentService('basicAuthUser', 'basicAuthPass', $logger, $sandbox = true);

// REGULAR SHIPMENT
$requestBuilder = new \C24Toys\GLS\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 \C24Toys\GLS\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 \C24Toys\GLS\Sdk\ParcelProcessing\Service\ServiceFactory();
$service = $serviceFactory->createCancellationService('basicAuthUser', 'basicAuthPass', $logger, $sandbox = true);

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

Forked from

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance50

Moderate activity, may be stable

Popularity2

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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

Total

2

Last Release

361d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/74fb60bf2d54589865444d631365b97dfc4d7af3c41395c7ed3212e52e7ea728?d=identicon)[gnahx](/maintainers/gnahx)

---

Top Contributors

[![mam08ixo](https://avatars.githubusercontent.com/u/1771622?v=4)](https://github.com/mam08ixo "mam08ixo (14 commits)")[![check24-denesstolte](https://avatars.githubusercontent.com/u/142206020?v=4)](https://github.com/check24-denesstolte "check24-denesstolte (8 commits)")[![check24-simonpuglisi](https://avatars.githubusercontent.com/u/127940372?v=4)](https://github.com/check24-simonpuglisi "check24-simonpuglisi (7 commits)")[![Sebastian80](https://avatars.githubusercontent.com/u/6400300?v=4)](https://github.com/Sebastian80 "Sebastian80 (2 commits)")[![vkollin](https://avatars.githubusercontent.com/u/5981580?v=4)](https://github.com/vkollin "vkollin (2 commits)")[![willothewispx](https://avatars.githubusercontent.com/u/8642550?v=4)](https://github.com/willothewispx "willothewispx (2 commits)")

---

Tags

phpsdkgls

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/gnahx-php-gls-shipping-sdk/health.svg)

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

###  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)
