Skip to content

Releases: AfterShip/tracking-sdk-python

10.0.0

Choose a tag to compare

@1415003719 1415003719 released this 13 Jul 08:25
acb11e5

What's New - AfterShip Tracking Python SDK v10.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
req = CreateTrackingRequest(
    tracking_number="1234567890",
    slug="usps",
    shipment_direction=CreateTrackingRequestShipmentDirection.RETURN,
)
result = sdk.tracking.create_tracking(req)

# Read
result = sdk.tracking.get_tracking_by_id(id)
tracking = result.data
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:
    tracking.multi_piece_info.type  # "master" | "child"
    for piece in tracking.multi_piece_info.pieces:
        # piece.tracking_id, piece.tracking_number, piece.type, piece.trackable
        pass

3. Customer ID

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

req = CreateTrackingRequest(
    tracking_number="1234567890",
    customers=[CreateTrackingRequestCustomers(email="customer@example.com", id="shopify-customer-123")],
)

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: 9.0.0...10.0.0

9.0.0

Choose a tag to compare

@1415003719 1415003719 released this 13 Jan 07:54
b6b216e

What's Changed

Full Changelog: 8.0.1...9.0.0

8.0.1

Choose a tag to compare

@1415003719 1415003719 released this 27 Oct 03:43
1bd6cae

What's Changed

Full Changelog: 8.0.0...8.0.1

8.0.0

Choose a tag to compare

@1415003719 1415003719 released this 21 Oct 03:03
2120f93

Breaking Changes - AfterShip Tracking Python SDK v8.0.0

1. Response Structure Complete Refactor

All Response classes now contain response_header and data structure:

# v7 - Direct access to response properties
response = client.tracking.create_tracking(request)
tracking_id = response.id
tracking_number = response.tracking_number

# v8 - Must access through data property
response = client.tracking.create_tracking(request)
tracking_id = response.data.id
tracking_number = response.data.tracking_number
headers = response.response_header  # New feature: get response headers

Applies to all API responses: create_tracking, get_tracking_by_id, get_trackings, update_tracking_by_id, get_couriers, etc.

2. Model Names Simplified

Tracking model naming convention changed:

# v7 - Suffix naming
from tracking.models.courier_estimated_delivery_date_tracking import CourierEstimatedDeliveryDateTracking
from tracking.models.shipment_weight_tracking import ShipmentWeightTracking
from tracking.models.aftership_estimated_delivery_date_tracking import AftershipEstimatedDeliveryDateTracking

# v8 - Prefix naming  
from tracking.models.tracking_courier_estimated_delivery_date import TrackingCourierEstimatedDeliveryDate
from tracking.models.tracking_shipment_weight import TrackingShipmentWeight
from tracking.models.tracking_aftership_estimated_delivery_date import TrackingAftershipEstimatedDeliveryDate

Response class simplification:

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

3. String Parameters to Strong-Typed Enums

Parameters changed from string to enum types:

# v7 - String parameters
from tracking.models.mark_tracking_completed_by_id_request import MarkTrackingCompletedByIdRequest

request = MarkTrackingCompletedByIdRequest(
    reason="DELIVERED"  # String parameter
)

# v8 - Enum parameters
from tracking.models.mark_tracking_completed_by_id_request import MarkTrackingCompletedByIdRequest
from tracking.models.mark_tracking_completed_by_id_request_reason import MarkTrackingCompletedByIdRequestReason

request = MarkTrackingCompletedByIdRequest(
    reason=MarkTrackingCompletedByIdRequestReason.DELIVERED  # Enum parameter
)

Enum constants also changed naming convention:

# v7 - Concatenated naming
Tag.INFORECEIVED
Tag.INTRANSIT
Tag.OUTFORDELIVERY

# v8 - Underscore separated naming
Tag.INFO_RECEIVED
Tag.IN_TRANSIT
Tag.OUT_FOR_DELIVERY

7.1.0

Choose a tag to compare

@1415003719 1415003719 released this 14 Oct 06:21
26500c3

What's Changed

Full Changelog: 7.0.0...7.1.0

7.0.0

Choose a tag to compare

@1415003719 1415003719 released this 22 Jul 08:52
1aaf75a

What's Changed

Full Changelog: 6.0.0...7.0.0

6.0.0

Choose a tag to compare

@1415003719 1415003719 released this 23 Apr 09:12
8cd876e

What's Changed

Full Changelog: 5.0.1...6.0.0

5.0.1

Choose a tag to compare

@AfterShip-Team-Mocha AfterShip-Team-Mocha released this 03 Mar 11:03
0ccc240

What's Changed

Full Changelog: 5.0.0...5.0.1

5.0.0

Choose a tag to compare

@panxl6 panxl6 released this 17 Jan 02:19
8bb2af1

What's Changed

New Contributors

Full Changelog: https://github.com/AfterShip/tracking-sdk-python/commits/5.0.0

4.0.0

Choose a tag to compare

@1415003719 1415003719 released this 25 Oct 03:23
7b8d4cc
  • 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
4.x.x 2024-10 https://github.com/AfterShip/tracking-sdk-python/tree/2024-10
3.x.x 2024-07 https://github.com/AfterShip/tracking-sdk-python/tree/2024-07
2.x.x 2024-04 https://github.com/AfterShip/tracking-sdk-python/tree/2024-04
<=1.x.x Legacy API https://github.com/AfterShip/aftership-sdk-python