forked from AfterShip/aftership-sdk-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
estimated_delivery_date_example.py
52 lines (48 loc) · 1.64 KB
/
estimated_delivery_date_example.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import aftership
aftership.api_key = 'PUT_YOUR_AFTERSHIP_KEY_HERE'
def batch_predict_estimated_delivery_date():
result = aftership.estimated_delivery_date.batch_predict_estimated_delivery_date(
[
{
"slug": "fedex",
"service_type_name": "FEDEX HOME DELIVERY",
"origin_address": {
"country": "USA",
"state": "WA",
"postal_code": "98108",
"raw_location": "Seattle, Washington, 98108, USA, United States"
},
"destination_address": {
"country": "USA",
"state": "CA",
"postal_code": "92019",
"raw_location": "El Cajon, California, 92019, USA, United States"
},
"weight": {
"unit": "kg",
"value": 8
},
"estimated_pickup": {
"order_time": "2021-07-01 15:04:05",
"order_cutoff_time": "20:00:00",
"business_days": [
1,
2,
3,
4,
5,
6,
7
],
"order_processing_time": {
"unit": "day",
"value": 0
}
}
}
]
)
return result['estimated_delivery_dates']
if __name__ == '__main__':
list = batch_predict_estimated_delivery_date()
print(list)