Skip to content

Releases: AfterShip/tracking-sdk-nodejs

17.0.0

Choose a tag to compare

@1415003719 1415003719 released this 13 Jul 08:24
f3ec2eb

What's New - AfterShip Tracking Node.js SDK v17.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
await client.tracking.createTracking({
  tracking_number: "1234567890",
  slug: "usps",
  shipment_direction: CreateTrackingRequestShipmentDirection.forward,
});

// Read
const res = await client.tracking.getTrackingById(id);
res.data.shipment_direction; // "forward" | "return"
res.data.return_shipment;    // linked return shipment: { id, tracking_number, slug }
res.data.forward_shipment;   // linked forward shipment: { id }

2. Multi-Piece Shipment Info

New read-only multi_piece_info field on the Tracking model:

const res = await client.tracking.getTrackingById(id);
res.data.multi_piece_info?.type; // "master" | "child"
for (const piece of res.data.multi_piece_info?.pieces ?? []) {
  // 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:

await client.tracking.createTracking({
  tracking_number: "1234567890",
  customers: [{ email: "customer@example.com", id: "shopify-customer-123" }],
});

4. Proof of Delivery, Shipment Dimensions, Checkpoint Hash

New read-only fields on the Tracking model:

const res = await client.tracking.getTrackingById(id);
res.data.proof_of_delivery?.[0]?.url; // POD records ({ type, url }); feature must be enabled
res.data.shipment_dimensions;         // { unit, length, width, height }
res.data.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: 16.0.0...17.0.0

16.0.0

Choose a tag to compare

@1415003719 1415003719 released this 13 Jan 07:16
c71f10e

Breaking Changes - AfterShip Tracking Node.js SDK v16.0.0

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

1. order_promised_delivery_date Changed from String to Object

The field is now an object supporting a date range, on CreateTrackingRequest, UpdateTrackingByIdRequest, and the Tracking model:

// v15 - string
await client.tracking.createTracking({
  tracking_number: "1234567890",
  order_promised_delivery_date: "2026-01-20",
});

// v16 - object
await client.tracking.createTracking({
  tracking_number: "1234567890",
  order_promised_delivery_date: {
    promised_delivery_date: "2026-01-20",
    // optional range:
    promised_delivery_date_min: "2026-01-18",
    promised_delivery_date_max: "2026-01-22",
  },
});

// Reading it back
const res = await client.tracking.getTrackingById(id);
// v15: res.data.order_promised_delivery_date            -> "2026-01-20"
// v16: res.data.order_promised_delivery_date?.promised_delivery_date -> "2026-01-20"

2. Checkpoint.zip Renamed to Checkpoint.postal_code

// v15
const zip = res.data.checkpoints?.[0]?.zip;

// v16
const postalCode = res.data.checkpoints?.[0]?.postal_code;

3. Tracking.last_mile_tracking_supported Removed

The last_mile_tracking_supported field has been removed from the Tracking model. To determine if a tracking is a multi-leg tracking, check whether last_mile is null or not instead:

// v15
const isMultiLeg = res.data.last_mile_tracking_supported === true;

// v16
const isMultiLeg = res.data.last_mile != null;

Full Changelog: 15.0.1...16.0.0

15.0.1

Choose a tag to compare

@1415003719 1415003719 released this 12 Nov 01:38
f155f5b

What's Changed

Full Changelog: 15.0.0...15.0.1

15.0.0

Choose a tag to compare

@1415003719 1415003719 released this 21 Oct 02:41
14dfce2

Breaking Changes - AfterShip Tracking Node.js SDK v15.0.0

1. Response Structure Complete Refactor

All Response interfaces now contain response_headers and data structure:

// v14 - Direct access to response properties
const response = await client.tracking.createTracking(request);
const id = response.id;
const trackingNumber = response.tracking_number;

// v15 - Must access through data property
const response = await client.tracking.createTracking(request);
const id = response.data.id;
const trackingNumber = response.data.tracking_number;
const headers = response.response_headers; // New feature: get response headers

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

2. Model Names Simplified

Tracking model naming convention changed:

// v14 - Suffix naming
import { CourierEstimatedDeliveryDateTracking } from './model/CourierEstimatedDeliveryDateTracking';
import { ShipmentWeightTracking } from './model/ShipmentWeightTracking';
import { AftershipEstimatedDeliveryDateTracking } from './model/AftershipEstimatedDeliveryDateTracking';

// v15 - Prefix naming  
import { TrackingCourierEstimatedDeliveryDate } from './model/TrackingCourierEstimatedDeliveryDate';
import { TrackingShipmentWeight } from './model/TrackingShipmentWeight';
import { TrackingAftershipEstimatedDeliveryDate } from './model/TrackingAftershipEstimatedDeliveryDate';

Response class simplification:

  • Old SDK had 120+ specialized response classes (e.g., AftershipEstimatedDeliveryDateCreateTrackingResponse, CarbonEmissionsGetTrackingByIdResponse)
  • New SDK unified these into simple, consistent response interfaces

14.0.0

Choose a tag to compare

@1415003719 1415003719 released this 22 Jul 08:12
cfe97fe

What's Changed

Full Changelog: 13.0.0...14.0.0

13.0.0

Choose a tag to compare

@1415003719 1415003719 released this 23 Apr 08:04
4eae447

What's Changed

Full Changelog: 12.0.0...13.0.0

12.0.0

Choose a tag to compare

@panxl6 panxl6 released this 10 Jan 06:33
42f157f
  • supported 2025-01 version.
  • added response headers in error object.

10.0.3

Choose a tag to compare

@panxl6 panxl6 released this 03 Dec 03:35
cebbd2a
  • resolved AES signature issue.

9.0.4

Choose a tag to compare

@panxl6 panxl6 released this 03 Dec 05:51
ff08c7b
  • resolved AES signature issue.

11.0.2

Choose a tag to compare

@1415003719 1415003719 released this 21 Oct 03:48
  • supporting 2024-10 version.

API and SDK Version

Each SDK version is designed to work with a specific API version. Please refer to the table below to identify the supported API versions for each SDK version, ensuring you select the appropriate SDK version for the API version you intend to use.

SDK Version Supported API Version Branch
11.x.x 2024-10 https://github.com/AfterShip/tracking-sdk-nodejs/tree/2024-10
10.x.x 2024-07 https://github.com/AfterShip/tracking-sdk-nodejs/tree/2024-07
9.x.x 2024-04 https://github.com/AfterShip/tracking-sdk-nodejs/tree/2024-04
8.x.x 2023-10 https://github.com/AfterShip/aftership-sdk-nodejs
<=7.x.x Legacy API https://github.com/AfterShip/aftership-sdk-nodejs