QUICKSTART
API Quick Start
Authentication
SignString
OAuth
Overview
Getting Started
Scope List
Versioning
Rate Limit
Body Envelope
Request Errors
Try API Endpoints
CHANGELOG
Changelog
Migration Guide
REFERENCE
API Overview
Tracking
Get trackings
get
Create a tracking
post
Get a tracking by ID
get
Update a tracking by ID
put
Delete a tracking by ID
delete
Retrack an expired tracking by ID
post
Mark tracking as completed by ID
post
Get a tracking (Legacy)
get
Update a tracking (Legacy)
put
Delete a tracking (Legacy)
delete
Retrack an expired tracking (Legacy)
post
Mark tracking as completed (Legacy)
post
Courier
Get user activated couriers
get
Detect courier
post
Get all couriers
get
Last Checkpoint
Get last checkpoint by tracking ID
get
Get last checkpoint (Legacy)
get
Notification
Get tracking notification by tracking ID
get
Add a notification by tracking ID
post
Remove a notification by tracking ID
post
Get tracking notification (Legacy)
get
Add a notification (Legacy)
post
Remove a notification (Legacy)
post
Estimated delivery date
Batch prediction for the Estimated Delivery Date
post
MODEL
Tracking
Courier
Checkpoint
Notification
ENUM
Additional Tracking Fields
Delivery Statuses
Delivery Sub-statuses
Slug Groups
Webhook
Webhook Overview
Webhook Versioning
Webhook Specifications
Webhook Signature
Webhook OAuth 2.0
Webhook Outgoing IPs
Webhook Changelog
OTHERS
Supported Couriers
CSV Upload & CSV Auto-Fetch
Shipment CSV Export
Order CSV Export
SDK
Android SDK
iOS SDK
Java SDK
Node.js SDK
.NET SDK
Python SDK
Ruby Gem
PHP SDK
Golang SDK
Open Source
phone
email-verifier
Support
Contact Support

Migration from legacy API to 2023-10

The following guide will help you to migrate the API and webhook from the legacy version to the 2023-10 version.

  • API

    What's the difference?

    ChangeBeforeAfter
    Base URLhttps://api.aftership.com/v4https://api.aftership.com/tracking/2023-10
    New response header-New response header key as-api-version
    Example value 2023-10
    API Key header's key- as-api-key
    - aftership-api-key
    - as-api-key
    - aftership-api-key
    API Key header's valueThe API keys that are marked as Legacy Tracking API access only are supported within the legacy API.The API keys that are marked as Legacy Tracking API access only are no longer supported in the versioned API.

    What do I need to do?

    1. Update your application's code, replacing the base URL https://api.aftership.com/v4 with https://api.aftership.com/tracking/2023-10.
    2. Parse the header if you want to identify different versions; otherwise, no action is required.
    3. The request header aftership-api-key is no longer supported in the versioned API. Please use as-api-key instead.
    4. The API keys that are marked as Legacy Tracking API access only are no longer supported in the versioned API. Create a new API key and update your application's code if required. Check your API keys here.
  • Webhook

    What's the difference?

    ChangeBeforeAfter
    New request header-New request header key as-webhook-version
    Example value 2023-10

    What do I need to do?

    1. Parse the header if you want to identify different versions; otherwise, no action is required.
    2. You can choose the Webhook version when editing existing URLs or adding new ones. Check your webhook settings here.
  • Transit Time Revamp

    What's the difference?

    We're aligning our transit time calculation with carrier standards for improved accuracy. Our previous method included the pick-up date, resulting in an extra day compared to carriers. Now, transit time starts on the first business day after pick-up, aligning with carriers, where transit time begins on the first business day after pick-up. This change simplifies SLA management and shipping performance monitoring for merchants.

    ChangeBeforeAfter
    Formula updatedPick up date is considered as 1 transit day

    - For delivered shipments:
    Transit time (in days) = Delivered date - Pick-up date + 1

    - For undelivered shipments:
    Transit time (in days) = Current date - Pick-up date + 1
    Pick up date is not considered as 1 day in transit

    - For delivered shipments:
    Transit time (in days) = Delivered date - Pick-up date

    - For undelivered shipments:
    Transit time (in days) = Current date - Pick-up date
    Tracking model's field renameddelivery_timetransit_time
    GET /trackings endpoint's query parameter renameddelivery_timetransit_time

    What do I need to do?

    1. Update your application code, replacing delivery_time with transit_time if you parse it from the tracking API's response body or tracking webhook's request body.
    2. Update your application code, replacing delivery_time with transit_time if you use the API endpoint GET /trackings and query with the delivery_time parameter.
    3. Be aware of the formula change and adjust your app's code where you use the value to ensure it won't break your system.
  • EDD source rename

    What's the difference?

    ChangeBeforeAfter
    The allowed values of first_estimated_delivery.source have been changed"Carrier EDD", "AI Predictive EDD", "Custom EDD", "Order EDD""Carrier EDD", "AfterShip EDD", "Custom EDD", "Order EDD"
    The allowed values of latest_estimated_delivery.source have been changed"Carrier EDD", "AI Predictive EDD", "Custom EDD", "Order EDD""Carrier EDD", "AfterShip EDD", "Custom EDD", "Order EDD"

    What do I need to do?

    1. Update your application code, replacing AI Predictive EDD with AfterShip EDD if you use first_estimated_delivery.source or latest_estimated_delivery.source from the tracking API's response body or tracking webhook's request body.

If you choose not to migrate, the legacy API will remain supported for a minimum of 2 years. However, following the deprecation of the legacy API, API endpoints will result in a 404 Not Found error.