python-amazon-sp-api 1.9.39__py3-none-any.whl → 2.0.10__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {python_amazon_sp_api-1.9.39.dist-info → python_amazon_sp_api-2.0.10.dist-info}/METADATA +44 -8
- python_amazon_sp_api-2.0.10.dist-info/RECORD +253 -0
- {python_amazon_sp_api-1.9.39.dist-info → python_amazon_sp_api-2.0.10.dist-info}/WHEEL +1 -1
- {python_amazon_sp_api-1.9.39.dist-info → python_amazon_sp_api-2.0.10.dist-info}/top_level.txt +0 -1
- sp_api/__version__.py +1 -1
- sp_api/api/__init__.py +9 -3
- sp_api/api/application_integrations/application_integrations.py +2 -2
- sp_api/api/catalog/catalog.py +3 -4
- sp_api/api/catalog_items/catalog_items.py +3 -6
- sp_api/api/customer_feedback/customer_feedback.py +110 -0
- sp_api/api/data_kiosk/data_kiosk.py +5 -6
- sp_api/api/easy_ship/easy_ship.py +5 -5
- sp_api/api/external_fulfillment/external_fulfillment.py +706 -0
- sp_api/api/feeds/feeds.py +11 -8
- sp_api/api/fulfillment_inbound/fulfillment_inbound.py +35 -2
- sp_api/api/inventories/inventories.py +2 -7
- sp_api/api/listings_items/listings_items.py +3 -24
- sp_api/api/messaging/messaging.py +42 -0
- sp_api/api/orders/orders.py +59 -3
- sp_api/api/orders/orders_2026_01_01.py +54 -0
- sp_api/api/product_fees/product_fees.py +31 -74
- sp_api/api/products/products.py +3 -1
- sp_api/api/products/products_definitions.py +11 -169
- sp_api/api/reports/reports.py +61 -96
- sp_api/api/sales/sales.py +2 -2
- sp_api/asyncio/api/__init__.py +167 -0
- sp_api/asyncio/api/amazon_warehousing_and_distribu/__init__.py +9 -0
- sp_api/asyncio/api/amazon_warehousing_and_distribu/amazon_warehousing_and_distribu.py +130 -0
- sp_api/asyncio/api/aplus_content/__init__.py +5 -0
- sp_api/asyncio/api/aplus_content/aplus_content.py +330 -0
- sp_api/asyncio/api/application_integrations/__init__.py +5 -0
- sp_api/asyncio/api/application_integrations/application_integrations.py +119 -0
- sp_api/asyncio/api/application_management/__init__.py +5 -0
- sp_api/asyncio/api/application_management/application_management.py +36 -0
- sp_api/asyncio/api/authorization/__init__.py +5 -0
- sp_api/asyncio/api/authorization/authorization.py +54 -0
- sp_api/asyncio/api/catalog/__init__.py +5 -0
- sp_api/asyncio/api/catalog/catalog.py +111 -0
- sp_api/asyncio/api/catalog_items/__init__.py +6 -0
- sp_api/asyncio/api/catalog_items/catalog_items.py +93 -0
- sp_api/asyncio/api/clients/__init__.py +1 -0
- sp_api/asyncio/api/customer_feedback/__init__.py +5 -0
- sp_api/asyncio/api/customer_feedback/customer_feedback.py +111 -0
- sp_api/asyncio/api/data_kiosk/__init__.py +5 -0
- sp_api/asyncio/api/data_kiosk/data_kiosk.py +236 -0
- sp_api/asyncio/api/easy_ship/__init__.py +5 -0
- sp_api/asyncio/api/easy_ship/easy_ship.py +191 -0
- sp_api/asyncio/api/external_fulfillment/__init__.py +5 -0
- sp_api/asyncio/api/external_fulfillment/external_fulfillment.py +706 -0
- sp_api/asyncio/api/fba_inbound_eligibility/__init__.py +5 -0
- sp_api/asyncio/api/fba_inbound_eligibility/fba_inbound_eligibility.py +96 -0
- sp_api/asyncio/api/fba_small_and_light/__init__.py +5 -0
- sp_api/asyncio/api/fba_small_and_light/fba_small_and_light.py +213 -0
- sp_api/asyncio/api/feeds/feeds.py +260 -0
- sp_api/asyncio/api/finances/finances.py +100 -0
- sp_api/asyncio/api/fulfillment_inbound/fulfillment_inbound.py +1798 -0
- sp_api/asyncio/api/fulfillment_outbound/fulfillment_outbound.py +736 -0
- sp_api/asyncio/api/inventories/inventories.py +74 -0
- sp_api/asyncio/api/listings_items/listings_items.py +170 -0
- sp_api/asyncio/api/listings_restrictions/listings_restrictions.py +36 -0
- sp_api/asyncio/api/merchant_fulfillment/__init__.py +0 -0
- sp_api/asyncio/api/merchant_fulfillment/merchant_fulfillment.py +384 -0
- sp_api/asyncio/api/messaging/__init__.py +0 -0
- sp_api/asyncio/api/messaging/messaging.py +511 -0
- sp_api/asyncio/api/models/__init__.py +4 -0
- sp_api/asyncio/api/notifications/__init__.py +0 -0
- sp_api/asyncio/api/notifications/notifications.py +295 -0
- sp_api/asyncio/api/orders/__init__.py +0 -0
- sp_api/asyncio/api/orders/orders.py +412 -0
- sp_api/asyncio/api/orders/orders_2026_01_01.py +40 -0
- sp_api/asyncio/api/overrides/__init__.py +1 -0
- sp_api/asyncio/api/product_fees/__init__.py +0 -0
- sp_api/asyncio/api/product_fees/product_fees.py +194 -0
- sp_api/asyncio/api/product_type_definitions/__init__.py +0 -0
- sp_api/asyncio/api/product_type_definitions/product_type_definitions.py +75 -0
- sp_api/asyncio/api/products/__init__.py +0 -0
- sp_api/asyncio/api/products/products.py +405 -0
- sp_api/asyncio/api/products/products_definitions.py +11 -0
- sp_api/asyncio/api/replenishment/__init__.py +0 -0
- sp_api/asyncio/api/replenishment/replenishment.py +121 -0
- sp_api/asyncio/api/reports/__init__.py +0 -0
- sp_api/asyncio/api/reports/reports.py +439 -0
- sp_api/asyncio/api/sales/__init__.py +0 -0
- sp_api/asyncio/api/sales/sales.py +93 -0
- sp_api/asyncio/api/sellers/__init__.py +0 -0
- sp_api/asyncio/api/sellers/sellers.py +70 -0
- sp_api/asyncio/api/services/__init__.py +0 -0
- sp_api/asyncio/api/services/services.py +218 -0
- sp_api/asyncio/api/shipping/__init__.py +0 -0
- sp_api/asyncio/api/shipping/shipping.py +459 -0
- sp_api/asyncio/api/shipping/shippingV2.py +651 -0
- sp_api/asyncio/api/solicitations/__init__.py +0 -0
- sp_api/asyncio/api/solicitations/solicitations.py +78 -0
- sp_api/asyncio/api/supply_sources/__init__.py +0 -0
- sp_api/asyncio/api/supply_sources/supply_sources.py +138 -0
- sp_api/asyncio/api/tokens/__init__.py +0 -0
- sp_api/asyncio/api/tokens/tokens.py +65 -0
- sp_api/asyncio/api/upload/__init__.py +0 -0
- sp_api/asyncio/api/upload/upload.py +18 -0
- sp_api/asyncio/api/vendor_direct_fulfillment_inventory/__init__.py +0 -0
- sp_api/asyncio/api/vendor_direct_fulfillment_inventory/vendor_direct_fulfillment_inventory.py +64 -0
- sp_api/asyncio/api/vendor_direct_fulfillment_orders/__init__.py +0 -0
- sp_api/asyncio/api/vendor_direct_fulfillment_orders/vendor_direct_fulfillment_orders.py +196 -0
- sp_api/asyncio/api/vendor_direct_fulfillment_payments/__init__.py +0 -0
- sp_api/asyncio/api/vendor_direct_fulfillment_payments/vendor_direct_fulfillment_payments.py +254 -0
- sp_api/asyncio/api/vendor_direct_fulfillment_shipping/__init__.py +0 -0
- sp_api/asyncio/api/vendor_direct_fulfillment_shipping/vendor_direct_fulfillment_shipping.py +627 -0
- sp_api/asyncio/api/vendor_direct_fulfillment_transactions/__init__.py +0 -0
- sp_api/asyncio/api/vendor_direct_fulfillment_transactions/vendor_direct_fulfillment_transactions.py +43 -0
- sp_api/asyncio/api/vendor_invoices/__init__.py +0 -0
- sp_api/asyncio/api/vendor_invoices/vendor_invoices.py +295 -0
- sp_api/asyncio/api/vendor_orders/__init__.py +0 -0
- sp_api/asyncio/api/vendor_orders/vendor_orders.py +210 -0
- sp_api/asyncio/api/vendor_shipments/__init__.py +0 -0
- sp_api/asyncio/api/vendor_shipments/vendor_shipments.py +118 -0
- sp_api/asyncio/api/vendor_transaction_status/__init__.py +0 -0
- sp_api/asyncio/api/vendor_transaction_status/vendor_transaction_status.py +41 -0
- sp_api/asyncio/auth/__init__.py +12 -0
- sp_api/asyncio/auth/access_token_client.py +145 -0
- sp_api/asyncio/auth/exceptions.py +5 -0
- sp_api/asyncio/base/__init__.py +53 -0
- sp_api/asyncio/base/_transport_httpx.py +50 -0
- sp_api/asyncio/base/base_client.py +8 -0
- sp_api/asyncio/base/client.py +169 -0
- sp_api/asyncio/util/__init__.py +29 -0
- sp_api/asyncio/util/key_maker.py +5 -0
- sp_api/asyncio/util/load_all_pages.py +55 -0
- sp_api/asyncio/util/load_date_bound.py +53 -0
- sp_api/asyncio/util/retry.py +88 -0
- sp_api/auth/_core.py +39 -0
- sp_api/auth/access_token_client.py +18 -29
- sp_api/base/ApiResponse.py +2 -2
- sp_api/base/_core.py +110 -0
- sp_api/base/_transport_httpx.py +39 -0
- sp_api/base/client.py +40 -63
- sp_api/base/helpers.py +1 -1
- sp_api/util/__init__.py +36 -0
- sp_api/util/params.py +57 -0
- sp_api/util/product_fees.py +40 -0
- sp_api/util/products_definitions.py +169 -0
- sp_api/util/report_document.py +154 -0
- python_amazon_sp_api-1.9.39.dist-info/RECORD +0 -148
- tests/api/finances/test_finances.py +0 -19
- tests/api/notifications/test_notifications.py +0 -26
- tests/api/orders/test_orders.py +0 -122
- tests/api/product_fees/product_fees.py +0 -49
- tests/api/reports/test_reports.py +0 -127
- tests/client/test_auth.py +0 -59
- tests/client/test_base.py +0 -163
- tests/client/test_credential_provider.py +0 -45
- tests/client/test_helpers.py +0 -142
- {python_amazon_sp_api-1.9.39.data → python_amazon_sp_api-2.0.10.data}/scripts/make_endpoint +0 -0
- {python_amazon_sp_api-1.9.39.dist-info → python_amazon_sp_api-2.0.10.dist-info}/licenses/LICENSE +0 -0
- {tests → sp_api/api/customer_feedback}/__init__.py +0 -0
- {tests/api → sp_api/api/external_fulfillment}/__init__.py +0 -0
- {tests/api/finances → sp_api/asyncio}/__init__.py +0 -0
- {tests/api/notifications → sp_api/asyncio/api/feeds}/__init__.py +0 -0
- {tests/api/orders → sp_api/asyncio/api/finances}/__init__.py +0 -0
- {tests/api/product_fees → sp_api/asyncio/api/fulfillment_inbound}/__init__.py +0 -0
- {tests/api/reports → sp_api/asyncio/api/fulfillment_outbound}/__init__.py +0 -0
- {tests/api/sellers → sp_api/asyncio/api/inventories}/__init__.py +0 -0
- {tests/client → sp_api/asyncio/api/listings_items}/__init__.py +0 -0
- /tests/api/sellers/test_sellers.py → /sp_api/asyncio/api/listings_restrictions/__init__.py +0 -0
|
@@ -0,0 +1,651 @@
|
|
|
1
|
+
import enum
|
|
2
|
+
import os
|
|
3
|
+
import urllib.parse
|
|
4
|
+
from datetime import datetime
|
|
5
|
+
|
|
6
|
+
from sp_api.base import (
|
|
7
|
+
Client,
|
|
8
|
+
sp_endpoint,
|
|
9
|
+
fill_query_params,
|
|
10
|
+
ApiResponse,
|
|
11
|
+
Marketplaces,
|
|
12
|
+
)
|
|
13
|
+
from sp_api.asyncio.base import AsyncBaseClient
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class AmznShippingBusiness(str, enum.Enum):
|
|
17
|
+
US = "AmazonShipping_US"
|
|
18
|
+
IN = "AmazonShipping_IN"
|
|
19
|
+
UK = "AmazonShipping_UK"
|
|
20
|
+
AE = "AmazonShipping_UAE"
|
|
21
|
+
SA = "AmazonShipping_SA"
|
|
22
|
+
IT = "AmazonShipping_IT"
|
|
23
|
+
EG = "AmazonShipping_EG"
|
|
24
|
+
ES = "AmazonShipping_ES"
|
|
25
|
+
FR = "AmazonShipping_FR"
|
|
26
|
+
JP = "AmazonShipping_JP"
|
|
27
|
+
|
|
28
|
+
@classmethod
|
|
29
|
+
def has_key(cls, name):
|
|
30
|
+
return name in cls.__members__
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class Shipping(AsyncBaseClient):
|
|
34
|
+
"""
|
|
35
|
+
Shipping V2 SP-API Client
|
|
36
|
+
:link:
|
|
37
|
+
|
|
38
|
+
Provides programmatic access to Amazon Shipping APIs.
|
|
39
|
+
"""
|
|
40
|
+
|
|
41
|
+
amzn_shipping_business: AmznShippingBusiness = AmznShippingBusiness.US
|
|
42
|
+
|
|
43
|
+
def __init__(self, *args, **kwargs):
|
|
44
|
+
if "amzn_shipping_business" in kwargs:
|
|
45
|
+
self.amzn_shipping_business = kwargs.pop(
|
|
46
|
+
"amzn_shipping_business", AmznShippingBusiness.US
|
|
47
|
+
)
|
|
48
|
+
else:
|
|
49
|
+
marketplace = args[0] if len(args) > 0 else Marketplaces.US
|
|
50
|
+
if os.environ.get("SP_API_DEFAULT_MARKETPLACE", None):
|
|
51
|
+
marketplace = Marketplaces[os.environ.get("SP_API_DEFAULT_MARKETPLACE")]
|
|
52
|
+
|
|
53
|
+
if AmznShippingBusiness.has_key(marketplace.name):
|
|
54
|
+
self.amzn_shipping_business = AmznShippingBusiness[marketplace.name]
|
|
55
|
+
|
|
56
|
+
super().__init__(*args, **kwargs)
|
|
57
|
+
|
|
58
|
+
async def _get_headers(self, access_token=None):
|
|
59
|
+
headers = await super()._get_headers(access_token=access_token)
|
|
60
|
+
headers["x-amzn-shipping-business-id"] = self.amzn_shipping_business.value
|
|
61
|
+
return headers
|
|
62
|
+
|
|
63
|
+
@sp_endpoint("/shipping/v2/shipments/rates", method="POST")
|
|
64
|
+
async def get_rates(self, **kwargs) -> ApiResponse:
|
|
65
|
+
"""
|
|
66
|
+
get_rates(self, **kwargs) -> ApiResponse
|
|
67
|
+
|
|
68
|
+
Returns the available shipping service offerings.
|
|
69
|
+
|
|
70
|
+
**Usage Plan:**
|
|
71
|
+
|
|
72
|
+
======================================
|
|
73
|
+
Rate (requests per second)
|
|
74
|
+
======================================
|
|
75
|
+
5
|
|
76
|
+
======================================
|
|
77
|
+
|
|
78
|
+
For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
|
|
79
|
+
|
|
80
|
+
Args:
|
|
81
|
+
body: {
|
|
82
|
+
"shipTo": {
|
|
83
|
+
"name": "string",
|
|
84
|
+
"addressLine1": "string",
|
|
85
|
+
"addressLine2": "string",
|
|
86
|
+
"addressLine3": "string",
|
|
87
|
+
"companyName": "string",
|
|
88
|
+
"stateOrRegion": "string",
|
|
89
|
+
"city": "string",
|
|
90
|
+
"countryCode": "st",
|
|
91
|
+
"postalCode": "string",
|
|
92
|
+
"email": "string",
|
|
93
|
+
"phoneNumber": "string",
|
|
94
|
+
"geocode": {
|
|
95
|
+
"latitude": "string",
|
|
96
|
+
"longitude": "string"
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
"shipFrom": {
|
|
100
|
+
"name": "string",
|
|
101
|
+
"addressLine1": "string",
|
|
102
|
+
"addressLine2": "string",
|
|
103
|
+
"addressLine3": "string",
|
|
104
|
+
"companyName": "string",
|
|
105
|
+
"stateOrRegion": "string",
|
|
106
|
+
"city": "string",
|
|
107
|
+
"countryCode": "st",
|
|
108
|
+
"postalCode": "string",
|
|
109
|
+
"email": "string",
|
|
110
|
+
"phoneNumber": "string",
|
|
111
|
+
"geocode": {
|
|
112
|
+
"latitude": "string",
|
|
113
|
+
"longitude": "string"
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
"returnTo": {
|
|
117
|
+
"name": "string",
|
|
118
|
+
"addressLine1": "string",
|
|
119
|
+
"addressLine2": "string",
|
|
120
|
+
"addressLine3": "string",
|
|
121
|
+
"companyName": "string",
|
|
122
|
+
"stateOrRegion": "string",
|
|
123
|
+
"city": "string",
|
|
124
|
+
"countryCode": "st",
|
|
125
|
+
"postalCode": "string",
|
|
126
|
+
"email": "string",
|
|
127
|
+
"phoneNumber": "string",
|
|
128
|
+
"geocode": {
|
|
129
|
+
"latitude": "string",
|
|
130
|
+
"longitude": "string"
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
"shipDate": "2019-08-24T14:15:22Z",
|
|
134
|
+
"shipperInstruction": {
|
|
135
|
+
"deliveryNotes": "string"
|
|
136
|
+
},
|
|
137
|
+
"packages": [
|
|
138
|
+
{
|
|
139
|
+
"dimensions": {
|
|
140
|
+
"length": 0,
|
|
141
|
+
"width": 0,
|
|
142
|
+
"height": 0,
|
|
143
|
+
"unit": "CENTIMETER"
|
|
144
|
+
},
|
|
145
|
+
"weight": {
|
|
146
|
+
"unit": "KILOGRAM",
|
|
147
|
+
"value": 0
|
|
148
|
+
},
|
|
149
|
+
"insuredValue":{
|
|
150
|
+
"value": 0.00,
|
|
151
|
+
"unit": "EUR",
|
|
152
|
+
},
|
|
153
|
+
"isHazmat": False,
|
|
154
|
+
"sellerDisplayName": "string",
|
|
155
|
+
"charges": [
|
|
156
|
+
{
|
|
157
|
+
"amount": {
|
|
158
|
+
"value": 0.00,
|
|
159
|
+
"unit": "EUR",
|
|
160
|
+
},
|
|
161
|
+
"chargeType": "TAX"
|
|
162
|
+
}
|
|
163
|
+
],
|
|
164
|
+
"packageClientReferenceId": "string",
|
|
165
|
+
"items": [
|
|
166
|
+
{
|
|
167
|
+
"itemValue": {
|
|
168
|
+
"value": 0.00,
|
|
169
|
+
"unit": "EUR",
|
|
170
|
+
},
|
|
171
|
+
"description": "string",
|
|
172
|
+
"itemIdentifier": "string",
|
|
173
|
+
"quantity": 1,
|
|
174
|
+
"weight": {
|
|
175
|
+
"value": 0.00,
|
|
176
|
+
"unit": "KILOGRAM",
|
|
177
|
+
},
|
|
178
|
+
"liquidVolume": {
|
|
179
|
+
"value": 0.00,
|
|
180
|
+
"unit": "ML",
|
|
181
|
+
},
|
|
182
|
+
"isHazmat": False,
|
|
183
|
+
"dangerousGoodsDetails": {
|
|
184
|
+
"unitedNationsRegulatoryId": "string",
|
|
185
|
+
"transportationRegulatoryClass": "string",
|
|
186
|
+
"packingGroup": "III",
|
|
187
|
+
"packingInstruction": "PI965_SECTION_IA",
|
|
188
|
+
},
|
|
189
|
+
"productType": "string",
|
|
190
|
+
"invoiceDetails": {
|
|
191
|
+
"invoiceNumber": "string",
|
|
192
|
+
"invoiceDate": "2019-08-24T14:15:22Z"
|
|
193
|
+
},
|
|
194
|
+
"serialNumbers": ["string"],
|
|
195
|
+
"directFulfillmentItemIdentifiers": {
|
|
196
|
+
"lineItemID": "string",
|
|
197
|
+
"pieceNumber": "string"
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
]
|
|
201
|
+
}
|
|
202
|
+
],
|
|
203
|
+
"valueAddedServicesDetails": {
|
|
204
|
+
"collectOnDelivery": {
|
|
205
|
+
"amount": {
|
|
206
|
+
"value": 0.00,
|
|
207
|
+
"unit": "EUR",
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
"taxDetails": [
|
|
212
|
+
{
|
|
213
|
+
"taxType": "GST",
|
|
214
|
+
"taxRegistrationNumber": "string"
|
|
215
|
+
}
|
|
216
|
+
],
|
|
217
|
+
"channelDetails": {
|
|
218
|
+
"channelType": "EXTERNAL",
|
|
219
|
+
"amazonOrderDetails": {
|
|
220
|
+
"orderId": "string"
|
|
221
|
+
},
|
|
222
|
+
"amazonShipmentDetails": {
|
|
223
|
+
"shipmentId": "string"
|
|
224
|
+
}
|
|
225
|
+
},
|
|
226
|
+
"clientReferenceDetails": [
|
|
227
|
+
{
|
|
228
|
+
"clientReferenceType": "IntegratorShipperId",
|
|
229
|
+
"clientReferenceId": "string"
|
|
230
|
+
}
|
|
231
|
+
],
|
|
232
|
+
"shipmentType": "FORWARD",
|
|
233
|
+
"destinationAccessPointDetails": {
|
|
234
|
+
"accessPointId": "string",
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
Returns:
|
|
239
|
+
ApiResponse:
|
|
240
|
+
"""
|
|
241
|
+
|
|
242
|
+
return await self._request(kwargs.pop("path"), data=kwargs, add_marketplace=False)
|
|
243
|
+
|
|
244
|
+
@sp_endpoint("/shipping/v2/shipments", method="POST")
|
|
245
|
+
async def purchase_shipment(self, **kwargs) -> ApiResponse:
|
|
246
|
+
"""
|
|
247
|
+
purchase_shipment(self, **kwargs) -> ApiResponse
|
|
248
|
+
|
|
249
|
+
Purchases a shipping service and returns purchase related details and documents.
|
|
250
|
+
|
|
251
|
+
Note: You must complete the purchase within 10 minutes of rate creation by the shipping service provider for channelType as EXTERNAL which is for OFF-Amazon volume. If you make the request after the 10 minutes have expired, you will receive an error response with the error code equal to "TOKEN_EXPIRED". If you receive this error response, you must get the rates for the shipment again.
|
|
252
|
+
|
|
253
|
+
**Usage Plan:**
|
|
254
|
+
|
|
255
|
+
======================================
|
|
256
|
+
Rate (requests per second)
|
|
257
|
+
======================================
|
|
258
|
+
5
|
|
259
|
+
======================================
|
|
260
|
+
|
|
261
|
+
For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
|
|
262
|
+
|
|
263
|
+
Args:
|
|
264
|
+
body: {
|
|
265
|
+
"requestToken": "string",
|
|
266
|
+
"rateId": "string",
|
|
267
|
+
"requestedDocumentSpecification": {
|
|
268
|
+
"format": "ZPL",
|
|
269
|
+
"size": {
|
|
270
|
+
"width": 4,
|
|
271
|
+
"length": 6,
|
|
272
|
+
"unit": "INCH"
|
|
273
|
+
},
|
|
274
|
+
"dpi": 203,
|
|
275
|
+
"pageLayout": "DEFAULT",
|
|
276
|
+
"needFileJoining": False,
|
|
277
|
+
"requestedDocumentTypes": ["LABEL"]
|
|
278
|
+
},
|
|
279
|
+
"requestedValueAddedServices": [
|
|
280
|
+
{
|
|
281
|
+
"id": "string"
|
|
282
|
+
}
|
|
283
|
+
],
|
|
284
|
+
"additionalInputs": {}
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
Returns:
|
|
288
|
+
ApiResponse:
|
|
289
|
+
"""
|
|
290
|
+
return await self._request(kwargs.pop("path"), data=kwargs, add_marketplace=False)
|
|
291
|
+
|
|
292
|
+
@sp_endpoint("/shipping/v2/oneClickShipment", method="POST")
|
|
293
|
+
async def one_click_shipment(self, **kwargs) -> ApiResponse:
|
|
294
|
+
"""
|
|
295
|
+
one_click_shipment(self, **kwargs) -> ApiResponse
|
|
296
|
+
|
|
297
|
+
Purchases a shipping service identifier and returns purchase-related details and documents.
|
|
298
|
+
|
|
299
|
+
**Usage Plan:**
|
|
300
|
+
|
|
301
|
+
======================================
|
|
302
|
+
Rate (requests per second)
|
|
303
|
+
======================================
|
|
304
|
+
5
|
|
305
|
+
======================================
|
|
306
|
+
|
|
307
|
+
For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
|
|
308
|
+
|
|
309
|
+
Args:
|
|
310
|
+
body: {
|
|
311
|
+
"shipTo": {
|
|
312
|
+
"name": "string",
|
|
313
|
+
"addressLine1": "string",
|
|
314
|
+
"addressLine2": "string",
|
|
315
|
+
"addressLine3": "string",
|
|
316
|
+
"companyName": "string",
|
|
317
|
+
"stateOrRegion": "string",
|
|
318
|
+
"city": "string",
|
|
319
|
+
"countryCode": "st",
|
|
320
|
+
"postalCode": "string",
|
|
321
|
+
"email": "string",
|
|
322
|
+
"phoneNumber": "string",
|
|
323
|
+
"geocode": {
|
|
324
|
+
"latitude": "string",
|
|
325
|
+
"longitude": "string"
|
|
326
|
+
}
|
|
327
|
+
},
|
|
328
|
+
"shipFrom": {
|
|
329
|
+
"name": "string",
|
|
330
|
+
"addressLine1": "string",
|
|
331
|
+
"addressLine2": "string",
|
|
332
|
+
"addressLine3": "string",
|
|
333
|
+
"companyName": "string",
|
|
334
|
+
"stateOrRegion": "string",
|
|
335
|
+
"city": "string",
|
|
336
|
+
"countryCode": "st",
|
|
337
|
+
"postalCode": "string",
|
|
338
|
+
"email": "string",
|
|
339
|
+
"phoneNumber": "string",
|
|
340
|
+
"geocode": {
|
|
341
|
+
"latitude": "string",
|
|
342
|
+
"longitude": "string"
|
|
343
|
+
}
|
|
344
|
+
},
|
|
345
|
+
"returnTo": {
|
|
346
|
+
"name": "string",
|
|
347
|
+
"addressLine1": "string",
|
|
348
|
+
"addressLine2": "string",
|
|
349
|
+
"addressLine3": "string",
|
|
350
|
+
"companyName": "string",
|
|
351
|
+
"stateOrRegion": "string",
|
|
352
|
+
"city": "string",
|
|
353
|
+
"countryCode": "st",
|
|
354
|
+
"postalCode": "string",
|
|
355
|
+
"email": "string",
|
|
356
|
+
"phoneNumber": "string",
|
|
357
|
+
"geocode": {
|
|
358
|
+
"latitude": "string",
|
|
359
|
+
"longitude": "string"
|
|
360
|
+
}
|
|
361
|
+
},
|
|
362
|
+
"shipDate": "2019-08-24T14:15:22Z",
|
|
363
|
+
"packages": [
|
|
364
|
+
{
|
|
365
|
+
"dimensions": {
|
|
366
|
+
"length": 0,
|
|
367
|
+
"width": 0,
|
|
368
|
+
"height": 0,
|
|
369
|
+
"unit": "CENTIMETER"
|
|
370
|
+
},
|
|
371
|
+
"weight": {
|
|
372
|
+
"unit": "KILOGRAM",
|
|
373
|
+
"value": 0
|
|
374
|
+
},
|
|
375
|
+
"insuredValue":{
|
|
376
|
+
"value": 0.00,
|
|
377
|
+
"unit": "EUR",
|
|
378
|
+
},
|
|
379
|
+
"isHazmat": False,
|
|
380
|
+
"sellerDisplayName": "string",
|
|
381
|
+
"charges": [
|
|
382
|
+
{
|
|
383
|
+
"amount": {
|
|
384
|
+
"value": 0.00,
|
|
385
|
+
"unit": "EUR",
|
|
386
|
+
},
|
|
387
|
+
"chargeType": "TAX"
|
|
388
|
+
}
|
|
389
|
+
],
|
|
390
|
+
"packageClientReferenceId": "string",
|
|
391
|
+
"items": [
|
|
392
|
+
{
|
|
393
|
+
"itemValue": {
|
|
394
|
+
"value": 0.00,
|
|
395
|
+
"unit": "EUR",
|
|
396
|
+
},
|
|
397
|
+
"description": "string",
|
|
398
|
+
"itemIdentifier": "string",
|
|
399
|
+
"quantity": 1,
|
|
400
|
+
"weight": {
|
|
401
|
+
"value": 0.00,
|
|
402
|
+
"unit": "KILOGRAM",
|
|
403
|
+
},
|
|
404
|
+
"liquidVolume": {
|
|
405
|
+
"value": 0.00,
|
|
406
|
+
"unit": "ML",
|
|
407
|
+
},
|
|
408
|
+
"isHazmat": False,
|
|
409
|
+
"dangerousGoodsDetails": {
|
|
410
|
+
"unitedNationsRegulatoryId": "string",
|
|
411
|
+
"transportationRegulatoryClass": "string",
|
|
412
|
+
"packingGroup": "III",
|
|
413
|
+
"packingInstruction": "PI965_SECTION_IA",
|
|
414
|
+
},
|
|
415
|
+
"productType": "string",
|
|
416
|
+
"invoiceDetails": {
|
|
417
|
+
"invoiceNumber": "string",
|
|
418
|
+
"invoiceDate": "2019-08-24T14:15:22Z"
|
|
419
|
+
},
|
|
420
|
+
"serialNumbers": ["string"],
|
|
421
|
+
"directFulfillmentItemIdentifiers": {
|
|
422
|
+
"lineItemID": "string",
|
|
423
|
+
"pieceNumber": "string"
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
]
|
|
427
|
+
}
|
|
428
|
+
],
|
|
429
|
+
"valueAddedServicesDetails": [
|
|
430
|
+
"id": "string",
|
|
431
|
+
"amount": {
|
|
432
|
+
"value": 0.00,
|
|
433
|
+
"unit": "EUR",
|
|
434
|
+
},
|
|
435
|
+
],
|
|
436
|
+
"taxDetails": [
|
|
437
|
+
{
|
|
438
|
+
"taxType": "GST",
|
|
439
|
+
"taxRegistrationNumber": "string"
|
|
440
|
+
}
|
|
441
|
+
],
|
|
442
|
+
"channelDetails": {
|
|
443
|
+
"channelType": "EXTERNAL",
|
|
444
|
+
"amazonOrderDetails": {
|
|
445
|
+
"orderId": "string"
|
|
446
|
+
},
|
|
447
|
+
"amazonShipmentDetails": {
|
|
448
|
+
"shipmentId": "string"
|
|
449
|
+
}
|
|
450
|
+
},
|
|
451
|
+
"labelSpecifications": {
|
|
452
|
+
"format": "ZPL",
|
|
453
|
+
"size": {
|
|
454
|
+
"width": 4,
|
|
455
|
+
"length": 6,
|
|
456
|
+
"unit": "INCH"
|
|
457
|
+
},
|
|
458
|
+
"dpi": 203,
|
|
459
|
+
"pageLayout": "DEFAULT",
|
|
460
|
+
"needFileJoining": False,
|
|
461
|
+
"requestedDocumentTypes": ["LABEL"]
|
|
462
|
+
},
|
|
463
|
+
"serviceSelection": {
|
|
464
|
+
"serviceId": ["prime-premium-uk-mfn", "std-uk-mfn", "econ-uk-mfn"]
|
|
465
|
+
},
|
|
466
|
+
"shipperInstruction": {
|
|
467
|
+
"deliveryNotes": "string"
|
|
468
|
+
},
|
|
469
|
+
"destinationAccessPointDetails": {
|
|
470
|
+
"accessPointId": "string"
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
Returns:
|
|
476
|
+
ApiResponse:
|
|
477
|
+
"""
|
|
478
|
+
return await self._request(kwargs.pop("path"), data=kwargs, add_marketplace=False)
|
|
479
|
+
|
|
480
|
+
@sp_endpoint("/shipping/v2/tracking", method="GET")
|
|
481
|
+
async def get_tracking(self, **kwargs) -> ApiResponse:
|
|
482
|
+
"""
|
|
483
|
+
get_tracking(self, **kwargs) -> ApiResponse
|
|
484
|
+
|
|
485
|
+
Returns tracking information for a purchased shipment.
|
|
486
|
+
|
|
487
|
+
**Usage Plan:**
|
|
488
|
+
|
|
489
|
+
======================================
|
|
490
|
+
Rate (requests per second)
|
|
491
|
+
======================================
|
|
492
|
+
5
|
|
493
|
+
======================================
|
|
494
|
+
|
|
495
|
+
For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
|
|
496
|
+
|
|
497
|
+
Args:
|
|
498
|
+
key trackingId:string | * REQUIRED A carrier-generated tracking identifier originally returned by the purchaseShipment operation.
|
|
499
|
+
key carrierId:string | * REQUIRED A carrier identifier originally returned by the getRates operation for the selected rate.
|
|
500
|
+
|
|
501
|
+
Returns:
|
|
502
|
+
ApiResponse:
|
|
503
|
+
"""
|
|
504
|
+
return await self._request(kwargs.pop("path"), params=kwargs, add_marketplace=False)
|
|
505
|
+
|
|
506
|
+
@sp_endpoint("/shipping/v2/shipments/{}/documents", method="GET")
|
|
507
|
+
async def get_shipment_documents(self, shipmentId, **kwargs) -> ApiResponse:
|
|
508
|
+
"""
|
|
509
|
+
get_shipment_documents(self, shipmentId, **kwargs) -> ApiResponse
|
|
510
|
+
|
|
511
|
+
Returns the shipping documents associated with a package in a shipment.
|
|
512
|
+
|
|
513
|
+
**Usage Plan:**
|
|
514
|
+
|
|
515
|
+
======================================
|
|
516
|
+
Rate (requests per second)
|
|
517
|
+
======================================
|
|
518
|
+
5
|
|
519
|
+
======================================
|
|
520
|
+
|
|
521
|
+
For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
|
|
522
|
+
|
|
523
|
+
Args:
|
|
524
|
+
shipmentId:string | * REQUIRED The shipment identifier originally returned by the purchaseShipment operation.
|
|
525
|
+
key packageClientReferenceId:string | * REQUIRED The shipment identifier originally returned by the purchaseShipment operation.
|
|
526
|
+
key format:string | The file format of the document. Must be one of the supported formats returned by the getRates operation.
|
|
527
|
+
key dpi:number | The resolution of the document (for example, 300 means 300 dots per inch). Must be one of the supported resolutions returned in the response to the getRates operation.
|
|
528
|
+
|
|
529
|
+
Returns:
|
|
530
|
+
ApiResponse:
|
|
531
|
+
"""
|
|
532
|
+
|
|
533
|
+
return await self._request(
|
|
534
|
+
fill_query_params(kwargs.pop("path"), shipmentId),
|
|
535
|
+
params=kwargs,
|
|
536
|
+
add_marketplace=False,
|
|
537
|
+
)
|
|
538
|
+
|
|
539
|
+
@sp_endpoint("/shipping/v2/shipments/{}/cancel", method="PUT")
|
|
540
|
+
async def cancel_shipment(self, shipmentId, **kwargs) -> ApiResponse:
|
|
541
|
+
"""
|
|
542
|
+
cancel_shipment(self, shipmentId, **kwargs) -> ApiResponse
|
|
543
|
+
|
|
544
|
+
Cancels a purchased shipment. Returns an empty object if the shipment is successfully cancelled.
|
|
545
|
+
|
|
546
|
+
**Usage Plan:**
|
|
547
|
+
|
|
548
|
+
======================================
|
|
549
|
+
Rate (requests per second)
|
|
550
|
+
======================================
|
|
551
|
+
5
|
|
552
|
+
======================================
|
|
553
|
+
|
|
554
|
+
For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
|
|
555
|
+
|
|
556
|
+
Args:
|
|
557
|
+
shipmentId:string | * REQUIRED The shipment identifier originally returned by the purchaseShipment operation.
|
|
558
|
+
|
|
559
|
+
Returns:
|
|
560
|
+
ApiResponse:
|
|
561
|
+
"""
|
|
562
|
+
return await self._request(
|
|
563
|
+
fill_query_params(kwargs.pop("path"), shipmentId),
|
|
564
|
+
data=kwargs,
|
|
565
|
+
add_marketplace=False,
|
|
566
|
+
)
|
|
567
|
+
|
|
568
|
+
@sp_endpoint("/shipping/v2/accessPoints", method="GET")
|
|
569
|
+
async def get_access_points(self, **kwargs) -> ApiResponse:
|
|
570
|
+
"""
|
|
571
|
+
get_access_points(self, **kwargs) -> ApiResponse
|
|
572
|
+
|
|
573
|
+
Returns a list of access points in proximity of input postal code.
|
|
574
|
+
|
|
575
|
+
**Usage Plan:**
|
|
576
|
+
|
|
577
|
+
======================================
|
|
578
|
+
Rate (requests per second)
|
|
579
|
+
======================================
|
|
580
|
+
5
|
|
581
|
+
======================================
|
|
582
|
+
|
|
583
|
+
For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
|
|
584
|
+
|
|
585
|
+
Args:
|
|
586
|
+
key accessPointTypes:string | * REQUIRED
|
|
587
|
+
key countryCode:string | * REQUIRED
|
|
588
|
+
key postalCode:string | * REQUIRED
|
|
589
|
+
|
|
590
|
+
Returns:
|
|
591
|
+
ApiResponse:
|
|
592
|
+
"""
|
|
593
|
+
return await self._request(kwargs.pop("path"), params=kwargs, add_marketplace=False)
|
|
594
|
+
|
|
595
|
+
@sp_endpoint("/shipping/v2/ndrFeedback", method="POST")
|
|
596
|
+
async def submit_ndr_feedback(self, **kwargs) -> ApiResponse:
|
|
597
|
+
"""
|
|
598
|
+
submit_ndr_feedback(self, **kwargs) -> ApiResponse
|
|
599
|
+
|
|
600
|
+
This API submits the NDR (Non-delivery Report) Feedback for any eligible shipment.
|
|
601
|
+
|
|
602
|
+
**Usage Plan:**
|
|
603
|
+
|
|
604
|
+
======================================
|
|
605
|
+
Rate (requests per second)
|
|
606
|
+
======================================
|
|
607
|
+
5
|
|
608
|
+
======================================
|
|
609
|
+
|
|
610
|
+
For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
|
|
611
|
+
|
|
612
|
+
Args:
|
|
613
|
+
body: {
|
|
614
|
+
"trackingId": "string",
|
|
615
|
+
"ndrAction": "RTO",
|
|
616
|
+
"ndrRequestData": {
|
|
617
|
+
"rescheduleDate": "2024-12-12T05:24:00.00Z",
|
|
618
|
+
"additionalAddressNotes": "string"
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
Returns:
|
|
623
|
+
ApiResponse:
|
|
624
|
+
"""
|
|
625
|
+
return await self._request(kwargs.pop("path"), data=kwargs, add_marketplace=False)
|
|
626
|
+
|
|
627
|
+
@sp_endpoint("/shipping/v2/shipments/additionalInputs/schema", method="GET")
|
|
628
|
+
async def get_additional_inputs(self, **kwargs) -> ApiResponse:
|
|
629
|
+
"""
|
|
630
|
+
get_additional_inputs(self, **kwargs) -> ApiResponse
|
|
631
|
+
|
|
632
|
+
Returns the JSON schema to use for providing additional inputs when needed to purchase a shipping offering. Call the getAdditionalInputs operation when the response to a previous call to the getRates operation indicates that additional inputs are required for the rate (shipping offering) that you want to purchase.
|
|
633
|
+
|
|
634
|
+
**Usage Plan:**
|
|
635
|
+
|
|
636
|
+
======================================
|
|
637
|
+
Rate (requests per second)
|
|
638
|
+
======================================
|
|
639
|
+
5
|
|
640
|
+
======================================
|
|
641
|
+
|
|
642
|
+
For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
|
|
643
|
+
|
|
644
|
+
Args:
|
|
645
|
+
key requestToken:string | * REQUIRED The request token returned in the response to the getRates operation.
|
|
646
|
+
key rateId:string | * REQUIRED The rate identifier for the shipping offering (rate) returned in the response to the getRates operation.
|
|
647
|
+
|
|
648
|
+
Returns:
|
|
649
|
+
ApiResponse:
|
|
650
|
+
"""
|
|
651
|
+
return await self._request(kwargs.pop("path"), params=kwargs, add_marketplace=False)
|
|
File without changes
|