PHPackages                             mikywow/gls\_api - 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. mikywow/gls\_api

ActiveLibrary[API Development](/categories/api)

mikywow/gls\_api
================

Implementation of GLS MyAPI in PHP

v1.0.6(4y ago)319[2 issues](https://github.com/MikyWoW/gls_api/issues)PHPPHP &gt;=7.4

Since Sep 22Pushed 4y ago2 watchersCompare

[ Source](https://github.com/MikyWoW/gls_api)[ Packagist](https://packagist.org/packages/mikywow/gls_api)[ RSS](/packages/mikywow-gls-api/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)DependenciesVersions (9)Used By (0)

GLS myAPI
=========

[](#gls-myapi)

Implementation of GLS Json API and generaiting ZPL code for printer. PHP 7.4 required

Usage
-----

[](#usage)

```
$ClientNumber = 123456789; // Unique client number provided by GLS company.
$connection = new GLS\Connection('example@example.com','password', GLS\Country::CZECHIA);

/** @var GLS\Parcel[] */
$parcels = [];

$pickupAddress = new GLS\Address;
$pickupAddress->Name = 'Company name';
$pickupAddress->Street = 'Nunn Street';
$pickupAddress->HouseNumber = '123';
$pickupAddress->HouseNumberInfo = '88B';
$pickupAddress->City = 'Lyki Valley';
$pickupAddress->ZipCode = '12345';
$pickupAddress->CountryIsoCode = 'CZ';
$pickupAddress->ContactName = 'Jareth Mcarthur';
$pickupAddress->ContactPhone = '123456789';
$pickupAddress->ContactEmail = 'Jareth@example.com';

$deliveryAddress = new GLS\Address;
$deliveryAddress->Name = 'Jeffery Fox';
$deliveryAddress->Street = 'Winston Road';
$deliveryAddress->HouseNumber = '256';
$deliveryAddress->HouseNumberInfo = '1';
$deliveryAddress->City = 'Meststoke River';
$deliveryAddress->ZipCode = '43210';
$deliveryAddress->CountryIsoCode = 'CZ';
$deliveryAddress->ContactName = 'Jeffery Fox';
$deliveryAddress->ContactPhone = '123456789';
$deliveryAddress->ContactEmail = 'Jeffery@example.com';

$variableSymbol = '1234567890';
$parcel = new GLS\Parcel($ClientNumber,$pickupAddress,$deliveryAddress);
$parcel->addCOD(2000,$variableSymbol);
$parcel->setPickupDate(new DateTime());
$parcel->Count = 1;

$parcel->ClientReference = $variableSymbol; // custom ID for identification. Important for error handling more parcels at once
$parcel->Content = 'Custom text on ticket';

$parcels[] = $parcel;
```

### Add parcel and get PDF

[](#add-parcel-and-get-pdf)

```
try
{
    $response = $connection->PrintLabels($parcels);
    if($response->ErrorInfoList)
    {
        foreach($response->ErrorInfoList as $e)
        {
            echo 'Error in parcel: ' . implode(", ",$e->ClientReferenceList) . ' Desc: ' . $e->ErrorDescription . PHP_EOL;
        }
    }
    else
    {
        file_put_contents('Labels.pdf', $response->Labels);
    }
}
catch (\Throwable $e)
{
    echo $e->getMessage();
}
```

### Add parcel and get generate ZPL code

[](#add-parcel-and-get-generate-zpl-code)

```
$lang = new GLS\Language;
$lang->Amount = 'Množství:';
$lang->COD = 'Dobírka na prvním balíku';
$lang->Depot = 'Depo:';
$lang->Driver = 'Řidič:';
$lang->glsText = 'Informace o ochraně osobních údajů v síti GLS Group naleznete na gls-group.eu/dataprotection';
$lang->Recipient = 'Příjemce:';
$lang->Sender = 'Odesílatel:';
$lang->Sort = 'Sort:';
$lang->DateFormat = 'd.m.Y';

try
{
    $response = $connection->GetPrintData($parcels);
    if($response->ErrorInfoList)
    {
        foreach($response->ErrorInfoList as $e)
        {
            echo 'Error in parcel: ' . implode(", ",$e->ClientReferenceList) . ' Desc: ' . $e->ErrorDescription . PHP_EOL;
        }
    }
    else
    {
        $zpl = '';
        foreach($response->PrintDataInfoList as $p)
        {
            $zpl .= GLS\Ticket::getTicket($p, 'CZK', $lang);
        }
        file_put_contents('Labels.zpl', $zpl);
    }
}
catch (\Throwable $e)
{
    echo $e->getMessage();
}
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance7

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~52 days

Total

7

Last Release

1746d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f00a4b115a842acb5641691c4fb312ec5140f0371ea986b48c3b79f027129bf8?d=identicon)[MikyWoW](/maintainers/MikyWoW)

---

Top Contributors

[![MikyWoW](https://avatars.githubusercontent.com/u/47429480?v=4)](https://github.com/MikyWoW "MikyWoW (6 commits)")

### Embed Badge

![Health badge](/badges/mikywow-gls-api/health.svg)

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

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

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