Skip to content

Releases: AfterShip/tracking-sdk-php

16.0.0

Choose a tag to compare

@1415003719 1415003719 released this 13 Jul 08:28
d646a14

What's New - AfterShip Tracking PHP SDK v16.0.0

This release upgrades the SDK to the AfterShip Tracking API version 2026-07 (previously 2026-01). All endpoints now call /tracking/2026-07/.... See the 2026-07 Migration Guide for the underlying API changes.

There are no breaking changes — all 2026-07 API changes are additive. The major version bump reflects the API version upgrade only.

1. Shipment Direction and Linked Shipments

New read/write field shipment_direction (forward | return) on CreateTrackingRequest, UpdateTrackingByIdRequest, and the Tracking model, plus read-only links between forward and return shipments:

// Write — pass the plain string value for shipment_direction (see known issue below)
$payload = new \Tracking\Model\CreateTrackingRequest();
$payload->tracking_number = '1234567890';
$payload->slug = 'usps';
$payload->shipment_direction = 'return';
$response = $client->tracking->createTracking($payload);

// Read
$response = $client->tracking->getTrackingById($id);
$tracking = $response->getData();
$tracking->shipment_direction; // "forward" | "return"
$tracking->return_shipment;    // linked return shipment: id, tracking_number, slug
$tracking->forward_shipment;   // linked forward shipment: id

2. Multi-Piece Shipment Info

New read-only multi_piece_info field on the Tracking model:

if ($tracking->multi_piece_info !== null) {
    $tracking->multi_piece_info->type; // "master" | "child"
    foreach ($tracking->multi_piece_info->pieces as $piece) {
        // $piece->tracking_id, $piece->tracking_number, $piece->type, $piece->trackable
    }
}

3. Customer ID

New read/write id field on customers[], for storing the customer identifier from your merchant or platform (e.g. Shopify) system:

$customer = new \Tracking\Model\CreateTrackingRequestCustomers();
$customer->email = 'customer@example.com';
$customer->id = 'shopify-customer-123';
$payload->customers = [$customer];

4. Proof of Delivery, Shipment Dimensions, Checkpoint Hash

New read-only fields on the Tracking model:

$tracking->proof_of_delivery;   // POD records (type, url); feature must be enabled
$tracking->shipment_dimensions; // unit, length, width, height
$tracking->checkpoints[0]->hash; // unique hash per checkpoint event, for deduplication

5. 10 New Delivery Sub-statuses

The API may now return the following new subtag values. subtag is a plain string in the SDK, so no code change is required:

Sub-status Message
Delivered_005 Delivered to neighbor
Exception_016 Delayed (Processing issue)
Exception_017 Delayed (Extreme weather)
Exception_018 Incorrect missing documents
Exception_019 Delayed (Late flight)
Exception_020 Shipment cancelled
Exception_021 Shipment disposed
InTransit_011 Import customs clearance completed
InTransit_012 Import customs clearance started
InTransit_013 Drop off for carrier pickup

Full Changelog: 15.0.0...16.0.0

15.0.0

Choose a tag to compare

@1415003719 1415003719 released this 13 Jan 07:16
cf5fc89

What's Changed

Full Changelog: 14.0.0...15.0.0

14.0.0

Choose a tag to compare

@1415003719 1415003719 released this 12 Nov 01:39
c36d278

What's Changed

  • fix sign header and change slug_group to string by @1415003719 in #25

Full Changelog: 13.0.0...14.0.0

13.0.0

Choose a tag to compare

@1415003719 1415003719 released this 02 Sep 11:37
09413fa

What's Changed

Breaking Changes - AfterShip Tracking PHP SDK v13.0.0

System Requirements Changes

  • PHP Version: 8.0+ → 8.1+
  • Symfony Dependencies: Removed 5.4 support, minimum 6.4

1. Namespace And Model Name Changes

All request/response classes moved from API namespace to Model namespace:

// v12
use Tracking\API\Tracking\CreateTrackingRequest;
use Tracking\API\Courier\DetectCourierRequest;

// v13  
use Tracking\Model\CreateTrackingRequest;
use Tracking\Model\DetectCourierRequest;

Most of the request/response model names have been made more concise

// v12 - Suffix naming
use Tracking\Model\CourierEstimatedDeliveryDateTracking;
use Tracking\Model\ShipmentWeightTracking;
use Tracking\Model\AftershipEstimatedDeliveryDateTracking;
use Tracking\Model\CarbonEmissionsTracking;
use Tracking\Model\CustomEstimatedDeliveryDateTracking;

// v13 - Prefix naming
use Tracking\Model\TrackingCourierEstimatedDeliveryDate;
use Tracking\Model\TrackingShipmentWeight;
use Tracking\Model\TrackingAftershipEstimatedDeliveryDate;
use Tracking\Model\TrackingCarbonEmissions;
use Tracking\Model\TrackingCustomEstimatedDeliveryDate;

2. Response Structure Complete Refactor

All Response classes now contain responseHeader and data structure:

// v12 - Direct access to response properties
$response = $client->tracking->createTracking($request);
$id = $response->id;
$trackingNumber = $response->tracking_number;

// v13 - Must access through getData()
$response = $client->tracking->createTracking($request);
$data = $response->getData();
$id = $data->id;
$trackingNumber = $data->tracking_number;
$headers = $response->getResponseHeader(); // New feature: get response headers

Applies to all API responses: createTracking, getTrackingById, getTrackings, updateTrackingById, getCouriers, etc.

3. Constants to Enums

Multiple classes changed from class constants to PHP 8.1 native enums: #23

// v12 - Class constants
Tag::PENDING
Tag::DELIVERED
Tag::IN_TRANSIT

// v13 - Enum values
Tag::PENDING->value
Tag::DELIVERED->value  
Tag::IN_TRANSIT->value

Impact: If your code uses constants like Tag::PENDING for string comparison, change to Tag::PENDING->value.

Full Changelog: 12.0.0...13.0.0

12.0.0

Choose a tag to compare

@1415003719 1415003719 released this 22 Jul 08:12
a51b212

What's Changed

Full Changelog: 11.0.0...12.0.0

11.0.0

Choose a tag to compare

@1415003719 1415003719 released this 23 Apr 06:14
60e96b4

What's Changed

Full Changelog: 10.2.1...11.0.0

10.2.1

Choose a tag to compare

@1415003719 1415003719 released this 18 Mar 06:13

chore: adjust dependencies

Full Changelog: 10.2.0...10.2.1

10.2.0

Choose a tag to compare

@panxl6 panxl6 released this 12 Mar 03:47
611361e

What's Changed

Full Changelog: 10.1.3...10.2.0

10.1.3

Choose a tag to compare

@AfterShip-Team-Mocha AfterShip-Team-Mocha released this 03 Mar 03:45
851d96a

What's Changed

Full Changelog: 10.1.2...10.1.3

10.1.2

Choose a tag to compare

@AfterShip-Team-Mocha AfterShip-Team-Mocha released this 28 Feb 07:19
136d618

What's Changed

Full Changelog: 10.1.0...10.1.2