2
2
3
3
This library allows you to quickly and easily use the AfterShip Tracking API via Python.
4
4
5
- For updates to this library, see our GitHub release page.
5
+ For updates to this library, see our [ GitHub release page] ( https://github.com/AfterShip/tracking-sdk-python/releases ) .
6
6
7
7
If you need support using AfterShip products, please contact support@aftership.com .
8
8
@@ -24,6 +24,7 @@ If you need support using AfterShip products, please contact support@aftership.c
24
24
- [ /couriers] ( #couriers )
25
25
- [ /last\_ checkpoint] ( #last_checkpoint )
26
26
- [ /notifications] ( #notifications )
27
+ - [ /estimated-delivery-date] ( #estimated-delivery-date )
27
28
- [ Help] ( #help )
28
29
- [ License] ( #license )
29
30
@@ -83,7 +84,7 @@ Create AfterShip instance with options
83
84
84
85
### Example
85
86
86
- ``` javascript
87
+ ``` python
87
88
import tracking
88
89
89
90
sdk = tracking.Client(
@@ -143,10 +144,11 @@ The SDK will return an error object when there is any error during the request,
143
144
144
145
The AfterShip instance has the following properties which are exactly the same as the API endpoints:
145
146
146
- courier - Get a list of our supported couriers.
147
- tracking - Create trackings, update trackings, and get tracking results.
148
- last_checkpoint - Get tracking information of the last checkpoint of a tracking.
149
- notification - Get, add or remove contacts (sms or email) to be notified when the status of a tracking has changed.
147
+ - courier - Get a list of our supported couriers.
148
+ - tracking - Create trackings, update trackings, and get tracking results.
149
+ - last_checkpoint - Get tracking information of the last checkpoint of a tracking.
150
+ - notification - Get, add or remove contacts (sms or email) to be notified when the status of a tracking has changed.
151
+ - estimated-delivery-date - Get estimated delivery date for your order.
150
152
151
153
152
154
### /trackings
@@ -194,20 +196,6 @@ result = sdk.tracking.get_tracking_by_id("rft4xu2rs1um1lwhm8j1p02r")
194
196
print (result)
195
197
```
196
198
197
- ``` python
198
- # GET /trackings/:slug/:tracking_number?tracking_postal_code=:postal_code&tracking_ship_date=:ship_date
199
- result = sdk.tracking.get_tracking_by_slug_tracking_number(slug = " usps" , tracking_number = " 9434609105464265845274" )
200
- print (result)
201
- ```
202
-
203
-
204
- > Pro Tip: You can always use /: id to replace /: slug /: tracking_number .
205
- ``` python
206
- # GET /trackings/:id
207
- result = sdk.tracking.get_tracking_by_id(" rft4xu2rs1um1lwhm8j1p02r" )
208
- print (result)
209
- ```
210
-
211
199
** PUT** /trackings/: id
212
200
213
201
``` python
@@ -293,6 +281,19 @@ result = sdk.notification.delete_notification_by_tracking_id("kponlnb1w64fmlxlak
293
281
print (result)
294
282
```
295
283
284
+ ### /estimated-delivery-date
285
+
286
+ ** POST** /estimated-delivery-date/predict-batch
287
+
288
+ ``` python
289
+ req = tracking.PredictBatchRequest()
290
+ date = tracking.EstimatedDeliveryDateRequest()
291
+ date.slug = ' usps'
292
+ req.estimated_delivery_dates = [date]
293
+ result = sdk.estimated_delivery_date.predict_batch(req)
294
+ print (result)
295
+ ```
296
+
296
297
## Help
297
298
298
299
If you get stuck, we're here to help:
0 commit comments