Skip to content

Commit fc1452a

Browse files
author
Watson Zuo
committed
support 2026-01 version
1 parent 1bd6cae commit fc1452a

19 files changed

+206
-74
lines changed

README.md

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ If you need support using AfterShip products, please contact [email protected]
2020
- [Error Handling](#error-handling)
2121
- [Error List](#error-list)
2222
- [Endpoints](#endpoints)
23-
- [/estimated-delivery-date](#estimated-delivery-date)
2423
- [/trackings](#trackings)
2524
- [/couriers](#couriers)
2625
- [/courier-connections](#courier-connections)
26+
- [/estimated-delivery-date](#estimated-delivery-date)
2727
- [Help](#help)
2828
- [License](#license)
2929

@@ -39,7 +39,7 @@ Before you begin to integrate:
3939
### API and SDK Version
4040

4141
- SDK Version:
42-
- API Version: 2025-07
42+
- API Version: 2026-01
4343

4444
## Quick Start
4545

@@ -145,9 +145,6 @@ The SDK will return an error object when there is any error during the request,
145145

146146
The AfterShip instance has the following properties which are exactly the same as the API endpoints:
147147

148-
- estimated_delivery_date
149-
- Prediction for the Estimated Delivery Date
150-
- Batch prediction for the Estimated Delivery Date
151148
- tracking
152149
- Get trackings
153150
- Create a tracking
@@ -165,45 +162,9 @@ The AfterShip instance has the following properties which are exactly the same a
165162
- Get courier connection by id
166163
- Update courier connection by id
167164
- Delete courier connection by id
168-
169-
### /estimated-delivery-date
170-
**POST** /estimated-delivery-date/predict
171-
172-
```python
173-
req = tracking.EstimatedDeliveryDateRequest()
174-
175-
176-
req.slug = 'valid_value'
177-
178-
179-
req.origin_address = tracking.EstimatedDeliveryDateRequestOriginAddress()
180-
181-
182-
req.destination_address = tracking.EstimatedDeliveryDateRequestDestinationAddress()
183-
184-
185-
result = sdk.estimated_delivery_date.predict(
186-
187-
req,
188-
189-
)
190-
print(result)
191-
```
192-
193-
**POST** /estimated-delivery-date/predict-batch
194-
195-
```python
196-
req = tracking.PredictBatchRequest()
197-
198-
199-
200-
result = sdk.estimated_delivery_date.predict_batch(
201-
202-
req,
203-
204-
)
205-
print(result)
206-
```
165+
- estimated_delivery_date
166+
- Prediction for the Estimated Delivery Date
167+
- Batch prediction for the Estimated Delivery Date
207168

208169
### /trackings
209170
**GET** /trackings
@@ -404,6 +365,45 @@ result = sdk.courier_connection.delete_courier_connections_by_id(
404365
print(result)
405366
```
406367

368+
### /estimated-delivery-date
369+
**POST** /estimated-delivery-date/predict
370+
371+
```python
372+
req = tracking.EstimatedDeliveryDateRequest()
373+
374+
375+
req.slug = 'valid_value'
376+
377+
378+
req.origin_address = tracking.EstimatedDeliveryDateRequestOriginAddress()
379+
380+
381+
req.destination_address = tracking.EstimatedDeliveryDateRequestDestinationAddress()
382+
383+
384+
result = sdk.estimated_delivery_date.predict(
385+
386+
req,
387+
388+
)
389+
print(result)
390+
```
391+
392+
**POST** /estimated-delivery-date/predict-batch
393+
394+
```python
395+
req = tracking.PredictBatchRequest()
396+
397+
398+
399+
result = sdk.estimated_delivery_date.predict_batch(
400+
401+
req,
402+
403+
)
404+
print(result)
405+
```
406+
407407

408408
## Help
409409

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "aftership-tracking-sdk"
3-
version = "8.0.1"
3+
version = "9.0.0"
44
description = "The official AfterShip Tracking Python API library"
55
authors = ["AfterShip <[email protected]>"]
66
license = "MIT"

tracking/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@
1111
from . import exceptions
1212
from .models import *
1313

14-
__version__ = "8.0.1"
14+
__version__ = "9.0.0"

tracking/api/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
# Do not edit the class manually.
55

66
__all__ = [
7-
"EstimatedDeliveryDateApi",
87
"TrackingApi",
98
"CourierApi",
109
"CourierConnectionApi",
10+
"EstimatedDeliveryDateApi",
1111
]
1212

13-
from .estimated_delivery_date import EstimatedDeliveryDateApi
1413
from .tracking import TrackingApi
1514
from .courier import CourierApi
1615
from .courier_connection import CourierConnectionApi
16+
from .estimated_delivery_date import EstimatedDeliveryDateApi

tracking/api/courier.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def get_couriers(self, **kwargs) -> GetCouriersResponse:
3333
**active**: bool. get user activated couriers
3434
**slug**: str. Unique courier code Use comma for multiple values. (Example: dhl,ups,usps)
3535
"""
36-
url = "/tracking/2025-07/couriers"
36+
url = "/tracking/2026-01/couriers"
3737

3838
params_keys = {
3939
"active",
@@ -59,7 +59,7 @@ def detect_courier(
5959
a path to an SSL certificate file, an `ssl.SSLContext`, or `False`
6060
(which will disable verification).
6161
"""
62-
url = "/tracking/2025-07/couriers/detect"
62+
url = "/tracking/2026-01/couriers/detect"
6363

6464
body = detect_courier_request
6565
if not isinstance(body, dict):

tracking/api/courier_connection.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def get_courier_connections(self, **kwargs) -> GetCourierConnectionsResponse:
3939
**cursor**: str. A string representing the cursor value for the current page of results.
4040
**limit**: str. Number of courier connections each page contain. (Default: 100, Max: 200)
4141
"""
42-
url = "/tracking/2025-07/courier-connections"
42+
url = "/tracking/2026-01/courier-connections"
4343

4444
params_keys = {
4545
"courier_slug",
@@ -66,7 +66,7 @@ def post_courier_connections(
6666
a path to an SSL certificate file, an `ssl.SSLContext`, or `False`
6767
(which will disable verification).
6868
"""
69-
url = "/tracking/2025-07/courier-connections"
69+
url = "/tracking/2026-01/courier-connections"
7070

7171
body = post_courier_connections_request
7272
if not isinstance(body, dict):
@@ -91,7 +91,7 @@ def get_courier_connections_by_id(
9191
a path to an SSL certificate file, an `ssl.SSLContext`, or `False`
9292
(which will disable verification).
9393
"""
94-
url = f"/tracking/2025-07/courier-connections/{id}"
94+
url = f"/tracking/2026-01/courier-connections/{id}"
9595

9696
result = self._request("GET", url=url, **kwargs)
9797
return GetCourierConnectionsByIdResponse.model_validate(result)
@@ -115,7 +115,7 @@ def put_courier_connections_by_id(
115115
a path to an SSL certificate file, an `ssl.SSLContext`, or `False`
116116
(which will disable verification).
117117
"""
118-
url = f"/tracking/2025-07/courier-connections/{id}"
118+
url = f"/tracking/2026-01/courier-connections/{id}"
119119

120120
body = put_courier_connections_by_id_request
121121
if not isinstance(body, dict):
@@ -140,7 +140,7 @@ def delete_courier_connections_by_id(
140140
a path to an SSL certificate file, an `ssl.SSLContext`, or `False`
141141
(which will disable verification).
142142
"""
143-
url = f"/tracking/2025-07/courier-connections/{id}"
143+
url = f"/tracking/2026-01/courier-connections/{id}"
144144

145145
result = self._request("DELETE", url=url, **kwargs)
146146
return DeleteCourierConnectionsByIdResponse.model_validate(result)

tracking/api/estimated_delivery_date.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def predict(
3434
a path to an SSL certificate file, an `ssl.SSLContext`, or `False`
3535
(which will disable verification).
3636
"""
37-
url = "/tracking/2025-07/estimated-delivery-date/predict"
37+
url = "/tracking/2026-01/estimated-delivery-date/predict"
3838

3939
body = predict_request
4040
if not isinstance(body, dict):
@@ -59,7 +59,7 @@ def predict_batch(
5959
a path to an SSL certificate file, an `ssl.SSLContext`, or `False`
6060
(which will disable verification).
6161
"""
62-
url = "/tracking/2025-07/estimated-delivery-date/predict-batch"
62+
url = "/tracking/2026-01/estimated-delivery-date/predict-batch"
6363

6464
body = predict_batch_request
6565
if not isinstance(body, dict):

tracking/api/tracking.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def get_trackings(self, **kwargs) -> GetTrackingsResponse:
5757
**shipment_tags**: str. Tags you added to your shipments to help categorize and filter them easily. Use a comma to separate multiple values (Example: a,b)
5858
**order_id**: str. A globally-unique identifier for the order. Use comma for multiple values.(Example: 6845a095a27a4caeb27487806f058add,4845a095a27a4caeb27487806f058abc)
5959
"""
60-
url = "/tracking/2025-07/trackings"
60+
url = "/tracking/2026-01/trackings"
6161

6262
params_keys = {
6363
"cursor",
@@ -99,7 +99,7 @@ def create_tracking(
9999
a path to an SSL certificate file, an `ssl.SSLContext`, or `False`
100100
(which will disable verification).
101101
"""
102-
url = "/tracking/2025-07/trackings"
102+
url = "/tracking/2026-01/trackings"
103103

104104
body = create_tracking_request
105105
if not isinstance(body, dict):
@@ -127,7 +127,7 @@ def get_tracking_by_id(
127127
**fields**: str. List of fields to include in the response. Use comma for multiple values. Fields to include: `destination_postal_code`, `tracking_ship_date`, `tracking_account_number`, `tracking_key`, `origin_country_region`, `destination_country_region`, `destination_state`, `title`, `order_id`, `tag`, `checkpoints`
128128
**lang**: str. Translate checkpoint messages from the carrier’s provided language to the target language. Supported target languages include:&lt;/br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;- English (en)&lt;/br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;- French (fr)&lt;/br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;- French Canadian (fr-CA)&lt;/br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;- Arabic (ar)&lt;/br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;- Bulgarian (bg)&lt;/br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;- Catalan (ca)&lt;/br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;- Croatian (hr)&lt;/br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;- Czech (cs)&lt;/br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;- Danish (da)&lt;/br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;- Dutch (nl)&lt;/br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;- Estonian (et)&lt;/br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;- Filipino (tl)&lt;/br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;- Finnish (fi)&lt;/br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;- German (de)&lt;/br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;- Greek (el)&lt;/br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;- Hebrew (he)&lt;/br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;- Hindi (hi)&lt;/br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;- Hungarian (hu)&lt;/br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;- Indonesian (id)&lt;/br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;- Italian (it)&lt;/br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;- Japanese (ja)&lt;/br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;- Korean (ko)&lt;/br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;- Latvian (lv)&lt;/br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;- Lithuanian (lt)&lt;/br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;- Malay (ms)&lt;/br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;- Polish (pl)&lt;/br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;- Portuguese (pt)&lt;/br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;- Romanian (ro)&lt;/br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;- Russian (ru)&lt;/br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;- Serbian (sr)&lt;/br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;- Slovak (sk)&lt;/br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;- Slovenian (sl)&lt;/br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;- Spanish (es)&lt;/br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;- Swedish (sv)&lt;/br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;- Thai (th)&lt;/br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;- Turkish (tr)&lt;/br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;- Ukrainian (uk)&lt;/br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;- Vietnamese (vi)&lt;/br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;- Simplified Chinese (zh-Hans)&lt;/br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;- Traditional Chinese (zh-Hant)&lt;/br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;- Norwegian (nb)&lt;/br&gt;
129129
"""
130-
url = f"/tracking/2025-07/trackings/{id}"
130+
url = f"/tracking/2026-01/trackings/{id}"
131131

132132
params_keys = {
133133
"fields",
@@ -157,7 +157,7 @@ def update_tracking_by_id(
157157
a path to an SSL certificate file, an `ssl.SSLContext`, or `False`
158158
(which will disable verification).
159159
"""
160-
url = f"/tracking/2025-07/trackings/{id}"
160+
url = f"/tracking/2026-01/trackings/{id}"
161161

162162
body = update_tracking_by_id_request
163163
if not isinstance(body, dict):
@@ -182,7 +182,7 @@ def delete_tracking_by_id(
182182
a path to an SSL certificate file, an `ssl.SSLContext`, or `False`
183183
(which will disable verification).
184184
"""
185-
url = f"/tracking/2025-07/trackings/{id}"
185+
url = f"/tracking/2026-01/trackings/{id}"
186186

187187
result = self._request("DELETE", url=url, **kwargs)
188188
return DeleteTrackingByIdResponse.model_validate(result)
@@ -202,7 +202,7 @@ def retrack_tracking_by_id(
202202
a path to an SSL certificate file, an `ssl.SSLContext`, or `False`
203203
(which will disable verification).
204204
"""
205-
url = f"/tracking/2025-07/trackings/{id}/retrack"
205+
url = f"/tracking/2026-01/trackings/{id}/retrack"
206206

207207
result = self._request("POST", url=url, **kwargs)
208208
return RetrackTrackingByIdResponse.model_validate(result)
@@ -226,7 +226,7 @@ def mark_tracking_completed_by_id(
226226
a path to an SSL certificate file, an `ssl.SSLContext`, or `False`
227227
(which will disable verification).
228228
"""
229-
url = f"/tracking/2025-07/trackings/{id}/mark-as-completed"
229+
url = f"/tracking/2026-01/trackings/{id}/mark-as-completed"
230230

231231
body = mark_tracking_completed_by_id_request
232232
if not isinstance(body, dict):

tracking/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@
88
from typing import Optional
99

1010
from .configuration import Configuration
11-
from .api import EstimatedDeliveryDateApi
1211
from .api import TrackingApi
1312
from .api import CourierApi
1413
from .api import CourierConnectionApi
14+
from .api import EstimatedDeliveryDateApi
1515

1616

1717
class Client:
1818
def __init__(self, configuration: Optional[Configuration] = None) -> None:
1919
if configuration is None:
2020
configuration = Configuration()
2121

22-
self.estimated_delivery_date = EstimatedDeliveryDateApi(configuration)
2322
self.tracking = TrackingApi(configuration)
2423
self.courier = CourierApi(configuration)
2524
self.courier_connection = CourierConnectionApi(configuration)
25+
self.estimated_delivery_date = EstimatedDeliveryDateApi(configuration)

tracking/models/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"Meta",
1212
"TrackingCourierEstimatedDeliveryDate",
1313
"TrackingShipmentWeight",
14+
"TrackingOrderPromisedDeliveryDate",
1415
"TrackingAftershipEstimatedDeliveryDate",
1516
"TrackingCustomEstimatedDeliveryDateType",
1617
"TrackingCustomEstimatedDeliveryDate",
@@ -59,12 +60,14 @@
5960
"GetTrackingsResponseData",
6061
"GetTrackingsResponseDataPagination",
6162
"GetTrackingsResponse",
63+
"CreateTrackingRequestOrderPromisedDeliveryDate",
6264
"CreateTrackingRequestDeliveryType",
6365
"CreateTrackingRequestLastMile",
6466
"CreateTrackingRequestCustomers",
6567
"CreateTrackingRequest",
6668
"CreateTrackingResponse",
6769
"GetTrackingByIdResponse",
70+
"UpdateTrackingByIdRequestOrderPromisedDeliveryDate",
6871
"UpdateTrackingByIdRequestDeliveryType",
6972
"UpdateTrackingByIdRequestCustomers",
7073
"UpdateTrackingByIdRequest",
@@ -103,6 +106,7 @@
103106
from .meta import Meta
104107
from .tracking_courier_estimated_delivery_date import TrackingCourierEstimatedDeliveryDate
105108
from .tracking_shipment_weight import TrackingShipmentWeight
109+
from .tracking_order_promised_delivery_date import TrackingOrderPromisedDeliveryDate
106110
from .tracking_aftership_estimated_delivery_date import TrackingAftershipEstimatedDeliveryDate
107111
from .tracking_custom_estimated_delivery_date_type import TrackingCustomEstimatedDeliveryDateType
108112
from .tracking_custom_estimated_delivery_date import TrackingCustomEstimatedDeliveryDate
@@ -173,12 +177,18 @@
173177
from .get_trackings_response_data import GetTrackingsResponseData
174178
from .get_trackings_response_data_pagination import GetTrackingsResponseDataPagination
175179
from .get_trackings_response import GetTrackingsResponse
180+
from .create_tracking_request_order_promised_delivery_date import (
181+
CreateTrackingRequestOrderPromisedDeliveryDate,
182+
)
176183
from .create_tracking_request_delivery_type import CreateTrackingRequestDeliveryType
177184
from .create_tracking_request_last_mile import CreateTrackingRequestLastMile
178185
from .create_tracking_request_customers import CreateTrackingRequestCustomers
179186
from .create_tracking_request import CreateTrackingRequest
180187
from .create_tracking_response import CreateTrackingResponse
181188
from .get_tracking_by_id_response import GetTrackingByIdResponse
189+
from .update_tracking_by_id_request_order_promised_delivery_date import (
190+
UpdateTrackingByIdRequestOrderPromisedDeliveryDate,
191+
)
182192
from .update_tracking_by_id_request_delivery_type import UpdateTrackingByIdRequestDeliveryType
183193
from .update_tracking_by_id_request_customers import UpdateTrackingByIdRequestCustomers
184194
from .update_tracking_by_id_request import UpdateTrackingByIdRequest

0 commit comments

Comments
 (0)