PHPackages                             trackmage/trackmage-sdk-php - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. trackmage/trackmage-sdk-php

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

trackmage/trackmage-sdk-php
===========================

TrackMage PHP SDK

v0.3.2(4y ago)18.4k1MITPHPPHP &gt;=5.6CI failing

Since Apr 20Pushed 4y ago1 watchersCompare

[ Source](https://github.com/trackmage/trackmage-sdk-php)[ Packagist](https://packagist.org/packages/trackmage/trackmage-sdk-php)[ Docs](https://trackmage.com)[ RSS](/packages/trackmage-trackmage-sdk-php/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (4)Dependencies (6)Versions (10)Used By (0)

[ ![](https://user-images.githubusercontent.com/1675033/84406764-a7091300-ac12-11ea-8250-774a8f0697fe.jpg) ](#)Trackmage - A tracking page for your store. Beautiful, branded, customizable.
=============================================================================

[](#trackmage---a-tracking-page-for-your-store-beautiful-branded-customizable)

TrackMage SDK for php
=====================

[](#trackmage-sdk-for-php)

[![Total Downloads](https://camo.githubusercontent.com/4b9d5b344af1cd00713b281ba08db5969b16a33c25d9fa4323d145fc9ee052ce/68747470733a2f2f706f7365722e707567782e6f72672f747261636b6d6167652f747261636b6d6167652d73646b2d7068702f646f776e6c6f616473)](https://packagist.org/packages/trackmage/trackmage-sdk-php)

TrackMage is your most automated shipment tracking tool ever. Discover the simple way to show your customers where their parcels are, provide support and get more great reviews

Getting Started
---------------

[](#getting-started)

1. **Create a TrackMage account** – First of all, you need to [sign up](https://app.trackmage.com) for a TrackMage account and retrieve your clientId and clientSecret.
2. **Minimum requirements** – To run the SDK you need to have installed **PHP &gt;= 5.6**. We highly recommend using v7.2 or higher.
3. **Install the SDK** – Using \[Composer\] is the recommended way to install the TrackMage SDK for PHP. The SDK is available on Packagist as the [`trackmage/trackmage-sdk-php`](http://packagist.org/packages/trackmage-sdk-php) package ```
    composer require trackmage/trackmage-sdk-php

    ```
4. **See the docs** There are [API documentation](https://docs.trackmage.com/docs/) and [the Swagger reference](https://api.trackmage.com/)

Quick examples
--------------

[](#quick-examples)

### Create a client

[](#create-a-client)

```
use TrackMage\Client\TrackMageClient;

$clientId = '';
$clientSecret = '';
$client = new TrackMageClient($clientId, $clientSecret);

```

### Posting a tracking number

[](#posting-a-tracking-number)

```
$workspaceId = 100;

$response = $client->post('/shipments', ['json' => [
    'workspace' => '/workspaces/'.$workspaceId,
    'trackingNumber' => 'TN-1',
]]);
$shipment = TrackMageClient::item($response);

$response = $client->get('/workspaces/'.self::$workspaceId.'/shipments');
$shipments = TrackMageClient::collection($response);

```

### Get workspaces list

[](#get-workspaces-list)

```
$response = $client->get('/workspaces/'.$workspaceId.'/shipments');
$workspaces = TrackMageClient::collection($response);

```

### Get carriers list

[](#get-carriers-list)

```
$response = $client->get('/public/carriers');
$carriers = TrackMageClient::collection($response);

```

### Create webhook

[](#create-webhook)

Here is [the webhook handler example](examples/webhook-handler.php) that you need to make accessible on your side.

```
$workflow = [
    'type' => 'webhook',
    'period' => 'immediately',
    'title' => 'Webhook for testing',
    'workspace' => '/workspaces/',
    'enabled' => true,
    'concurrency' => '1',
    'url' => 'http://acme.example',
    'authType' => 'basic',
    'username' => 'webhook_user',
    'password' => 'password',
    'notificationEmails' => [
        'test@email.com', 'test-2@email.com',
    ],
];
$response = $client->post('/workflows', ['json' => $workflow]);
$workflow = TrackMageClient::item($response);
$workflowId = $workflow['id'];

```

Tests
-----

[](#tests)

To run the unit tests:

```
composer update
./vendor/bin/phpunit
```

phpstan
-------

[](#phpstan)

```
vendor/bin/phpstan analyse -c phpstan.neon
vendor/bin/phpstan analyse -c phpstan-tests.neon

```

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 96.2% 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 ~218 days

Total

5

Last Release

1706d ago

### Community

Maintainers

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

---

Top Contributors

[![karser](https://avatars.githubusercontent.com/u/1675033?v=4)](https://github.com/karser "karser (25 commits)")[![sensum27](https://avatars.githubusercontent.com/u/17142361?v=4)](https://github.com/sensum27 "sensum27 (1 commits)")

---

Tags

phpsdkshipment-trackingtracking numberparcel-trackingtrackmage

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/trackmage-trackmage-sdk-php/health.svg)

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

###  Alternatives

[grumpydictator/firefly-iii

Firefly III: a personal finances manager.

22.8k69.3k](/packages/grumpydictator-firefly-iii)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

728272.9k20](/packages/civicrm-civicrm-core)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)[dsposito/argo

A shipping utility.

23177.0k](/packages/dsposito-argo)

PHPackages © 2026

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