Migration from 2025-01 API & Webhook to 2025-04

The following guide will help you migrate the API and webhook from version 2025-01 to version 2025-04.

What's the difference?

ChangeBeforeAfter
Base URLhttps://api.aftership.com/tracking/2025-01https://api.aftership.com/tracking/2025-04
as-api-version response header value2025-012025-04
as-webhook-version request header value2025-012025-04

What do I need to do?

Make the following updates to your application's code:

  1. Replace the base URL from https://api.aftership.com/tracking/2025-01 to https://api.aftership.com/tracking/2025-04.
  2. When editing existing URLs or adding new ones, select the Webhook version. Please review your webhook settings for verification.
  3. Parse the header to distinguish between different versions. Otherwise, no action is required.

What's the difference?

ChangeBeforeAfter
Deprecating endpoints- GET /couriers/allEndpoints removed

What do I need to do?

Make the following updates to your application's code:

  1. Replace GET /couriers/all endpoints with GET /couriers endpoint. Refer to the documentation on GET couriers endpoints for more information.

The following endpoints are added in API 2025-04:

  • GET /courier-connections
  • POST /courier-connections
  • PATCH /courier-connections/:id
  • GET /courier-connections/:id
  • DELETE /courier-connections/:id

What do I need to do?

Make the following updates to your application's code:

  1. Implement the courier connections interface in your code i to use this feature. Otherwise, no further action is required.
LanguageRepository URL
Javahttps://github.com/AfterShip/tracking-sdk-java
Nodejshttps://github.com/AfterShip/tracking-sdk-nodejs
.NEThttps://github.com/AfterShip/tracking-sdk-net
Pythonhttps://github.com/AfterShip/tracking-sdk-python
Rubyhttps://github.com/AfterShip/tracking-sdk-ruby
PHPhttps://github.com/AfterShip/tracking-sdk-php
Golanghttps://github.com/AfterShip/tracking-sdk-go
New FieldsDescription
latest_estimated_delivery.revise_reasonExplains the reason for a change to the latest_estimated_delivery. This string will only have a value if:
1. The source for the latest EDD is AfterShip EDD.
2. The reason for the change is known.
For a comprehensive list of reasons, please refer to this document.

What do I need to do?

Simply parse the new field in the API response and the webhook body to fetch the field. Otherwise, no action is required.

  • The length of the tracking ID has been updated from a 32-character string to a string ranging from 0 to 128 characters, following the format [0-9a-zA-Z-_]{1,128}.
  • The tracking ID now supports user-provided values. If no value is provided, the system will automatically generate a 32-character UUID.

What's the difference?

ChangeBeforeAfter
The length of the tracking ID has been updated from a 32-character string to a string ranging from 0 to 128 characters.32-character UUID
Sample: c17ed4faec0a4831b675f445aad72e4e
A string following the RegExp pattern:
[0-9a-zA-Z-_]{1,128}
Sample: 123

What do I need to do?

  1. Update the format of the tracking ID to match the new format [0-9a-zA-Z-_]{1,128} if you are using this field. Otherwise, no action is required.

The following fields have been removed and replaced with new ones.

  • tracking_origin_country_region
  • tracking_destination_country_region
  • tracking_postal_code
  • tracking_state

What do I need to do?

  1. Replace the parsing for the tracking_origin_country_region with origin_country_region.
  2. Replace the parsing for the tracking_destination_country_region with destination_country_region.
  3. Replace the parsing for the tracking_postal_code with destination_postal_code.
  4. Replace the parsing for the tracking_state with destination_state.

Please refer to the Tracking Model New Fields Added section of the guide.

Please refer to the Tracking Model Fields Updated section of the guide.

Please refer to the Tracking Model Fields Removed section of the guide.

Please refer to the Tracking Endpoints Common Changes section of the guide.

9.2 POST /trackings endpoint

Create a tracking endpoint now supports custom tracking id.

What's the difference?

Change Before After

The request body of the tracking create endpoint now supports the id field

The request body:

preparing...

You can optionally add an id field in the request body:

preparing...

What do I need to do?
Add the new id field to the API request body if you want to retrieve the corresponding data. Otherwise, no action is required.

Please refer to the Tracking Endpoints Common Changes.

Please refer to the Tracking Endpoints Common Changes.

Please refer to the Tracking Endpoints Common Changes.

9.6 POST /trackings/:id/retrack endpoint

Please refer to the Tracking Endpoints Common Changes.

9.7 POST /trackings/:id/mark-as-complete endpoint

Please refer to the Tracking Endpoints Common Changes.

BeforeAfter
activeIndicates whether the user has activated the courier.
credentialsRefers to the authentication details required for each specific carrier (such as API keys, username, password, etc.) that the user must provide to create a carrier connection. The content varies by carrier.
credentials.fieldsThis field allows users to get the specific authentication details required for establishing a connection with a particular carrier, such as API keys, usernames, and passwords. Each field includes properties like name, data type, and whether it is required.
credentials.fields.*.nameThe display name of the credential field that users must provide when creating a carrier connection.
credentials.fields.*.typeThe data type of the credential field, indicating the expected input format.
credentials.fields.*.requiredIt indicates whether the credentials field is mandatory when creating a carrier connection.

What do I need to do?

To fetch any new fields, simply parse them in the API response and the webhook body. Otherwise, no action is required.

The following fields/enum values have been renamed:

BeforeAfter
courier.required_fields enum value - tracking_origin_country_regionorigin_country_region
courier.required_fields enum value - tracking_destination_country_regiondestination_country_region
courier.required_fields enum value - tracking_postal_codedestination_postal_code
courier.required_fields enum value - tracking_statedestination_state

What do I need to do?

  1. Remove the parsing for the old field.
  2. Parse the new field in the API response if you want to retrieve data from the new field. Otherwise, no action is required.

Please refer to the Courier Model New Fields section of the guide.

Please refer to the Courier Model Fields Renamed section of the guide.

What's the difference?

New FieldsDescription
activeWhether the user has activated the courier.
slugUnique courier code. Use a comma for multiple values. (Example: dhl, ups, usps)

What do I need to do?

Include the new field in the API request parameters if you want to use it. Otherwise, no action is required.

13.2 POST /couriers/detect

What's the difference?

ChangeBeforeAfter
tracking_origin_country_region in the request body renamed to origin_country_regiontracking_origin_country_regionorigin_country_region
tracking_destination_country_region in the request body renamed to destination_country_regiontracking_destination_country_regiondestination_country_region
tracking_state in the request body renamed to destination_statetracking_statedestination_state
tracking_postal_code in the request body renamed to destination_postal_codetracking_postal_codedestination_postal_code

What do I need to do?

  1. Remove the tracking_origin_country_region, tracking_destination_country_region, tracking_state, and tracking_postal_code fields in the request body.
  2. Include the new fields origin_country_region, destination_country_region, destination_state, and destination_postal_code in the API request body if you want to retrieve data from them. Otherwise, no action is required.

Please refer to the Tracking model new fields added section of the guide.

Please refer to the Tracking model fields updated section of the guide.

Please refer to the Tracking Model Fields Removed section of the guide.

After July 8, 2026, any requests made to the 2025-01 version will be automatically redirected to version 2025-04. While this redirection aims to minimize disruptions, it may not fully support all functionalities available in the newer versions. We encourage you to complete the migration at your earliest convenience.