python-amazon-sp-api 1.9.60__py3-none-any.whl → 2.0.2__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 (137) hide show
  1. {python_amazon_sp_api-1.9.60.dist-info → python_amazon_sp_api-2.0.2.dist-info}/METADATA +41 -14
  2. python_amazon_sp_api-2.0.2.dist-info/RECORD +249 -0
  3. sp_api/__version__.py +1 -1
  4. sp_api/api/catalog/catalog.py +3 -4
  5. sp_api/api/catalog_items/catalog_items.py +3 -6
  6. sp_api/api/data_kiosk/data_kiosk.py +5 -6
  7. sp_api/api/feeds/feeds.py +11 -8
  8. sp_api/api/fulfillment_inbound/fulfillment_inbound.py +2 -2
  9. sp_api/api/inventories/inventories.py +2 -7
  10. sp_api/api/listings_items/listings_items.py +3 -24
  11. sp_api/api/products/products.py +3 -1
  12. sp_api/api/reports/reports.py +61 -97
  13. sp_api/api/sales/sales.py +2 -2
  14. sp_api/asyncio/__init__.py +0 -0
  15. sp_api/asyncio/api/__init__.py +164 -0
  16. sp_api/asyncio/api/amazon_warehousing_and_distribu/__init__.py +9 -0
  17. sp_api/asyncio/api/amazon_warehousing_and_distribu/amazon_warehousing_and_distribu.py +130 -0
  18. sp_api/asyncio/api/aplus_content/__init__.py +5 -0
  19. sp_api/asyncio/api/aplus_content/aplus_content.py +330 -0
  20. sp_api/asyncio/api/application_integrations/__init__.py +5 -0
  21. sp_api/asyncio/api/application_integrations/application_integrations.py +119 -0
  22. sp_api/asyncio/api/application_management/__init__.py +5 -0
  23. sp_api/asyncio/api/application_management/application_management.py +36 -0
  24. sp_api/asyncio/api/authorization/__init__.py +5 -0
  25. sp_api/asyncio/api/authorization/authorization.py +54 -0
  26. sp_api/asyncio/api/catalog/__init__.py +5 -0
  27. sp_api/asyncio/api/catalog/catalog.py +111 -0
  28. sp_api/asyncio/api/catalog_items/__init__.py +6 -0
  29. sp_api/asyncio/api/catalog_items/catalog_items.py +93 -0
  30. sp_api/asyncio/api/clients/__init__.py +1 -0
  31. sp_api/asyncio/api/customer_feedback/__init__.py +5 -0
  32. sp_api/asyncio/api/customer_feedback/customer_feedback.py +111 -0
  33. sp_api/asyncio/api/data_kiosk/__init__.py +5 -0
  34. sp_api/asyncio/api/data_kiosk/data_kiosk.py +236 -0
  35. sp_api/asyncio/api/easy_ship/__init__.py +5 -0
  36. sp_api/asyncio/api/easy_ship/easy_ship.py +191 -0
  37. sp_api/asyncio/api/external_fulfillment/__init__.py +5 -0
  38. sp_api/asyncio/api/external_fulfillment/external_fulfillment.py +706 -0
  39. sp_api/asyncio/api/fba_inbound_eligibility/__init__.py +5 -0
  40. sp_api/asyncio/api/fba_inbound_eligibility/fba_inbound_eligibility.py +96 -0
  41. sp_api/asyncio/api/fba_small_and_light/__init__.py +5 -0
  42. sp_api/asyncio/api/fba_small_and_light/fba_small_and_light.py +213 -0
  43. sp_api/asyncio/api/feeds/__init__.py +0 -0
  44. sp_api/asyncio/api/feeds/feeds.py +260 -0
  45. sp_api/asyncio/api/finances/__init__.py +0 -0
  46. sp_api/asyncio/api/finances/finances.py +100 -0
  47. sp_api/asyncio/api/fulfillment_inbound/__init__.py +0 -0
  48. sp_api/asyncio/api/fulfillment_inbound/fulfillment_inbound.py +1798 -0
  49. sp_api/asyncio/api/fulfillment_outbound/__init__.py +0 -0
  50. sp_api/asyncio/api/fulfillment_outbound/fulfillment_outbound.py +736 -0
  51. sp_api/asyncio/api/inventories/__init__.py +0 -0
  52. sp_api/asyncio/api/inventories/inventories.py +74 -0
  53. sp_api/asyncio/api/listings_items/__init__.py +0 -0
  54. sp_api/asyncio/api/listings_items/listings_items.py +170 -0
  55. sp_api/asyncio/api/listings_restrictions/__init__.py +0 -0
  56. sp_api/asyncio/api/listings_restrictions/listings_restrictions.py +36 -0
  57. sp_api/asyncio/api/merchant_fulfillment/__init__.py +0 -0
  58. sp_api/asyncio/api/merchant_fulfillment/merchant_fulfillment.py +384 -0
  59. sp_api/asyncio/api/messaging/__init__.py +0 -0
  60. sp_api/asyncio/api/messaging/messaging.py +511 -0
  61. sp_api/asyncio/api/models/__init__.py +4 -0
  62. sp_api/asyncio/api/notifications/__init__.py +0 -0
  63. sp_api/asyncio/api/notifications/notifications.py +295 -0
  64. sp_api/asyncio/api/orders/__init__.py +0 -0
  65. sp_api/asyncio/api/orders/orders.py +356 -0
  66. sp_api/asyncio/api/overrides/__init__.py +1 -0
  67. sp_api/asyncio/api/product_fees/__init__.py +0 -0
  68. sp_api/asyncio/api/product_fees/product_fees.py +237 -0
  69. sp_api/asyncio/api/product_type_definitions/__init__.py +0 -0
  70. sp_api/asyncio/api/product_type_definitions/product_type_definitions.py +75 -0
  71. sp_api/asyncio/api/products/__init__.py +0 -0
  72. sp_api/asyncio/api/products/products.py +405 -0
  73. sp_api/asyncio/api/products/products_definitions.py +170 -0
  74. sp_api/asyncio/api/replenishment/__init__.py +0 -0
  75. sp_api/asyncio/api/replenishment/replenishment.py +121 -0
  76. sp_api/asyncio/api/reports/__init__.py +0 -0
  77. sp_api/asyncio/api/reports/reports.py +439 -0
  78. sp_api/asyncio/api/sales/__init__.py +0 -0
  79. sp_api/asyncio/api/sales/sales.py +93 -0
  80. sp_api/asyncio/api/sellers/__init__.py +0 -0
  81. sp_api/asyncio/api/sellers/sellers.py +70 -0
  82. sp_api/asyncio/api/services/__init__.py +0 -0
  83. sp_api/asyncio/api/services/services.py +218 -0
  84. sp_api/asyncio/api/shipping/__init__.py +0 -0
  85. sp_api/asyncio/api/shipping/shipping.py +459 -0
  86. sp_api/asyncio/api/shipping/shippingV2.py +651 -0
  87. sp_api/asyncio/api/solicitations/__init__.py +0 -0
  88. sp_api/asyncio/api/solicitations/solicitations.py +78 -0
  89. sp_api/asyncio/api/supply_sources/__init__.py +0 -0
  90. sp_api/asyncio/api/supply_sources/supply_sources.py +138 -0
  91. sp_api/asyncio/api/tokens/__init__.py +0 -0
  92. sp_api/asyncio/api/tokens/tokens.py +65 -0
  93. sp_api/asyncio/api/upload/__init__.py +0 -0
  94. sp_api/asyncio/api/upload/upload.py +18 -0
  95. sp_api/asyncio/api/vendor_direct_fulfillment_inventory/__init__.py +0 -0
  96. sp_api/asyncio/api/vendor_direct_fulfillment_inventory/vendor_direct_fulfillment_inventory.py +64 -0
  97. sp_api/asyncio/api/vendor_direct_fulfillment_orders/__init__.py +0 -0
  98. sp_api/asyncio/api/vendor_direct_fulfillment_orders/vendor_direct_fulfillment_orders.py +196 -0
  99. sp_api/asyncio/api/vendor_direct_fulfillment_payments/__init__.py +0 -0
  100. sp_api/asyncio/api/vendor_direct_fulfillment_payments/vendor_direct_fulfillment_payments.py +254 -0
  101. sp_api/asyncio/api/vendor_direct_fulfillment_shipping/__init__.py +0 -0
  102. sp_api/asyncio/api/vendor_direct_fulfillment_shipping/vendor_direct_fulfillment_shipping.py +627 -0
  103. sp_api/asyncio/api/vendor_direct_fulfillment_transactions/__init__.py +0 -0
  104. sp_api/asyncio/api/vendor_direct_fulfillment_transactions/vendor_direct_fulfillment_transactions.py +43 -0
  105. sp_api/asyncio/api/vendor_invoices/__init__.py +0 -0
  106. sp_api/asyncio/api/vendor_invoices/vendor_invoices.py +295 -0
  107. sp_api/asyncio/api/vendor_orders/__init__.py +0 -0
  108. sp_api/asyncio/api/vendor_orders/vendor_orders.py +210 -0
  109. sp_api/asyncio/api/vendor_shipments/__init__.py +0 -0
  110. sp_api/asyncio/api/vendor_shipments/vendor_shipments.py +118 -0
  111. sp_api/asyncio/api/vendor_transaction_status/__init__.py +0 -0
  112. sp_api/asyncio/api/vendor_transaction_status/vendor_transaction_status.py +41 -0
  113. sp_api/asyncio/auth/__init__.py +12 -0
  114. sp_api/asyncio/auth/access_token_client.py +145 -0
  115. sp_api/asyncio/auth/exceptions.py +5 -0
  116. sp_api/asyncio/base/__init__.py +53 -0
  117. sp_api/asyncio/base/_transport_httpx.py +50 -0
  118. sp_api/asyncio/base/base_client.py +8 -0
  119. sp_api/asyncio/base/client.py +169 -0
  120. sp_api/asyncio/util/__init__.py +29 -0
  121. sp_api/asyncio/util/key_maker.py +5 -0
  122. sp_api/asyncio/util/load_all_pages.py +55 -0
  123. sp_api/asyncio/util/load_date_bound.py +53 -0
  124. sp_api/asyncio/util/retry.py +88 -0
  125. sp_api/auth/_core.py +39 -0
  126. sp_api/auth/access_token_client.py +18 -30
  127. sp_api/base/_core.py +110 -0
  128. sp_api/base/_transport_httpx.py +39 -0
  129. sp_api/base/client.py +40 -63
  130. sp_api/util/__init__.py +16 -0
  131. sp_api/util/params.py +57 -0
  132. sp_api/util/report_document.py +154 -0
  133. python_amazon_sp_api-1.9.60.dist-info/RECORD +0 -133
  134. {python_amazon_sp_api-1.9.60.data → python_amazon_sp_api-2.0.2.data}/scripts/make_endpoint +0 -0
  135. {python_amazon_sp_api-1.9.60.dist-info → python_amazon_sp_api-2.0.2.dist-info}/WHEEL +0 -0
  136. {python_amazon_sp_api-1.9.60.dist-info → python_amazon_sp_api-2.0.2.dist-info}/licenses/LICENSE +0 -0
  137. {python_amazon_sp_api-1.9.60.dist-info → python_amazon_sp_api-2.0.2.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,706 @@
1
+ import uuid
2
+
3
+ from sp_api.base import ApiResponse, fill_query_params, sp_endpoint
4
+ from sp_api.asyncio.base import AsyncBaseClient
5
+
6
+
7
+ class ExternalFulfillment(AsyncBaseClient):
8
+ """
9
+ ExternalFulfillment SP-API Client
10
+ :link:
11
+
12
+ The Selling Partner API to work with Amazon External Fulfillment shipments management/processing services.
13
+ """
14
+
15
+ @sp_endpoint("/externalFulfillment/2024-09-11/shipments", method="GET")
16
+ async def get_shipments(self, **kwargs) -> ApiResponse:
17
+ """
18
+ get_shipments(self, **kwargs) -> ApiResponse
19
+
20
+ Get a list of shipments dropped for the seller in the specified status. Shipments can be further filtered based on the fulfillment node and/or shipments' last updated date and time.
21
+
22
+ **Usage Plans:**
23
+
24
+ ======================================
25
+ Rate (requests per second)
26
+ ======================================
27
+ 5
28
+ ======================================
29
+
30
+ For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
31
+
32
+ Args:
33
+ key locationId:string | The SmartConnect location identifier for which shipments are to be retrieved
34
+ key channelName:string | The channel name associated with the location. Valid values are FBA, MFN
35
+ key status*:string | * REQUIRED Retrieves only those shipments which are in the specified status. The most common use-case would be to fetch all new shipments which would be in the ACCEPTED status. Valid values are ACCEPTED, CONFIRMED, PACKAGE_CREATED, PICKUP_SLOT_RETRIEVED, INVOICE_GENERATED, SHIPLABEL_GENERATED, SHIPPED, DELIVERED and CANCELLED.
36
+ key lastUpdatedAfter:string | Shipments whose latest update is after the specified date/time are included in the response. This field should be in the ISO8601 date/time format.
37
+ key lastUpdatedBefore:string | Shipments whose latest update is before the specified date/time are included in the response. This field should be in the ISO8601 date/time format.
38
+ key maxResults:integer | Specify the number of shipments to be included in the response.
39
+ key paginationToken:string | The nexToken value returned from a previous call to get shipments. Use this to retrieve the next page of shipments.
40
+ Returns:
41
+ ApiResponse:
42
+ """
43
+
44
+ return await self._request(kwargs.pop("path"), params=kwargs)
45
+
46
+ @sp_endpoint("/externalFulfillment/2024-09-11/shipments/{}", method="GET")
47
+ async def get_shipment(self, shipmentId, **kwargs) -> ApiResponse:
48
+ """
49
+ get_shipment(self, shipmentId, **kwargs) -> ApiResponse
50
+
51
+ Get a single shipment with the specified id.
52
+
53
+ **Usage Plan:**
54
+
55
+ ======================================
56
+ Rate (requests per second)
57
+ ======================================
58
+ 5
59
+ ======================================
60
+
61
+ For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
62
+
63
+ Args:
64
+ shipmentId:string | * REQUIRED The id of the shipment to be retrieved.
65
+
66
+ Returns:
67
+ ApiResponse:
68
+ """
69
+ return await self._request(
70
+ fill_query_params(kwargs.pop("path"), shipmentId),
71
+ params=kwargs,
72
+ add_marketplace=False,
73
+ )
74
+
75
+ @sp_endpoint("/externalFulfillment/shipments/2021-01-06/shipments/{}", method="POST")
76
+ async def process_shipment(self, shipmentId, operation, **kwargs) -> ApiResponse:
77
+ """
78
+ process_shipment(self, shipmentId, **kwargs) -> ApiResponse
79
+
80
+ Confirms/Rejects that a seller will be fulfilling or cancelling the specified shipment.
81
+
82
+ **Usage Plan:**
83
+
84
+ ======================================
85
+ Rate (requests per second)
86
+ ======================================
87
+ 5
88
+ ======================================
89
+
90
+ For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
91
+
92
+ Args:
93
+ shipmentId:string | * REQUIRED The id of the shipment which is to be confirmed for fulfillment.
94
+ operation:string | * REQUIRED The status in which shipment should be moved. Valid values are CONFIRM and REJECT.
95
+
96
+ body: {
97
+ "referenceId": "string",
98
+ "lineItems": [
99
+ {
100
+ "lineItem": {
101
+ "id": "string",
102
+ "quantity": 1
103
+ },
104
+ "reason": "OUT_OF_STOCK"
105
+ }
106
+ ]
107
+ }
108
+
109
+ Returns:
110
+ ApiResponse:
111
+ """
112
+ return await self._request(
113
+ fill_query_params(kwargs.pop("path"), shipmentId),
114
+ params={"operation": operation},
115
+ data=kwargs,
116
+ add_marketplace=False,
117
+ )
118
+
119
+
120
+ @sp_endpoint("/externalFulfillment/shipments/2021-01-06/shipments/{}/packages", method="POST")
121
+ async def create_packages(self, shipmentId, **kwargs) -> ApiResponse:
122
+ """
123
+ create_packages(self, shipmentId, **kwargs) -> ApiResponse
124
+
125
+ Provides details about the packages that will be used to fulfill the specified shipment.
126
+
127
+ **Usage Plan:**
128
+
129
+ ======================================
130
+ Rate (requests per second)
131
+ ======================================
132
+ 5
133
+ ======================================
134
+
135
+ For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
136
+
137
+ Args:
138
+ shipmentId:string | * REQUIRED The id of the shipment for which package information is being provided.
139
+
140
+ body: {
141
+ "packages": [
142
+ {
143
+ "id": "string",
144
+ "dimensions": {
145
+ "length": {
146
+ "value": "string",
147
+ "dimensionUnit": "CM"
148
+ },
149
+ "width": {
150
+ "value": "string",
151
+ "dimensionUnit": "CM"
152
+ },
153
+ "height": {
154
+ "value": "string",
155
+ "dimensionUnit": "CM"
156
+ },
157
+ },
158
+ "weight": {
159
+ "value": "string",
160
+ "weightUnit": "kilograms"
161
+ },
162
+ "hazmatLabels": [],
163
+ "packageLineItems": [
164
+ {
165
+ "packageLineItemId": "string",
166
+ "quantity": 1,
167
+ "serialNumbers": [],
168
+ "pieces": 1,
169
+ "countryOfOrigin": "ES"
170
+ }
171
+ ],
172
+ "status": "CREATED"
173
+ }
174
+ ]
175
+ }
176
+ Returns:
177
+ ApiResponse:
178
+ """
179
+
180
+ return await self._request(
181
+ fill_query_params(kwargs.pop("path"), shipmentId),
182
+ data=kwargs,
183
+ add_marketplace=False
184
+ )
185
+
186
+ @sp_endpoint("/externalFulfillment/shipments/2021-01-06/shipments/{}/packages/{}", method="PUT")
187
+ async def update_package(self, shipmentId, packageId, **kwargs) -> ApiResponse:
188
+ """
189
+ update_package(self, shipmentId, packageId, **kwargs) -> ApiResponse
190
+
191
+ Updates the details about the packages that will be used to fulfill the specified shipment.
192
+
193
+ **Usage Plan:**
194
+
195
+ ======================================
196
+ Rate (requests per second)
197
+ ======================================
198
+ 5
199
+ ======================================
200
+
201
+ For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
202
+
203
+ Args:
204
+ shipmentId:string | * REQUIRED The id of the shipment for which package information is being updated.
205
+ packageId:string | * REQUIRED The id of the shipment for which package information is being updated.
206
+
207
+ body: {
208
+ "packages": [
209
+ {
210
+ "id": "string",
211
+ "dimensions": {
212
+ "length": {
213
+ "value": "string",
214
+ "dimensionUnit": "CM"
215
+ },
216
+ "width": {
217
+ "value": "string",
218
+ "dimensionUnit": "CM"
219
+ },
220
+ "height": {
221
+ "value": "string",
222
+ "dimensionUnit": "CM"
223
+ },
224
+ },
225
+ "weight": {
226
+ "value": "string",
227
+ "weightUnit": "kilograms"
228
+ },
229
+ "hazmatLabels": [],
230
+ "packageLineItems": [
231
+ {
232
+ "packageLineItemId": "string",
233
+ "quantity": 1,
234
+ "serialNumbers": [],
235
+ "pieces": 1,
236
+ "countryOfOrigin": "ES"
237
+ }
238
+ ],
239
+ "status": "SHIPPED"
240
+ }
241
+ ]
242
+ }
243
+ Returns:
244
+ ApiResponse:
245
+ """
246
+
247
+ return await self._request(
248
+ fill_query_params(kwargs.pop("path"), shipmentId, packageId),
249
+ data=kwargs,
250
+ add_marketplace=False
251
+ )
252
+
253
+ @sp_endpoint("/externalFulfillment/shipments/2021-01-06/shipments/{}/packages/{}", method="PATCH")
254
+ async def update_package_status(self, shipmentId, packageId, **kwargs) -> ApiResponse:
255
+ """
256
+ update_package_status(self, shipmentId, **kwargs) -> ApiResponse
257
+
258
+ Updates the status of the packages.
259
+
260
+ **Usage Plan:**
261
+
262
+ ======================================
263
+ Rate (requests per second)
264
+ ======================================
265
+ 5
266
+ ======================================
267
+
268
+ For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
269
+
270
+ Args:
271
+ shipmentId:string | * REQUIRED The id of the shipment for which package information is being updated.
272
+ packageId:string | * REQUIRED The id of the shipment for which package information is being updated.
273
+ key status:string | * REQUIRED This field is deprecated. All the package status details should be defined in the body parameter.
274
+
275
+ body: {
276
+ "status": "SHIPPED",
277
+ "subStatus": "OUT_FOR_DELIVERY",
278
+ "reason": "OutForDelivery"
279
+ }
280
+
281
+ Returns:
282
+ ApiResponse:
283
+ """
284
+ params = {}
285
+ if "status" in kwargs:
286
+ params["status"] = kwargs.get("status")
287
+
288
+
289
+ return await self._request(
290
+ fill_query_params(kwargs.pop("path"), shipmentId, packageId),
291
+ params=params,
292
+ data=kwargs,
293
+ add_marketplace=False
294
+ )
295
+
296
+ @sp_endpoint("/externalFulfillment/shipments/2021-01-06/shipments/{}/invoice", method="POST")
297
+ async def generate_invoice(self, shipmentId, **kwargs) -> ApiResponse:
298
+ """
299
+ generate_invoice(self, shipmentId, **kwargs) -> ApiResponse
300
+
301
+ Generates and retrieves the invoice for the specified shipment.
302
+
303
+ **Usage Plan:**
304
+
305
+ ======================================
306
+ Rate (requests per second)
307
+ ======================================
308
+ 5
309
+ ======================================
310
+
311
+ For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
312
+
313
+ Args:
314
+ shipmentId:string | * REQUIRED The id of the shipment whose invoice is to be generated and retrieved.
315
+
316
+ Returns:
317
+ ApiResponse:
318
+ """
319
+
320
+ return await self._request(
321
+ fill_query_params(kwargs.pop("path"), shipmentId),
322
+ data=kwargs,
323
+ add_marketplace=False
324
+ )
325
+
326
+ @sp_endpoint("/externalFulfillment/shipments/2021-01-06/shipments/{}/invoice", method="GET")
327
+ async def retrieve_invoice(self, shipmentId, **kwargs) -> ApiResponse:
328
+ """
329
+ retrieve_invoice(self, shipmentId, **kwargs) -> ApiResponse
330
+
331
+ Retrieves invoice for the specified shipment.
332
+
333
+ **Usage Plan:**
334
+
335
+ ======================================
336
+ Rate (requests per second)
337
+ ======================================
338
+ 5
339
+ ======================================
340
+
341
+ For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
342
+
343
+ Args:
344
+ shipmentId:string | * REQUIRED The id of the shipment whose invoice is to be retrieved.
345
+
346
+ Returns:
347
+ ApiResponse:
348
+
349
+ """
350
+
351
+ return await self._request(
352
+ fill_query_params(kwargs.pop("path"), shipmentId),
353
+ params=kwargs,
354
+ add_marketplace=False
355
+ )
356
+
357
+ @sp_endpoint("/externalFulfillment/shipments/2021-01-06/shippingOptions", method="GET")
358
+ async def retrieve_shipping_options(self, shipmentId, packageId, **kwargs) -> ApiResponse:
359
+ """
360
+ retrieve_shipping_options(self, shipmentId, packageId, **kwargs) -> ApiResponse
361
+
362
+ An API for a client to retrieve an optional list of shippingOptions that marketplace/channel provides
363
+ for the pickup of the packages of an shipment. This API will return a list of shippingOptions if the
364
+ marketplace/channel provides transportation and allows the seller to choose a shippingOption. If the
365
+ marketplace/channel does not allow for a shippingOption to be selected, but has a pre-determined shippingOption,
366
+ then this API will return an empty response.
367
+
368
+ **Usage Plan:**
369
+
370
+ ======================================
371
+ Rate (requests per second)
372
+ ======================================
373
+ 1
374
+ ======================================
375
+
376
+ For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
377
+
378
+ Args:
379
+ shipmentId:string | * REQUIRED The id of the shipment for which available shipping option needs to be fetched.
380
+ packageId:string | * REQUIRED The id of the package for which available shipping option needs to be fetched.
381
+
382
+ Returns:
383
+ ApiResponse:
384
+ """
385
+ params = {"shipmentId": shipmentId, "packageId": packageId}
386
+ return await self._request(kwargs.pop("path"), params=params, add_marketplace=False)
387
+
388
+ @sp_endpoint("/externalFulfillment/shipments/2021-01-06/shipments/{}/shipLabels", method="PUT")
389
+ async def generate_ship_labels(self, shipmentId, operation, **kwargs) -> ApiResponse:
390
+ """
391
+ generate_ship_labels(self, shipmentId, operation, **kwargs) -> ApiResponse
392
+
393
+ Generates and retrieves all ship-labels for one or more packages in the specified shipment.
394
+
395
+ **Usage Plan:**
396
+
397
+ ======================================
398
+ Rate (requests per second)
399
+ ======================================
400
+ 1
401
+ ======================================
402
+
403
+ For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
404
+
405
+ Args:
406
+ shipmentId:string | * REQUIRED The id of the shipment whose ship-label is to be generated and retrieved.
407
+ key shippingOptionId:string | The id of the shippingOption for which a ship-label is to be generated and retrieved. Applicable only for MFN channels.
408
+ operation:string | * REQUIRED The operation which says it is generation or regeneration of label. Valid values are GENERATE, REGENERATE
409
+
410
+ body: {
411
+ "packageIds": [
412
+ "string"
413
+ ],
414
+ "courierSupportedAttributes": {
415
+ "carrierName": "string",
416
+ "trackingId": "string"
417
+ }
418
+ }
419
+ Returns:
420
+ ApiResponse:
421
+ """
422
+
423
+ params = {"operation": operation}
424
+ if "shippingOptionId" in kwargs:
425
+ params["shippingOptionId"] = kwargs.pop("shippingOptionId")
426
+
427
+ return await self._request(
428
+ fill_query_params(kwargs.pop("path"), shipmentId),
429
+ params=params,
430
+ data=kwargs,
431
+ add_marketplace=False
432
+ )
433
+
434
+ @sp_endpoint("/externalFulfillment/shipments/2021-01-06/shipments/{}/packages/{}/shipLabel", method="GET")
435
+ async def retrieve_ship_label(self, shipmentId, packageId, **kwargs) -> ApiResponse:
436
+ """
437
+ retrieve_ship_label(self, shipmentId, packageId, **kwargs) -> ApiResponse
438
+
439
+ retrieves a ship-label for the specified package in the specified shipment.
440
+
441
+ **Usage Plan:**
442
+
443
+ ======================================
444
+ Rate (requests per second)
445
+ ======================================
446
+ 1
447
+ ======================================
448
+
449
+ For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
450
+
451
+ Args:
452
+ shipmentId:string | * REQUIRED The id of the shipment whose ship-label is to be generated and retrieved.
453
+ packageId:string | * REQUIRED The id of the package for which a ship-label is to be generated and retrieved.
454
+
455
+ Returns:
456
+ ApiResponse:
457
+ """
458
+
459
+ return await self._request(
460
+ fill_query_params(kwargs.pop("path"), shipmentId, packageId),
461
+ params=kwargs,
462
+ add_marketplace=False
463
+ )
464
+
465
+ @sp_endpoint("/externalFulfillment/returns/2021-08-19/returns", method="GET")
466
+ async def list_returns(self, **kwargs) -> ApiResponse:
467
+ """
468
+ list_returns(self, **kwargs) -> ApiResponse
469
+
470
+ Get a list of return items dropped for the seller in the specified node, and in the specified status. Returns can be further filtered based on their creation date/time
471
+
472
+ **Usage Plans:**
473
+
474
+ ======================================
475
+ Rate (requests per second)
476
+ ======================================
477
+ 5
478
+ ======================================
479
+
480
+ For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
481
+
482
+ Args:
483
+ key returnLocationId:string | The SmartConnect location identifier for which return items are to be retrieved
484
+ key rmaId:string | The RMA id of the return items to be listed
485
+ key status:string | Retrieves only those return items which are in the specified status. The most common use-case would be to fetch all new return items which would be in the CREATED status
486
+ key reverseTrackingId:string | The reverseTrackingId of the return items to be listed
487
+ key createdSince:string | Return items whose creation is after the specified date/time are included in the response. This field should be in the ISO8601 date/time format.
488
+ key createdUntil:string | Return items whose creation is before the specified date/time are included in the response. This field should be in the ISO8601 date/time format.
489
+ key lastUpdatedSince:string | Return items whose last update is after the specified date/time are included in the response. This field should be in the ISO8601 date/time format. Only to be used along with returnLocationId and status params.
490
+ key lastUpdatedUntil:string | Return items whose last update is before the specified date/time are included in the response. This field should be in the ISO8601 date/time format. Only to be used along with returnLocationId and status params.
491
+ key lastUpdatedAfter:string | DEPRECATED. Use createdFrom param instead for same results. Return items whose creation is after the specified date/time are included in the response. This field should be in the ISO8601 date/time format.
492
+ key lastUpdatedBefore:string | DEPRECATED. Use createdTo param instead for same results. Return items whose creation is before the specified date/time are included in the response. This field should be in the ISO8601 date/time format.
493
+ key maxResults:integer | Specify the number of return items to be included in the response. It will default to 10 in case not provided. Maximum limit is 100.
494
+ key nextToken:string | A cursor representing information about the next page of returns. Use the value returned in previous calls to page through the complete list of returns.
495
+
496
+ Returns:
497
+ ApiResponse:
498
+ """
499
+
500
+ return await self._request(kwargs.pop("path"), params=kwargs, add_marketplace=False)
501
+
502
+ @sp_endpoint("/externalFulfillment/returns/2021-08-19/returns/{}", method="GET")
503
+ async def get_return(self, returnId, **kwargs) -> ApiResponse:
504
+ """
505
+ get_return(self, returnId, **kwargs) -> ApiResponse
506
+
507
+ Get a single return item with the specified id.
508
+
509
+ **Usage Plan:**
510
+
511
+ ======================================
512
+ Rate (requests per second)
513
+ ======================================
514
+ 5
515
+ ======================================
516
+
517
+ For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
518
+
519
+ Args:
520
+ returnId:string | * REQUIRED The id of the return item to be retrieved.
521
+
522
+ Returns:
523
+ ApiResponse:
524
+ """
525
+ return await self._request(
526
+ fill_query_params(kwargs.pop("path"), returnId),
527
+ params=kwargs,
528
+ add_marketplace=False,
529
+ )
530
+
531
+ @sp_endpoint("/externalFulfillment/returns/2021-08-19/returns/{}", method="PATCH")
532
+ async def process_return_item(self, returnId, **kwargs) -> ApiResponse:
533
+ """
534
+ process_return_item(self, returnId, **kwargs) -> ApiResponse
535
+
536
+ Process a return by grading. Determine the item condition and update the quantities for each item condition.
537
+
538
+ **Usage Plan:**
539
+
540
+ ======================================
541
+ Rate (requests per second)
542
+ ======================================
543
+ 5
544
+ ======================================
545
+
546
+ For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
547
+
548
+ Args:
549
+ returnId:string | * REQUIRED The id of the return item to be retrieved.
550
+
551
+ body: {
552
+ "op": "increment",
553
+ "path": "/processedReturns",
554
+ "value": {
555
+ "Sellable": 0,
556
+ "Defective": 0,
557
+ "CustomerDamaged": 0,
558
+ "CarrierDamaged": 0,
559
+ "Fraud": 0,
560
+ "WrongItem": 0
561
+ }
562
+ }
563
+
564
+ Returns:
565
+ ApiResponse:
566
+ """
567
+
568
+ headers = await self._get_headers()
569
+ if "x-amzn-idempotency-token" in kwargs:
570
+ headers["x-amzn-idempotency-token"] = kwargs.pop("x-amzn-idempotency-token")
571
+ else:
572
+ headers["x-amzn-idempotency-token"] = str(uuid.uuid4())
573
+
574
+ return await self._request(
575
+ fill_query_params(kwargs.pop("path"), returnId),
576
+ data=kwargs,
577
+ headers=headers,
578
+ add_marketplace=False,
579
+ )
580
+
581
+ @sp_endpoint("/externalFulfillment/inventory/2021-01-06/locations/{}/skus/{}", method="GET")
582
+ async def get_inventory(self, locationId, skuId, **kwargs) -> ApiResponse:
583
+ """
584
+ get_inventory(self, locationId, skuId, **kwargs) -> ApiResponse
585
+
586
+ Get the current inventory for a given SKU at a given location.
587
+
588
+ **Usage Plan:**
589
+
590
+ ======================================
591
+ Rate (requests per second)
592
+ ======================================
593
+ 5
594
+ ======================================
595
+
596
+ For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
597
+
598
+ Args:
599
+ locationId:string | * REQUIRED The node identifier for the seller's location in smart connect for which inventory is being updated
600
+ skuId:string | * REQUIRED The seller's identifier for the SKU for which inventory is being updated
601
+
602
+ Returns:
603
+ ApiResponse:
604
+ """
605
+ return await self._request(
606
+ fill_query_params(kwargs.pop("path"), locationId, skuId),
607
+ params=kwargs,
608
+ add_marketplace=False,
609
+ )
610
+
611
+ @sp_endpoint("/externalFulfillment/inventory/2021-01-06/locations/{}/skus/{}", method="PUT")
612
+ async def update_inventory(self, locationId, skuId, quantity, **kwargs) -> ApiResponse:
613
+ """
614
+ update_inventory(self, locationId, skuId, quantity, **kwargs) -> ApiResponse
615
+
616
+ Get the current inventory for a given SKU at a given location.
617
+
618
+ **Usage Plan:**
619
+
620
+ ======================================
621
+ Rate (requests per second)
622
+ ======================================
623
+ 5
624
+ ======================================
625
+
626
+ For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
627
+
628
+ Args:
629
+ locationId:string | * REQUIRED The node identifier for the seller's location in smart connect for which inventory is being updated
630
+ skuId:string | * REQUIRED The seller's identifier for the SKU for which inventory is being updated
631
+ quantity:integer | * REQUIRED The absolute number of items of the specified SKU available at the specified node. This value should always be a non-zero or zero positive integer
632
+ key if_match:string | A unique number provided with each call to update the inventory. This number must be latest version of entity that exist in system. It will be equal to comparison against existing version of entity.
633
+ key if_unmodified_since:string | Timestamp or increasing number which does greater than comparison before applying the change. This is different than version of entity and used to overwrite the latest data. It should follow data/time format of rfc2616
634
+
635
+ Returns:
636
+ ApiResponse:
637
+ """
638
+ kwargs["quantity"] = quantity
639
+
640
+ if "if_match" in kwargs:
641
+ kwargs.pop("if_match")
642
+ if "if_unmodified_since" in kwargs:
643
+ kwargs.pop("if_unmodified_since")
644
+
645
+ return await self._request(
646
+ fill_query_params(kwargs.pop("path"), locationId, skuId),
647
+ params=kwargs,
648
+ add_marketplace=False,
649
+ )
650
+
651
+ @sp_endpoint("/externalFulfillment/inventory/2024-09-11/inventories", method="POST")
652
+ async def batch_inventory(self, **kwargs) -> ApiResponse:
653
+ """
654
+ batch_inventory(self, **kwargs) -> ApiResponse
655
+
656
+ Returns the set of responses that correspond to the batched list of up to 10 requests defined in the request
657
+ body. The response for each successful (HTTP status code 200) request in the set includes the inventory count
658
+ for provided sku and locationId pair
659
+
660
+ **Usage Plan:**
661
+
662
+ ======================================
663
+ Rate (requests per second)
664
+ ======================================
665
+ 5
666
+ ======================================
667
+
668
+ For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
669
+
670
+ Args:
671
+ body: {
672
+ "requests": [
673
+ {
674
+ "method": "POST",
675
+ "uri": "/inventory/update?locationId=EXSB&skuId=efptestsku1",
676
+ "body": {
677
+ "quantity": 15,
678
+ "clientSequenceNumber": 12345678,
679
+ "marketplaceAttributes": {
680
+ "marketplaceId": "AXJDDKDFDKDF",
681
+ "channelName": "FBA"
682
+ }
683
+ }
684
+ },
685
+ {
686
+ "method": "POST",
687
+ "uri": "/inventory/fetch?locationId=EXSB&skuId=efptestsku2",
688
+ "body": {
689
+ "marketplaceAttributes": {
690
+ "marketplaceId": "AXJDDKDFDKDF",
691
+ "channelName": "FBA"
692
+ }
693
+ }
694
+ }
695
+ ]
696
+ }
697
+
698
+ Returns:
699
+ ApiResponse:
700
+ """
701
+
702
+ return await self._request(
703
+ kwargs.pop("path"),
704
+ data=kwargs,
705
+ add_marketplace=False,
706
+ )