PHPackages                             slince/shipment-tracking-foundation - 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. slince/shipment-tracking-foundation

ActiveLibrary

slince/shipment-tracking-foundation
===================================

A flexible and shipment tracking library for multi carriers.

1.1.0(8y ago)61.0k21MITPHPPHP &gt;=5.6.0

Since Aug 9Pushed 8y ago1 watchersCompare

[ Source](https://github.com/slince/shipment-tracking-foundation)[ Packagist](https://packagist.org/packages/slince/shipment-tracking-foundation)[ RSS](/packages/slince-shipment-tracking-foundation/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (2)Versions (3)Used By (1)

Shipment Tracking Foundation
============================

[](#shipment-tracking-foundation)

[![Build Status](https://camo.githubusercontent.com/bec04690a2f25096157b5c13cdc354761e0b0ec8bc492bf44e7b7d50b87951c4/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f736c696e63652f736869706d656e742d747261636b696e672d666f756e646174696f6e2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/slince/shipment-tracking-foundation)[![Coverage Status](https://camo.githubusercontent.com/496f66a6719ee680b7e48e3480e4e24007331583d9c143e2f7acb33da7201f60/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f736c696e63652f736869706d656e742d747261636b696e672d666f756e646174696f6e2e7376673f7374796c653d666c61742d737175617265)](https://codecov.io/github/slince/shipment-tracking-foundation)[![Latest Stable Version](https://camo.githubusercontent.com/f312a5cfeb174fbc1f2c1b39d14b5e6b3fc3ac32bb3721952a7e367b1ae27158/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736c696e63652f736869706d656e742d747261636b696e672d666f756e646174696f6e2e7376673f7374796c653d666c61742d737175617265266c6162656c3d737461626c65)](https://packagist.org/packages/slince/shipment-tracking-foundation)[![Scrutinizer](https://camo.githubusercontent.com/253568d22fe61ed40850c9cf5cf4271f87310532365145e2b04f5c26e3f51e88/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f736c696e63652f736869706d656e742d747261636b696e672d666f756e646174696f6e2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/slince/shipment-tracking-foundation/?branch=master)

A flexible and shipment tracking library for multi carriers.

Basic Usage
-----------

[](#basic-usage)

```
$tracker = new Slince\ShipmentTracking\DHLECommerce\DHLECommerceTracker(CLIENT_ID, PASSWORD);

try {
   $shipment = $tracker->track('CNAQV100168101');

   if ($shipment->isDelivered()) {
       echo "Delivered";
   }
   echo $shipment->getOrigin();
   echo $shipment->getDestination();
   print_r($shipment->getEvents());  //print the shipment events

} catch (Slince\ShipmentTracking\Exception\TrackException $exception) {
    exit('Track error: ' . $exception->getMessage());
}
```

How to create your own tracker?
-------------------------------

[](#how-to-create-your-own-tracker)

All shipment trackers must implement `Slince\ShipmentTracking\Foundation\TrackerInterface`, and will usually extend `Slince\ShipmentTracking\Foundation\HttpAwareTracker` for basic functionality if the carrier's api is based on HTTP

```
namespace My\Tracker;

use Slince\ShipmentTracking\Foundation\HttpAwareTracker;
use Slince\ShipmentTracking\Foundation\Shipment;

class MyTracker extends HttpAwareTracker
{
   /**
    * {@inheritdoc}
    */
    public function track($trackingNumber)
    {
        $response = $this->getHttpClient()->get('/../endpoint', [
            'query' => [
                'tracking_number' => $trackingNumber
            ]
        ]);
        return static::buildShipment($response):
    }

    /**
     * @return Shipment
     */
    public function buildShipment($response)
    {
        //....
    }
}

$tracker = new MyTracker();
$shipment = $tracker->track('foo-tracking-number');

print_r($shipment):
```

You can extend all existing classes if you need.

Shipment trackers:
------------------

[](#shipment-trackers)

The following carriers are available:

TrackerComposer PackageMaintainer[DHL eCommerce](https://github.com/slince/shipment-tracking)slince/shipment-tracking[Tao](https://github.com/slince)[Yanwen Exprerss(燕文物流)](https://github.com/slince/shipment-tracking)slince/shipment-tracking[Tao](https://github.com/slince)[快递100](https://github.com/slince/shipment-tracking)slince/shipment-tracking[Tao](https://github.com/slince)[E邮宝/E包裹/E特快/国际EMS](https://github.com/slince/shipment-tracking)slince/shipment-tracking[Tao](https://github.com/slince)License
-------

[](#license)

The MIT license. See [MIT](https://opensource.org/licenses/MIT)

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

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

Total

2

Last Release

3112d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3785826?v=4)[Tao](/maintainers/slince)[@slince](https://github.com/slince)

---

Top Contributors

[![slince](https://avatars.githubusercontent.com/u/3785826?v=4)](https://github.com/slince "slince (15 commits)")

---

Tags

carrierchina-postdhldhl-ecommerceshipmentshipment-trackershipment-trackingtrackingshipmentuspstrackerparcelePacketChina Post

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/slince-shipment-tracking-foundation/health.svg)

```
[![Health](https://phpackages.com/badges/slince-shipment-tracking-foundation/health.svg)](https://phpackages.com/packages/slince-shipment-tracking-foundation)
```

###  Alternatives

[slince/shipment-tracking

A flexible and awesome shipment tracking library for several carriers like DHL eCommerce, USPS, YanWen Express, Epacket, E包裹, E特快, 国际EMS, 快递100

291.6k4](/packages/slince-shipment-tracking)[sauladam/shipment-tracker

Parses tracking information for several carriers, like UPS, USPS, DHL and GLS by simply scraping the data. No need for any kind of API access.

9738.8k](/packages/sauladam-shipment-tracker)[pragmarx/tracker

A Laravel Visitor Tracker

2.9k300.0k1](/packages/pragmarx-tracker)[shippo/shippo-php

A PHP library for connecting with multiple carriers (FedEx, UPS, USPS) using Shippo.

1711.8M2](/packages/shippo-shippo-php)[apix/log

Minimalist, thin and fast PSR-3 compliant (multi-bucket) logger.

511.0M18](/packages/apix-log)[webit/gls-tracking

Web-IT GLS Tracking API

1416.3k2](/packages/webit-gls-tracking)

PHPackages © 2026

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