PHPackages                             jsamhall/shipengine - 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. jsamhall/shipengine

ActiveLibrary[API Development](/categories/api)

jsamhall/shipengine
===================

A PHP wrapper for the accessing and interacting with the ShipEngine v1 API.

1.2.1(1mo ago)55774MITPHP

Since Nov 3Pushed 3w ago3 watchersCompare

[ Source](https://github.com/jsamhall/shipengine)[ Packagist](https://packagist.org/packages/jsamhall/shipengine)[ RSS](/packages/jsamhall-shipengine/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (2)Versions (7)Used By (0)

About
-----

[](#about)

A PHP wrapper for the accessing and interacting with the ShipEngine v1 API.

**Not actively maintained though functional for my own needs. Use at your own discretion**

How to use
----------

[](#how-to-use)

```
$addressFormatter = new Acme\AddressFormatter; // implements Address\FormatterInterface
$shipEngine = new jsamhall\ShipEngine\ShipEngine('your_shipengine_api_key', $addressFormatter);
$carriers = $shipEngine->listCarriers();
```

Example
-------

[](#example)

Minimal example to implement the [Quick Start](https://docs.shipengine.com/docs/quickstart-create-a-label) example:

```
use jsamhall\ShipEngine\Address\ArrayFormatter;
use jsamhall\ShipEngine\ShipEngine;
use jsamhall\ShipEngine\Address\Address;
use jsamhall\ShipEngine\Shipment\Package;
use jsamhall\ShipEngine\Labels\Shipment;
use jsamhall\ShipEngine\Carriers\USPS\ServiceCode;

$to = new Address();
$to->setName('Mickey and Minnie Mouse');
$to->setPhone('+1 (714) 781-456');
$to->setCompanyName('The Walt Disney Company');
$to->setAddressLine1('address_line1');
$to->setCityLocality('Burbank');
$to->setStateProvince('CA');
$to->setPostalCode('91521');
$to->setCountryCode('US');
$to->setAddressResidentialIndicator('No');

$from = new Address;
$from->setName('Mickey and Minnie Mouse');
$from->setPhone('+1 (714) 781-456');
$from->setCompanyName('The Walt Disney Company');
$from->setAddressLine1('address_line1');
$from->setCityLocality('Burbank');
$from->setStateProvince('CA');
$from->setPostalCode('91521');
$from->setCountryCode('US');
$from->setAddressResidentialIndicator('No');

$weight = new Package\Weight(1.0);
$dimensions = new Package\Dimensions(10.0, 15.0, 8.0);
$package = new Package($weight, $dimensions);

$shipment = new Shipment(ServiceCode::priorityMail(), $to, $from, [$package]);

$addressFormatter = new ArrayFormatter();
$shipEngine = new ShipEngine('your_shipengine_api_key', $addressFormatter);
$testMode = true;
$label = $shipEngine->createLabel($shipment, $testMode);
```

Addresses
---------

[](#addresses)

ShipEngine expects a certain address format. This Library offers the `Address\Address` class which conforms to this format. All methods that require an Address as part of the request (e.g., validation, rating, labels etc.) expect an `Address\Address` in order to ensure consistency and compatibility.

You should write an implementation `Address\FormatterInterface` that extracts data from your domain-specific Address in the format expected by the ShipEngine API. This implementation is a constructor argument for the `Address\Factory` class which will translate your Domain's Address Model to an instance of `Address\Address`

This formatter is available in the public interface of the `jsamhall\ShipEngine` instance:

```
/** @var Acme\Domain\Address $domainAddress */
$domainAddress = $this->addressRepository->find(1234);
$shipEngineAddress = $shipEngine->formatAddress($domainAddress);

// now $shipEngineAddress can be used for building e.g. an instance of Labels\Shipment
```

Tracking
--------

[](#tracking)

Retrieve tracking information for a package using its carrier code and tracking number. This requires the ShipEngine **Advanced plan or higher**, and the carrier must be connected to your ShipEngine account.

```
use jsamhall\ShipEngine\ShipEngine;
use jsamhall\ShipEngine\Address\ArrayFormatter;

$shipEngine = new ShipEngine('your_shipengine_api_key', new ArrayFormatter());

$tracking = $shipEngine->trackPackage('usps', '9405511899223197428490');

$tracking->getStatusCode();          // e.g. "DE"  (see Tracking\StatusCode constants)
$tracking->getStatusDescription();   // e.g. "Delivered"
$tracking->isDelivered();            // bool
$tracking->getActualDeliveryDate();  // ?\DateTime

foreach ($tracking->getEvents() as $event) {
    printf("%s — %s (%s)\n",
        $event->getOccurredAt() ? $event->getOccurredAt()->format('c') : 'n/a',
        $event->getDescription(),
        $event->getCityLocality()
    );
}
```

The first argument accepts either a carrier code string (`"usps"`, `"fedex"`, `"ups"`) or a `Carriers\CarrierCode` value object. If the carrier is not connected to your account the call throws `Exception\ApiErrorResponse`.

Information
-----------

[](#information)

Please visit  for information regarding, and to sign up for the ShipEngine platform.

Please visit  for ShipEngine's official API documentation.

This project is in no way associated to or endorsed by ShipEngine, ShipStation or any of their partners.

ShipEngine and ShipStation are registered trademarks. All rights reserved.

###  Health Score

48

—

FairBetter than 94% of packages

Maintenance93

Actively maintained with recent releases

Popularity20

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 96.5% 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 ~425 days

Total

5

Last Release

37d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5eeb0dd9dbd9206fbea5976303d8ac1358bb1c4ce704d155b8dd3ba293f3f294?d=identicon)[jsamhall](/maintainers/jsamhall)

---

Top Contributors

[![jsamhall](https://avatars.githubusercontent.com/u/13559547?v=4)](https://github.com/jsamhall "jsamhall (55 commits)")[![acinader](https://avatars.githubusercontent.com/u/700572?v=4)](https://github.com/acinader "acinader (2 commits)")

---

Tags

shipstationshipengine

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/jsamhall-shipengine/health.svg)

```
[![Health](https://phpackages.com/badges/jsamhall-shipengine/health.svg)](https://phpackages.com/packages/jsamhall-shipengine)
```

###  Alternatives

[lucasdotvin/laravel-soulbscription

A straightforward interface to handle subscriptions and features consumption.

709209.3k](/packages/lucasdotvin-laravel-soulbscription)[shipengine/shipengine

PHP library for the ShipEngine API.

173.1k](/packages/shipengine-shipengine)[michaelb/ship-station

A php wrapper for ship station's api

102.0k](/packages/michaelb-ship-station)

PHPackages © 2026

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