PHPackages                             shipmate/shipmate-php-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. shipmate/shipmate-php-sdk

ActiveLibrary[API Development](/categories/api)

shipmate/shipmate-php-sdk
=========================

Shipmate API SDK

1.1(2y ago)228MITPHPPHP &gt;=5.6

Since Apr 24Pushed 1y ago2 watchersCompare

[ Source](https://github.com/shipmateuk/shipmate-php-sdk)[ Packagist](https://packagist.org/packages/shipmate/shipmate-php-sdk)[ Docs](https://www.shipmate.co.uk/)[ RSS](/packages/shipmate-shipmate-php-sdk/feed)WikiDiscussions main Synced today

READMEChangelog (2)Dependencies (1)Versions (5)Used By (0)

**Shipmate PHP SDK**
====================

[](#shipmate-php-sdk)

This officially supported SDK provides an interface to the Shipmate API for use in PHP applications.

Shipmate is a shipping automation platform for UK and Ireland merchants that can be used to produce shipping labels and track parcels for multiple carriers the merchant has accounts with, within one platform. This reduces integration effort while simplifying daily operations by only needing to regularly use one platform for key shipping interactions, and can operate at scale.

To use this SDK you will need an active Shipmate account - if you don’t already have access to one, [visit the Shipmate website](https://www.shipmate.co.uk/) to find out more about the account types available and to open an account.

This SDK makes use of the [Shipmate API version 1.2](https://www.shipmate.co.uk/guides/api), and provides interfaces to all functionality, including:

- Shipment Creation
- Label Printing
- Delivery Services
- Tracking Events
- SKU Inventory
- Custom Fields

Installation
------------

[](#installation)

```
composer require shipmate/shipmate-php-sdk

```

Configuration
-------------

[](#configuration)

To access the Shipmate API you will need to configure both the environment and the API Key.

You may request a staging / sandbox account as part of your Shipmate subscription, or as a development partner.

[Register an API key for your application](https://www.shipmate.co.uk/guides/api#versioning) in the Shipmate web portal and configure the SDK as follows:

```
// Create an instance of Shipmate Service
$shipmate = new ShipmateService();

// Set the API key
$shipmate->setApiKey('YOUR_SHIPMATE_API_KEY');

// Set the Access Token
$shipmate->setApiToken('YOUR_SHIPMATE_API_TOKEN');

// Set the Environment
$shipmate->setEnvironment(Environment::STAGING); // if setEnvironment is not called then production URL will be used by default in requests.

```

Using the SDK
-------------

[](#using-the-sdk)

#### Create Shipment object - Mainland UK - 1 Parcel - Required Attributes

[](#create-shipment-object---mainland-uk---1-parcel---required-attributes)

```
// Create an instance of the Shipment class
$shipment = new Shipment();

// Set properties for the Shipment
$shipment->setShipmentReference('123456789');
$shipment->setOrderReference("987654321");

// Create an instance of the Address class for the to_address
$toAddress = new Address();
$toAddress->setName('Mr Shipmate Test');
$toAddress->setLine1('Friar Gate Studios');
$toAddress->setLine2('Ford Street');
$toAddress->setLine3('TEST LABEL - DO NOT DELIVER');
$toAddress->setCity('Derby');
$toAddress->setPostcode('DE1 1EE');
$toAddress->setCountry('GB');
$toAddress->setTelephone('01332460888');
$toAddress->setEmailAddress('support@shipmate.co.uk');

// Add the toAddress to the Shipment
$shipment->setToAddress($toAddress);

$shipment->setDeliveryInstructions('Leave with receptionist');

// Create an instance of the Parcel class
$parcel = new Parcel();
$parcel->setReference('56789');
$parcel->setWeight(450);
$parcel->setWidth(20);
$parcel->setLength(20);
$parcel->setDepth(20);
$parcel->setValue(14.99);

// Add the Parcel object to the parcels array of the Shipment object
$shipment->addParcel($parcel);

```

#### Create a Shipment on the Shipmate account

[](#create-a-shipment-on-the-shipmate-account)

```
$shipmentResponse = $shipmate->createShipment($shipment);

```

#### Access the Shipment Label

[](#access-the-shipment-label)

```
$shipmentResponse[0]->ZPL(); // get label of parcel 1

```

#### Print Labels

[](#print-labels)

```
$shipmate->printLabels('SHIPMENT_ID', 'SHIPMATE_USER_ID');

```

#### Get Delivery Services

[](#get-delivery-services)

```
$deliveryServices = $shipmate->getDeliveryServices();

```

#### Get Tracking Events

[](#get-tracking-events)

```
$shipmentTrackingEvents = $shipmate->getEventsByShipment(‘SHIPMENT_REFERENCE’);

$parcelTrackingEvents = $shipmate->getEventsByParcel(‘PARCEL_TRACKING_REFERENCE’);

```

#### Create SKU object - Required Attributes

[](#create-sku-object---required-attributes)

```
$sku = new SKU();
$sku->setSku('6776929224');
$sku->setProductName('Blue Shipmate T-shirt (Cotton), size Large');
$sku->setTariffCode('6109100010');
$sku->setTariffDescription('Mens T-shirts (Cotton)');
$sku->setCountryOfOrigin('GB');
$sku->setValueExVat('20.82');
$sku->setVatRate('20.0');
$sku->setValueIncVat('24.99');
$sku->setGrossWeight(350);
$sku->setNetWeight(350);
$sku->setWidth(200);
$sku->setLength(200);
$sku->setDepth(20);
$sku->setIsStockedItem(true);
$sku->setInStock(true);
$sku->setItemHandling('Packable');

```

#### Add SKU to Shipmate account

[](#add-sku-to-shipmate-account)

```
$shipmate->createSKU($sku);

```

#### Get all SKUs on the Shipmate account

[](#get-all-skus-on-the-shipmate-account)

```
$shipmate->getSKUs();

```

#### Create Custom Field object

[](#create-custom-field-object)

```
// Create a new instance of the CustomField class
$customField = new CustomField();

// Set properties for the Custom Field
$customField->setName('Insurance Cover Value');
$customField->setKey('SHIPMENT_INSURANCE_COVER_VALUE');
$customField->setEntity('SHIPMENT');
$customField->setDataType('NUMERIC');
$customField->setSource('DIRECT');
$customField->setDefaultValue('0');

// Create a new instance of the DataValidationRules class
$dataValidationRules = new DataValidationRules();
$dataValidationRules->setNumericType('DECIMAL');
$dataValidationRules->setMaxValue(200.00);

// Add Data Validation Rules to the Custom Field
$customField->setDataValidationRules($dataValidationRules);

```

#### Add Custom Field to Shipmate account

[](#add-custom-field-to-shipmate-account)

```
$shipmate->createCustomField($customField);

```

#### Get all Custom Fields

[](#get-all-custom-fields)

```
$shipmate->getCustomFields();

```

Licence
-------

[](#licence)

Usage of this SDK is provided under the [MIT License](https://opensource.org/license/mit). See LICENSE for full details.

**LICENSE**
===========

[](#license)

Copyright 2024 Shipmate Systems Limited

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance28

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 Bus Factor1

Top contributor holds 80% 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 ~88 days

Total

3

Last Release

622d ago

### Community

Maintainers

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

---

Top Contributors

[![shipmateuk](https://avatars.githubusercontent.com/u/163893935?v=4)](https://github.com/shipmateuk "shipmateuk (4 commits)")[![luke-bates](https://avatars.githubusercontent.com/u/23028660?v=4)](https://github.com/luke-bates "luke-bates (1 commits)")

---

Tags

phpcomposersdkpackagelibraryshippingshipmate

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[checkout/checkout-sdk-php

Checkout.com SDK for PHP

563.6M13](/packages/checkout-checkout-sdk-php)[octw/aramex

A Library to integrate with Aramex APIs

2927.7k](/packages/octw-aramex)[lai3221/amzn_adv_api_php

Amazon Advertising API Client Library V3.0

131.5k](/packages/lai3221-amzn-adv-api-php)

PHPackages © 2026

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