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.
Currently SDKs are not supported for versioned APIs. Please stay tuned for further updates.
Breaking changes in version 2023-10
API Versioning changes
-
API
What's the difference?
Change Before After Base URL https://api.aftership.com/v4https://api.aftership.com/tracking/2023-10New response header - New response header key as-api-version
Example value2023-10API Key header's key - as-api-key✅
-aftership-api-key✅- as-api-key✅
-aftership-api-key❌API Key header's value The API keys that are marked as Legacy Tracking API access onlyare supported within the legacy API.The API keys that are marked as Legacy Tracking API access onlyare no longer supported in the versioned API.What do I need to do?
- Update your application's code, replacing the base URL
https://api.aftership.com/v4withhttps://api.aftership.com/tracking/2023-10. - Parse the header if you want to identify different versions; otherwise, no action is required.
- The request header
aftership-api-keyis no longer supported in the versioned API. Please useas-api-keyinstead. - The API keys that are marked as
Legacy Tracking API access onlyare 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.
- Update your application's code, replacing the base URL
-
Webhook
What's the difference?
Change Before After New request header - New request header key as-webhook-version
Example value2023-10What do I need to do?
- Parse the header if you want to identify different versions; otherwise, no action is required.
- You can choose the Webhook version when editing existing URLs or adding new ones. Check your webhook settings here.
Business logic changes
-
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.
Change Before After Formula updated Pick 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 + 1Pick 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 dateTracking model's field renamed delivery_timetransit_timeGET /trackingsendpoint's query parameter renameddelivery_timetransit_timeWhat do I need to do?
- Update your application code, replacing
delivery_timewithtransit_timeif you parse it from the tracking API's response body or tracking webhook's request body. - Update your application code, replacing
delivery_timewithtransit_timeif you use the API endpointGET /trackingsand query with thedelivery_timeparameter. - 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.
- Update your application code, replacing
-
EDD source rename
What's the difference?
Change Before After The allowed values of first_estimated_delivery.sourcehave 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.sourcehave 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?
- Update your application code, replacing
AI Predictive EDDwithAfterShip EDDif you usefirst_estimated_delivery.sourceorlatest_estimated_delivery.sourcefrom the tracking API's response body or tracking webhook's request body.
- Update your application code, replacing
What if I don’t migrate?
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.