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.
1. General API Changes
1.1 Endpoint Change
What's the difference?
Change | Before | After |
---|---|---|
Base URL | https://api.aftership.com/tracking/2025-01 | https://api.aftership.com/tracking/2025-04 |
as-api-version response header value | 2025-01 | 2025-04 |
as-webhook-version request header value | 2025-01 | 2025-04 |
What do I need to do?
Make the following updates to your application's code:
- Replace the base URL from https://api.aftership.com/tracking/2025-01 to https://api.aftership.com/tracking/2025-04.
- When editing existing URLs or adding new ones, select the Webhook version. Please review your webhook settings for verification.
- Parse the header to distinguish between different versions. Otherwise, no action is required.
2. API Endpoints Deprecation
What's the difference?
Change | Before | After |
---|---|---|
Deprecating endpoints | - GET /couriers/all | Endpoints removed |
What do I need to do?
Make the following updates to your application's code:
- Replace
GET /couriers/all
endpoints withGET /couriers
endpoint. Refer to the documentation on GET couriers endpoints for more information.
3. New API Endpoints
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:
- Implement the courier connections interface in your code i to use this feature. Otherwise, no further action is required.
4. New SDK Added
5. Tracking Model New Fields Added
New Fields | Description |
---|---|
latest_estimated_delivery.revise_reason | Explains 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.
6. Tracking Model Fields Updated
6.1 Tracking ID format changed
- 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?
Change | Before | After |
---|---|---|
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?
- 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.
7. Tracking Model Fields Removed
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?
- Replace the parsing for the
tracking_origin_country_region
withorigin_country_region
. - Replace the parsing for the
tracking_destination_country_region
withdestination_country_region
. - Replace the parsing for the
tracking_postal_code
withdestination_postal_code
. - Replace the parsing for the
tracking_state
withdestination_state
.
8. Tracking Endpoints Common Changes
8.1 New fields added in tracking
Please refer to the Tracking Model New Fields Added section of the guide.
8.2 Fields updated in tracking
Please refer to the Tracking Model Fields Updated section of the guide.
8.3 Fields removed in tracking
Please refer to the Tracking Model Fields Removed section of the guide.
9. Tracking Endpoints Specific Changes
9.1 GET /trackings endpoint
Please refer to the Tracking Endpoints Common Changes section of the guide.
9.2 POST /trackings endpoint
9.2.1 New fields added in the request body
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 |
The request body:
|
You can optionally add an
|
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.
9.3 GET /trackings/:id endpoint
Please refer to the Tracking Endpoints Common Changes.
9.4 PUT /trackings/:id endpoint
Please refer to the Tracking Endpoints Common Changes.
9.5 DELETE /trackings/:id endpoint
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.
10. Courier Model New Fields
Before | After |
---|---|
active | Indicates whether the user has activated the courier. |
credentials | Refers 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.fields | This 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.*.name | The display name of the credential field that users must provide when creating a carrier connection. |
credentials.fields.*.type | The data type of the credential field, indicating the expected input format. |
credentials.fields.*.required | It 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.
11. Courier Model Fields Renamed
The following fields/enum values have been renamed:
Before | After |
---|---|
courier.required_fields enum value - tracking_origin_country_region | origin_country_region |
courier.required_fields enum value - tracking_destination_country_region | destination_country_region |
courier.required_fields enum value - tracking_postal_code | destination_postal_code |
courier.required_fields enum value - tracking_state | destination_state |
What do I need to do?
- Remove the parsing for the old field.
- Parse the new field in the API response if you want to retrieve data from the new field. Otherwise, no action is required.
12. Courier Endpoints Common Changes
12.1 New fields added in courier
Please refer to the Courier Model New Fields section of the guide.
12.2 Fields updated in courier
Please refer to the Courier Model Fields Renamed section of the guide.
13. Courier Endpoints Specific Changes
13.1 GET /couriers
13.1.1 Parameters added
What's the difference?
New Fields | Description |
---|---|
active | Whether the user has activated the courier. |
slug | Unique 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
13.2.1 Fields updated in the request body
What's the difference?
Change | Before | After |
---|---|---|
tracking_origin_country_region in the request body renamed to origin_country_region | tracking_origin_country_region | origin_country_region |
tracking_destination_country_region in the request body renamed to destination_country_region | tracking_destination_country_region | destination_country_region |
tracking_state in the request body renamed to destination_state | tracking_state | destination_state |
tracking_postal_code in the request body renamed to destination_postal_code | tracking_postal_code | destination_postal_code |
What do I need to do?
- Remove the
tracking_origin_country_region
,tracking_destination_country_region
,tracking_state
, andtracking_postal_code
fields in the request body. - Include the new fields
origin_country_region
,destination_country_region
,destination_state
, anddestination_postal_code
in the API request body if you want to retrieve data from them. Otherwise, no action is required.
14. Webhook Changes
13.1 New fields added in tracking
Please refer to the Tracking model new fields added section of the guide.
13.2 Fields updated in tracking
Please refer to the Tracking model fields updated section of the guide.
13.3 Fields removed in tracking
Please refer to the Tracking Model Fields Removed section of the guide.
15. What if I don’t migrate?
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.