python-amazon-sp-api 1.9.18__py3-none-any.whl → 2.0.7__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.
Files changed (167) hide show
  1. {python_amazon_sp_api-1.9.18.data → python_amazon_sp_api-2.0.7.data}/scripts/make_endpoint +2 -2
  2. {python_amazon_sp_api-1.9.18.dist-info → python_amazon_sp_api-2.0.7.dist-info}/METADATA +46 -23
  3. python_amazon_sp_api-2.0.7.dist-info/RECORD +251 -0
  4. {python_amazon_sp_api-1.9.18.dist-info → python_amazon_sp_api-2.0.7.dist-info}/WHEEL +1 -1
  5. {python_amazon_sp_api-1.9.18.dist-info → python_amazon_sp_api-2.0.7.dist-info}/top_level.txt +0 -1
  6. sp_api/__version__.py +1 -1
  7. sp_api/api/__init__.py +18 -1
  8. sp_api/api/application_integrations/application_integrations.py +118 -0
  9. sp_api/api/application_management/application_management.py +2 -1
  10. sp_api/api/catalog/catalog.py +3 -4
  11. sp_api/api/catalog_items/catalog_items.py +3 -6
  12. sp_api/api/customer_feedback/customer_feedback.py +110 -0
  13. sp_api/api/data_kiosk/data_kiosk.py +5 -6
  14. sp_api/api/easy_ship/easy_ship.py +190 -0
  15. sp_api/api/external_fulfillment/external_fulfillment.py +706 -0
  16. sp_api/api/feeds/feeds.py +11 -8
  17. sp_api/api/finances/finances.py +30 -4
  18. sp_api/api/fulfillment_inbound/fulfillment_inbound.py +35 -2
  19. sp_api/api/inventories/inventories.py +2 -7
  20. sp_api/api/listings_items/listings_items.py +3 -24
  21. sp_api/api/messaging/messaging.py +42 -0
  22. sp_api/api/orders/orders.py +7 -0
  23. sp_api/api/product_fees/product_fees.py +31 -74
  24. sp_api/api/products/products.py +80 -2
  25. sp_api/api/products/products_definitions.py +11 -85
  26. sp_api/api/reports/reports.py +65 -97
  27. sp_api/api/sales/sales.py +2 -2
  28. sp_api/asyncio/api/__init__.py +164 -0
  29. sp_api/asyncio/api/amazon_warehousing_and_distribu/__init__.py +9 -0
  30. sp_api/asyncio/api/amazon_warehousing_and_distribu/amazon_warehousing_and_distribu.py +130 -0
  31. sp_api/asyncio/api/aplus_content/__init__.py +5 -0
  32. sp_api/asyncio/api/aplus_content/aplus_content.py +330 -0
  33. sp_api/asyncio/api/application_integrations/__init__.py +5 -0
  34. sp_api/asyncio/api/application_integrations/application_integrations.py +119 -0
  35. sp_api/asyncio/api/application_management/__init__.py +5 -0
  36. sp_api/asyncio/api/application_management/application_management.py +36 -0
  37. sp_api/asyncio/api/authorization/__init__.py +5 -0
  38. sp_api/asyncio/api/authorization/authorization.py +54 -0
  39. sp_api/asyncio/api/catalog/__init__.py +5 -0
  40. sp_api/asyncio/api/catalog/catalog.py +111 -0
  41. sp_api/asyncio/api/catalog_items/__init__.py +6 -0
  42. sp_api/asyncio/api/catalog_items/catalog_items.py +93 -0
  43. sp_api/asyncio/api/clients/__init__.py +1 -0
  44. sp_api/asyncio/api/customer_feedback/__init__.py +5 -0
  45. sp_api/asyncio/api/customer_feedback/customer_feedback.py +111 -0
  46. sp_api/asyncio/api/data_kiosk/__init__.py +5 -0
  47. sp_api/asyncio/api/data_kiosk/data_kiosk.py +236 -0
  48. sp_api/asyncio/api/easy_ship/__init__.py +5 -0
  49. sp_api/asyncio/api/easy_ship/easy_ship.py +191 -0
  50. sp_api/asyncio/api/external_fulfillment/__init__.py +5 -0
  51. sp_api/asyncio/api/external_fulfillment/external_fulfillment.py +706 -0
  52. sp_api/asyncio/api/fba_inbound_eligibility/__init__.py +5 -0
  53. sp_api/asyncio/api/fba_inbound_eligibility/fba_inbound_eligibility.py +96 -0
  54. sp_api/asyncio/api/fba_small_and_light/__init__.py +5 -0
  55. sp_api/asyncio/api/fba_small_and_light/fba_small_and_light.py +213 -0
  56. sp_api/asyncio/api/feeds/feeds.py +260 -0
  57. sp_api/asyncio/api/finances/finances.py +100 -0
  58. sp_api/asyncio/api/fulfillment_inbound/fulfillment_inbound.py +1798 -0
  59. sp_api/asyncio/api/fulfillment_outbound/fulfillment_outbound.py +736 -0
  60. sp_api/asyncio/api/inventories/inventories.py +74 -0
  61. sp_api/asyncio/api/listings_items/__init__.py +0 -0
  62. sp_api/asyncio/api/listings_items/listings_items.py +170 -0
  63. sp_api/asyncio/api/listings_restrictions/__init__.py +0 -0
  64. sp_api/asyncio/api/listings_restrictions/listings_restrictions.py +36 -0
  65. sp_api/asyncio/api/merchant_fulfillment/__init__.py +0 -0
  66. sp_api/asyncio/api/merchant_fulfillment/merchant_fulfillment.py +384 -0
  67. sp_api/asyncio/api/messaging/__init__.py +0 -0
  68. sp_api/asyncio/api/messaging/messaging.py +511 -0
  69. sp_api/asyncio/api/models/__init__.py +4 -0
  70. sp_api/asyncio/api/notifications/__init__.py +0 -0
  71. sp_api/asyncio/api/notifications/notifications.py +295 -0
  72. sp_api/asyncio/api/orders/__init__.py +0 -0
  73. sp_api/asyncio/api/orders/orders.py +362 -0
  74. sp_api/asyncio/api/overrides/__init__.py +1 -0
  75. sp_api/asyncio/api/product_fees/__init__.py +0 -0
  76. sp_api/asyncio/api/product_fees/product_fees.py +194 -0
  77. sp_api/asyncio/api/product_type_definitions/__init__.py +0 -0
  78. sp_api/asyncio/api/product_type_definitions/product_type_definitions.py +75 -0
  79. sp_api/asyncio/api/products/__init__.py +0 -0
  80. sp_api/asyncio/api/products/products.py +405 -0
  81. sp_api/asyncio/api/products/products_definitions.py +11 -0
  82. sp_api/asyncio/api/replenishment/__init__.py +0 -0
  83. sp_api/asyncio/api/replenishment/replenishment.py +121 -0
  84. sp_api/asyncio/api/reports/__init__.py +0 -0
  85. sp_api/asyncio/api/reports/reports.py +439 -0
  86. sp_api/asyncio/api/sales/__init__.py +0 -0
  87. sp_api/asyncio/api/sales/sales.py +93 -0
  88. sp_api/asyncio/api/sellers/__init__.py +0 -0
  89. sp_api/asyncio/api/sellers/sellers.py +70 -0
  90. sp_api/asyncio/api/services/__init__.py +0 -0
  91. sp_api/asyncio/api/services/services.py +218 -0
  92. sp_api/asyncio/api/shipping/__init__.py +0 -0
  93. sp_api/asyncio/api/shipping/shipping.py +459 -0
  94. sp_api/asyncio/api/shipping/shippingV2.py +651 -0
  95. sp_api/asyncio/api/solicitations/__init__.py +0 -0
  96. sp_api/asyncio/api/solicitations/solicitations.py +78 -0
  97. sp_api/asyncio/api/supply_sources/__init__.py +0 -0
  98. sp_api/asyncio/api/supply_sources/supply_sources.py +138 -0
  99. sp_api/asyncio/api/tokens/__init__.py +0 -0
  100. sp_api/asyncio/api/tokens/tokens.py +65 -0
  101. sp_api/asyncio/api/upload/__init__.py +0 -0
  102. sp_api/asyncio/api/upload/upload.py +18 -0
  103. sp_api/asyncio/api/vendor_direct_fulfillment_inventory/__init__.py +0 -0
  104. sp_api/asyncio/api/vendor_direct_fulfillment_inventory/vendor_direct_fulfillment_inventory.py +64 -0
  105. sp_api/asyncio/api/vendor_direct_fulfillment_orders/__init__.py +0 -0
  106. sp_api/asyncio/api/vendor_direct_fulfillment_orders/vendor_direct_fulfillment_orders.py +196 -0
  107. sp_api/asyncio/api/vendor_direct_fulfillment_payments/__init__.py +0 -0
  108. sp_api/asyncio/api/vendor_direct_fulfillment_payments/vendor_direct_fulfillment_payments.py +254 -0
  109. sp_api/asyncio/api/vendor_direct_fulfillment_shipping/__init__.py +0 -0
  110. sp_api/asyncio/api/vendor_direct_fulfillment_shipping/vendor_direct_fulfillment_shipping.py +627 -0
  111. sp_api/asyncio/api/vendor_direct_fulfillment_transactions/__init__.py +0 -0
  112. sp_api/asyncio/api/vendor_direct_fulfillment_transactions/vendor_direct_fulfillment_transactions.py +43 -0
  113. sp_api/asyncio/api/vendor_invoices/__init__.py +0 -0
  114. sp_api/asyncio/api/vendor_invoices/vendor_invoices.py +295 -0
  115. sp_api/asyncio/api/vendor_orders/__init__.py +0 -0
  116. sp_api/asyncio/api/vendor_orders/vendor_orders.py +210 -0
  117. sp_api/asyncio/api/vendor_shipments/__init__.py +0 -0
  118. sp_api/asyncio/api/vendor_shipments/vendor_shipments.py +118 -0
  119. sp_api/asyncio/api/vendor_transaction_status/__init__.py +0 -0
  120. sp_api/asyncio/api/vendor_transaction_status/vendor_transaction_status.py +41 -0
  121. sp_api/asyncio/auth/__init__.py +12 -0
  122. sp_api/asyncio/auth/access_token_client.py +145 -0
  123. sp_api/asyncio/auth/exceptions.py +5 -0
  124. sp_api/asyncio/base/__init__.py +53 -0
  125. sp_api/asyncio/base/_transport_httpx.py +50 -0
  126. sp_api/asyncio/base/base_client.py +8 -0
  127. sp_api/asyncio/base/client.py +169 -0
  128. sp_api/asyncio/util/__init__.py +29 -0
  129. sp_api/asyncio/util/key_maker.py +5 -0
  130. sp_api/asyncio/util/load_all_pages.py +55 -0
  131. sp_api/asyncio/util/load_date_bound.py +53 -0
  132. sp_api/asyncio/util/retry.py +88 -0
  133. sp_api/auth/_core.py +39 -0
  134. sp_api/auth/access_token_client.py +18 -29
  135. sp_api/base/ApiResponse.py +3 -2
  136. sp_api/base/_core.py +110 -0
  137. sp_api/base/_transport_httpx.py +39 -0
  138. sp_api/base/client.py +40 -63
  139. sp_api/base/helpers.py +1 -1
  140. sp_api/base/reportTypes.py +3 -2
  141. sp_api/util/__init__.py +36 -0
  142. sp_api/util/load_all_pages.py +2 -1
  143. sp_api/util/params.py +57 -0
  144. sp_api/util/product_fees.py +40 -0
  145. sp_api/util/products_definitions.py +169 -0
  146. sp_api/util/report_document.py +154 -0
  147. python_amazon_sp_api-1.9.18.dist-info/RECORD +0 -144
  148. tests/api/finances/test_finances.py +0 -19
  149. tests/api/notifications/test_notifications.py +0 -26
  150. tests/api/orders/test_orders.py +0 -122
  151. tests/api/product_fees/product_fees.py +0 -49
  152. tests/api/reports/test_reports.py +0 -127
  153. tests/client/test_auth.py +0 -59
  154. tests/client/test_base.py +0 -163
  155. tests/client/test_credential_provider.py +0 -45
  156. tests/client/test_helpers.py +0 -142
  157. {python_amazon_sp_api-1.9.18.dist-info → python_amazon_sp_api-2.0.7.dist-info/licenses}/LICENSE +0 -0
  158. {tests → sp_api/api/application_integrations}/__init__.py +0 -0
  159. {tests/api → sp_api/api/customer_feedback}/__init__.py +0 -0
  160. {tests/api/finances → sp_api/api/easy_ship}/__init__.py +0 -0
  161. {tests/api/notifications → sp_api/api/external_fulfillment}/__init__.py +0 -0
  162. {tests/api/orders → sp_api/asyncio}/__init__.py +0 -0
  163. {tests/api/product_fees → sp_api/asyncio/api/feeds}/__init__.py +0 -0
  164. {tests/api/reports → sp_api/asyncio/api/finances}/__init__.py +0 -0
  165. {tests/api/sellers → sp_api/asyncio/api/fulfillment_inbound}/__init__.py +0 -0
  166. {tests/client → sp_api/asyncio/api/fulfillment_outbound}/__init__.py +0 -0
  167. /tests/api/sellers/test_sellers.py → /sp_api/asyncio/api/inventories/__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