python-amazon-sp-api 1.9.48__py3-none-any.whl → 1.9.50__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-amazon-sp-api
3
- Version: 1.9.48
3
+ Version: 1.9.50
4
4
  Summary: Python wrapper for the Amazon Selling-Partner API
5
5
  Home-page: https://github.com/saleweaver/python-amazon-sp-api
6
6
  Author: Michael
@@ -1,8 +1,8 @@
1
- python_amazon_sp_api-1.9.48.data/scripts/make_endpoint,sha256=QWcwG6z4RWFJlzj4-xyHJymjObyKtwkvWFRq8T18iG0,8568
2
- python_amazon_sp_api-1.9.48.dist-info/licenses/LICENSE,sha256=nbzomPIVo1PVl5bpGAntofsYAF7ZQ2UhzOtKgf7IiNw,1071
1
+ python_amazon_sp_api-1.9.50.data/scripts/make_endpoint,sha256=QWcwG6z4RWFJlzj4-xyHJymjObyKtwkvWFRq8T18iG0,8568
2
+ python_amazon_sp_api-1.9.50.dist-info/licenses/LICENSE,sha256=nbzomPIVo1PVl5bpGAntofsYAF7ZQ2UhzOtKgf7IiNw,1071
3
3
  sp_api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
- sp_api/__version__.py,sha256=0xnicgHViArTE7XX9oDWtL51xlVbR4WryMZRKpTyisk,23
5
- sp_api/api/__init__.py,sha256=t29_Sr8XGPM2fD9tmD12Xb5hrOevyPRMK67cGbzc8vw,4560
4
+ sp_api/__version__.py,sha256=HwU8ev_LvnmUymqIM1k8sp71L5ylSqIvIgR_YPZBizo,23
5
+ sp_api/api/__init__.py,sha256=spVkblGMx7S74LLEAE2ztM6aWoX_aww7WJs4iL5a7xs,4663
6
6
  sp_api/api/amazon_warehousing_and_distribu/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
7
  sp_api/api/amazon_warehousing_and_distribu/amazon_warehousing_and_distribu.py,sha256=bMBIxIj0eu6Gi6WY3XLdHHYDzNCwz0-9X59Jo9DoqfE,5863
8
8
  sp_api/api/aplus_content/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -21,6 +21,8 @@ sp_api/api/data_kiosk/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3h
21
21
  sp_api/api/data_kiosk/data_kiosk.py,sha256=OyLyXtpAmPhfeDUqU2O7ovZ5e7K_ZAEcfyv3INNecyc,12175
22
22
  sp_api/api/easy_ship/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
23
23
  sp_api/api/easy_ship/easy_ship.py,sha256=dVw0wZKWoDc0miqakUYgU17neODeLt0q6HTlpBXIpWw,11001
24
+ sp_api/api/external_fulfillment/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
25
+ sp_api/api/external_fulfillment/external_fulfillment.py,sha256=6mXwCzcWhzMZmUK_ViG0jadXsB4Vpt3E9SdG-QMa4g4,28671
24
26
  sp_api/api/fba_inbound_eligibility/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
25
27
  sp_api/api/fba_inbound_eligibility/fba_inbound_eligibility.py,sha256=rwzr7OF69b9OuNiq8wd2yL62_aGKgP8dAhkibUSjFcA,4425
26
28
  sp_api/api/fba_small_and_light/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -123,7 +125,7 @@ sp_api/util/key_maker.py,sha256=T4I2rdBZzvWtX32qgrv9DA5EzVK3LEAWtbRffup-_kE,2172
123
125
  sp_api/util/load_all_pages.py,sha256=K6Suml4_GWZ5L9-YcnhaM9q-dA7Xr6wNLE-kWP_8MPk,1839
124
126
  sp_api/util/load_date_bound.py,sha256=j9gu9WucENqU9xaQ-xG7c4yK4RB-FXK39_r1mLT76z0,1726
125
127
  sp_api/util/retry.py,sha256=V8SeSeX3Brdou138hNA5HeQkKlHppZcqbZobIDjmBYw,2407
126
- python_amazon_sp_api-1.9.48.dist-info/METADATA,sha256=dtVGjPH7e0BPDV1oAL5mi0or4zia3KCSCFsnx8y92NE,5994
127
- python_amazon_sp_api-1.9.48.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
128
- python_amazon_sp_api-1.9.48.dist-info/top_level.txt,sha256=mEzPMFyyy0LmJGY4KFXfh5usUka4eeouIr7-2IAzoE0,7
129
- python_amazon_sp_api-1.9.48.dist-info/RECORD,,
128
+ python_amazon_sp_api-1.9.50.dist-info/METADATA,sha256=IpAJYv2MmwbEvMPP2lTWhQjZLfgjr5NJj4N0H4uYv1s,5994
129
+ python_amazon_sp_api-1.9.50.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
130
+ python_amazon_sp_api-1.9.50.dist-info/top_level.txt,sha256=mEzPMFyyy0LmJGY4KFXfh5usUka4eeouIr7-2IAzoE0,7
131
+ python_amazon_sp_api-1.9.50.dist-info/RECORD,,
sp_api/__version__.py CHANGED
@@ -1 +1 @@
1
- __version__ = '1.9.48'
1
+ __version__ = '1.9.50'
sp_api/api/__init__.py CHANGED
@@ -97,6 +97,8 @@ from .amazon_warehousing_and_distribu.amazon_warehousing_and_distribu import (
97
97
  AmazonWarehousingAndDistributionVersion,
98
98
  )
99
99
 
100
+ from .external_fulfillment.external_fulfillment import ExternalFulfillment
101
+
100
102
  __all__ = [
101
103
  "Sales",
102
104
  "Products",
@@ -115,6 +117,7 @@ __all__ = [
115
117
  "FulfillmentInbound",
116
118
  "MerchantFulfillment",
117
119
  ##### DO NOT DELETE ########## INSERT TITLE HERE #######
120
+ "ExternalFulfillment",
118
121
  "ApplicationIntegrations",
119
122
 
120
123
  "FulfillmentInbound",
File without changes
@@ -0,0 +1,706 @@
1
+ import uuid
2
+
3
+ from sp_api.base import Client, sp_endpoint, ApiResponse, fill_query_params
4
+
5
+
6
+ class ExternalFulfillment(Client):
7
+ """
8
+ ExternalFulfillment SP-API Client
9
+ :link:
10
+
11
+ The Selling Partner API to work with Amazon External Fulfillment shipments management/processing services.
12
+ """
13
+
14
+ @sp_endpoint("/externalFulfillment/2024-09-11/shipments", method="GET")
15
+ def get_shipments(self, **kwargs) -> ApiResponse:
16
+ """
17
+ get_shipments(self, **kwargs) -> ApiResponse
18
+
19
+ 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.
20
+
21
+ **Usage Plans:**
22
+
23
+ ======================================
24
+ Rate (requests per second)
25
+ ======================================
26
+ 5
27
+ ======================================
28
+
29
+ For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
30
+
31
+ Args:
32
+ key locationId:string | The SmartConnect location identifier for which shipments are to be retrieved
33
+ key channelName:string | The channel name associated with the location. Valid values are FBA, MFN
34
+ 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.
35
+ 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.
36
+ 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.
37
+ key maxResults:integer | Specify the number of shipments to be included in the response.
38
+ key paginationToken:string | The nexToken value returned from a previous call to get shipments. Use this to retrieve the next page of shipments.
39
+ Returns:
40
+ ApiResponse:
41
+ """
42
+
43
+ return self._request(kwargs.pop("path"), params=kwargs)
44
+
45
+ @sp_endpoint("/externalFulfillment/2024-09-11/shipments/{}", method="GET")
46
+ def get_shipment(self, shipmentId, **kwargs) -> ApiResponse:
47
+ """
48
+ get_shipment(self, shipmentId, **kwargs) -> ApiResponse
49
+
50
+ Get a single shipment with the specified id.
51
+
52
+ **Usage Plan:**
53
+
54
+ ======================================
55
+ Rate (requests per second)
56
+ ======================================
57
+ 5
58
+ ======================================
59
+
60
+ For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
61
+
62
+ Args:
63
+ shipmentId:string | * REQUIRED The id of the shipment to be retrieved.
64
+
65
+ Returns:
66
+ ApiResponse:
67
+ """
68
+ return self._request(
69
+ fill_query_params(kwargs.pop("path"), shipmentId),
70
+ params=kwargs,
71
+ add_marketplace=False,
72
+ )
73
+
74
+ @sp_endpoint("/externalFulfillment/shipments/2021-01-06/shipments/{}", method="POST")
75
+ def process_shipment(self, shipmentId, operation, **kwargs) -> ApiResponse:
76
+ """
77
+ process_shipment(self, shipmentId, **kwargs) -> ApiResponse
78
+
79
+ Confirms/Rejects that a seller will be fulfilling or cancelling the specified shipment.
80
+
81
+ **Usage Plan:**
82
+
83
+ ======================================
84
+ Rate (requests per second)
85
+ ======================================
86
+ 5
87
+ ======================================
88
+
89
+ For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
90
+
91
+ Args:
92
+ shipmentId:string | * REQUIRED The id of the shipment which is to be confirmed for fulfillment.
93
+ operation:string | * REQUIRED The status in which shipment should be moved. Valid values are CONFIRM and REJECT.
94
+
95
+ body: {
96
+ "referenceId": "string",
97
+ "lineItems": [
98
+ {
99
+ "lineItem": {
100
+ "id": "string",
101
+ "quantity": 1
102
+ },
103
+ "reason": "OUT_OF_STOCK"
104
+ }
105
+ ]
106
+ }
107
+
108
+ Returns:
109
+ ApiResponse:
110
+ """
111
+ return self._request(
112
+ fill_query_params(kwargs.pop("path"), shipmentId),
113
+ params={"operation": operation},
114
+ data=kwargs,
115
+ add_marketplace=False,
116
+ )
117
+
118
+
119
+ @sp_endpoint("/externalFulfillment/shipments/2021-01-06/shipments/{}/packages", method="POST")
120
+ def create_packages(self, shipmentId, **kwargs) -> ApiResponse:
121
+ """
122
+ create_packages(self, shipmentId, **kwargs) -> ApiResponse
123
+
124
+ Provides details about the packages that will be used to fulfill the specified shipment.
125
+
126
+ **Usage Plan:**
127
+
128
+ ======================================
129
+ Rate (requests per second)
130
+ ======================================
131
+ 5
132
+ ======================================
133
+
134
+ For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
135
+
136
+ Args:
137
+ shipmentId:string | * REQUIRED The id of the shipment for which package information is being provided.
138
+
139
+ body: {
140
+ "packages": [
141
+ {
142
+ "id": "string",
143
+ "dimensions": {
144
+ "length": {
145
+ "value": "string",
146
+ "dimensionUnit": "CM"
147
+ },
148
+ "width": {
149
+ "value": "string",
150
+ "dimensionUnit": "CM"
151
+ },
152
+ "height": {
153
+ "value": "string",
154
+ "dimensionUnit": "CM"
155
+ },
156
+ },
157
+ "weight": {
158
+ "value": "string",
159
+ "weightUnit": "kilograms"
160
+ },
161
+ "hazmatLabels": [],
162
+ "packageLineItems": [
163
+ {
164
+ "packageLineItemId": "string",
165
+ "quantity": 1,
166
+ "serialNumbers": [],
167
+ "pieces": 1,
168
+ "countryOfOrigin": "ES"
169
+ }
170
+ ],
171
+ "status": "CREATED"
172
+ }
173
+ ]
174
+ }
175
+ Returns:
176
+ ApiResponse:
177
+ """
178
+
179
+ return self._request(
180
+ fill_query_params(kwargs.pop("path"), shipmentId),
181
+ data=kwargs,
182
+ add_marketplace=False
183
+ )
184
+
185
+ @sp_endpoint("/externalFulfillment/shipments/2021-01-06/shipments/{}/packages/{}", method="PUT")
186
+ def update_package(self, shipmentId, packageId, **kwargs) -> ApiResponse:
187
+ """
188
+ update_package(self, shipmentId, packageId, **kwargs) -> ApiResponse
189
+
190
+ Updates the details about the packages that will be used to fulfill the specified shipment.
191
+
192
+ **Usage Plan:**
193
+
194
+ ======================================
195
+ Rate (requests per second)
196
+ ======================================
197
+ 5
198
+ ======================================
199
+
200
+ For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
201
+
202
+ Args:
203
+ shipmentId:string | * REQUIRED The id of the shipment for which package information is being updated.
204
+ packageId:string | * REQUIRED The id of the shipment for which package information is being updated.
205
+
206
+ body: {
207
+ "packages": [
208
+ {
209
+ "id": "string",
210
+ "dimensions": {
211
+ "length": {
212
+ "value": "string",
213
+ "dimensionUnit": "CM"
214
+ },
215
+ "width": {
216
+ "value": "string",
217
+ "dimensionUnit": "CM"
218
+ },
219
+ "height": {
220
+ "value": "string",
221
+ "dimensionUnit": "CM"
222
+ },
223
+ },
224
+ "weight": {
225
+ "value": "string",
226
+ "weightUnit": "kilograms"
227
+ },
228
+ "hazmatLabels": [],
229
+ "packageLineItems": [
230
+ {
231
+ "packageLineItemId": "string",
232
+ "quantity": 1,
233
+ "serialNumbers": [],
234
+ "pieces": 1,
235
+ "countryOfOrigin": "ES"
236
+ }
237
+ ],
238
+ "status": "SHIPPED"
239
+ }
240
+ ]
241
+ }
242
+ Returns:
243
+ ApiResponse:
244
+ """
245
+
246
+ return self._request(
247
+ fill_query_params(kwargs.pop("path"), shipmentId, packageId),
248
+ data=kwargs,
249
+ add_marketplace=False
250
+ )
251
+
252
+ @sp_endpoint("/externalFulfillment/shipments/2021-01-06/shipments/{}/packages/{}", method="PATCH")
253
+ def update_package_status(self, shipmentId, packageId, **kwargs) -> ApiResponse:
254
+ """
255
+ update_package_status(self, shipmentId, **kwargs) -> ApiResponse
256
+
257
+ Updates the status of the packages.
258
+
259
+ **Usage Plan:**
260
+
261
+ ======================================
262
+ Rate (requests per second)
263
+ ======================================
264
+ 5
265
+ ======================================
266
+
267
+ For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
268
+
269
+ Args:
270
+ shipmentId:string | * REQUIRED The id of the shipment for which package information is being updated.
271
+ packageId:string | * REQUIRED The id of the shipment for which package information is being updated.
272
+ key status:string | * REQUIRED This field is deprecated. All the package status details should be defined in the body parameter.
273
+
274
+ body: {
275
+ "status": "SHIPPED",
276
+ "subStatus": "OUT_FOR_DELIVERY",
277
+ "reason": "OutForDelivery"
278
+ }
279
+
280
+ Returns:
281
+ ApiResponse:
282
+ """
283
+ params = {}
284
+ if "status" in kwargs:
285
+ params["status"] = kwargs.get("status")
286
+
287
+
288
+ return self._request(
289
+ fill_query_params(kwargs.pop("path"), shipmentId, packageId),
290
+ params=params,
291
+ data=kwargs,
292
+ add_marketplace=False
293
+ )
294
+
295
+ @sp_endpoint("/externalFulfillment/shipments/2021-01-06/shipments/{}/invoice", method="POST")
296
+ def generate_invoice(self, shipmentId, **kwargs) -> ApiResponse:
297
+ """
298
+ generate_invoice(self, shipmentId, **kwargs) -> ApiResponse
299
+
300
+ Generates and retrieves the invoice for the specified shipment.
301
+
302
+ **Usage Plan:**
303
+
304
+ ======================================
305
+ Rate (requests per second)
306
+ ======================================
307
+ 5
308
+ ======================================
309
+
310
+ For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
311
+
312
+ Args:
313
+ shipmentId:string | * REQUIRED The id of the shipment whose invoice is to be generated and retrieved.
314
+
315
+ Returns:
316
+ ApiResponse:
317
+ """
318
+
319
+ return self._request(
320
+ fill_query_params(kwargs.pop("path"), shipmentId),
321
+ data=kwargs,
322
+ add_marketplace=False
323
+ )
324
+
325
+ @sp_endpoint("/externalFulfillment/shipments/2021-01-06/shipments/{}/invoice", method="GET")
326
+ def retrieve_invoice(self, shipmentId, **kwargs) -> ApiResponse:
327
+ """
328
+ retrieve_invoice(self, shipmentId, **kwargs) -> ApiResponse
329
+
330
+ Retrieves invoice for the specified shipment.
331
+
332
+ **Usage Plan:**
333
+
334
+ ======================================
335
+ Rate (requests per second)
336
+ ======================================
337
+ 5
338
+ ======================================
339
+
340
+ For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
341
+
342
+ Args:
343
+ shipmentId:string | * REQUIRED The id of the shipment whose invoice is to be retrieved.
344
+
345
+ Returns:
346
+ ApiResponse:
347
+
348
+ """
349
+
350
+ return self._request(
351
+ fill_query_params(kwargs.pop("path"), shipmentId),
352
+ params=kwargs,
353
+ add_marketplace=False
354
+ )
355
+
356
+ @sp_endpoint("/externalFulfillment/shipments/2021-01-06/shippingOptions", method="GET")
357
+ def retrieve_shipping_options(self, shipmentId, packageId, **kwargs) -> ApiResponse:
358
+ """
359
+ retrieve_shipping_options(self, shipmentId, packageId, **kwargs) -> ApiResponse
360
+
361
+ An API for a client to retrieve an optional list of shippingOptions that marketplace/channel provides
362
+ for the pickup of the packages of an shipment. This API will return a list of shippingOptions if the
363
+ marketplace/channel provides transportation and allows the seller to choose a shippingOption. If the
364
+ marketplace/channel does not allow for a shippingOption to be selected, but has a pre-determined shippingOption,
365
+ then this API will return an empty response.
366
+
367
+ **Usage Plan:**
368
+
369
+ ======================================
370
+ Rate (requests per second)
371
+ ======================================
372
+ 1
373
+ ======================================
374
+
375
+ For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
376
+
377
+ Args:
378
+ shipmentId:string | * REQUIRED The id of the shipment for which available shipping option needs to be fetched.
379
+ packageId:string | * REQUIRED The id of the package for which available shipping option needs to be fetched.
380
+
381
+ Returns:
382
+ ApiResponse:
383
+ """
384
+ params = {"shipmentId": shipmentId, "packageId": packageId}
385
+ return self._request(kwargs.pop("path"), params=params, add_marketplace=False)
386
+
387
+ @sp_endpoint("/externalFulfillment/shipments/2021-01-06/shipments/{}/shipLabels", method="PUT")
388
+ def generate_ship_labels(self, shipmentId, operation, **kwargs) -> ApiResponse:
389
+ """
390
+ generate_ship_labels(self, shipmentId, operation, **kwargs) -> ApiResponse
391
+
392
+ Generates and retrieves all ship-labels for one or more packages in the specified shipment.
393
+
394
+ **Usage Plan:**
395
+
396
+ ======================================
397
+ Rate (requests per second)
398
+ ======================================
399
+ 1
400
+ ======================================
401
+
402
+ For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
403
+
404
+ Args:
405
+ shipmentId:string | * REQUIRED The id of the shipment whose ship-label is to be generated and retrieved.
406
+ key shippingOptionId:string | The id of the shippingOption for which a ship-label is to be generated and retrieved. Applicable only for MFN channels.
407
+ operation:string | * REQUIRED The operation which says it is generation or regeneration of label. Valid values are GENERATE, REGENERATE
408
+
409
+ body: {
410
+ "packageIds": [
411
+ "string"
412
+ ],
413
+ "courierSupportedAttributes": {
414
+ "carrierName": "string",
415
+ "trackingId": "string"
416
+ }
417
+ }
418
+ Returns:
419
+ ApiResponse:
420
+ """
421
+
422
+ params = {"operation": operation}
423
+ if "shippingOptionId" in kwargs:
424
+ params["shippingOptionId"] = kwargs.pop("shippingOptionId")
425
+
426
+ return self._request(
427
+ fill_query_params(kwargs.pop("path"), shipmentId),
428
+ params=params,
429
+ data=kwargs,
430
+ add_marketplace=False
431
+ )
432
+
433
+ @sp_endpoint("/externalFulfillment/shipments/2021-01-06/shipments/{}/packages/{}/shipLabel", method="GET")
434
+ def retrieve_ship_label(self, shipmentId, packageId, **kwargs) -> ApiResponse:
435
+ """
436
+ retrieve_ship_label(self, shipmentId, packageId, **kwargs) -> ApiResponse
437
+
438
+ retrieves a ship-label for the specified package in the specified shipment.
439
+
440
+ **Usage Plan:**
441
+
442
+ ======================================
443
+ Rate (requests per second)
444
+ ======================================
445
+ 1
446
+ ======================================
447
+
448
+ For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
449
+
450
+ Args:
451
+ shipmentId:string | * REQUIRED The id of the shipment whose ship-label is to be generated and retrieved.
452
+ packageId:string | * REQUIRED The id of the package for which a ship-label is to be generated and retrieved.
453
+
454
+ Returns:
455
+ ApiResponse:
456
+ """
457
+
458
+ return self._request(
459
+ fill_query_params(kwargs.pop("path"), shipmentId, packageId),
460
+ params=kwargs,
461
+ add_marketplace=False
462
+ )
463
+
464
+ @sp_endpoint("/externalFulfillment/returns/2021-08-19/returns", method="GET")
465
+ def list_returns(self, **kwargs) -> ApiResponse:
466
+ """
467
+ list_returns(self, **kwargs) -> ApiResponse
468
+
469
+ 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
470
+
471
+ **Usage Plans:**
472
+
473
+ ======================================
474
+ Rate (requests per second)
475
+ ======================================
476
+ 5
477
+ ======================================
478
+
479
+ For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
480
+
481
+ Args:
482
+ key returnLocationId:string | The SmartConnect location identifier for which return items are to be retrieved
483
+ key rmaId:string | The RMA id of the return items to be listed
484
+ 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
485
+ key reverseTrackingId:string | The reverseTrackingId of the return items to be listed
486
+ 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.
487
+ 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.
488
+ 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.
489
+ 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.
490
+ 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.
491
+ 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.
492
+ 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.
493
+ 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.
494
+
495
+ Returns:
496
+ ApiResponse:
497
+ """
498
+
499
+ return self._request(kwargs.pop("path"), params=kwargs, add_marketplace=False)
500
+
501
+ @sp_endpoint("/externalFulfillment/returns/2021-08-19/returns/{}", method="GET")
502
+ def get_return(self, returnId, **kwargs) -> ApiResponse:
503
+ """
504
+ get_return(self, returnId, **kwargs) -> ApiResponse
505
+
506
+ Get a single return item with the specified id.
507
+
508
+ **Usage Plan:**
509
+
510
+ ======================================
511
+ Rate (requests per second)
512
+ ======================================
513
+ 5
514
+ ======================================
515
+
516
+ For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
517
+
518
+ Args:
519
+ returnId:string | * REQUIRED The id of the return item to be retrieved.
520
+
521
+ Returns:
522
+ ApiResponse:
523
+ """
524
+ return self._request(
525
+ fill_query_params(kwargs.pop("path"), returnId),
526
+ params=kwargs,
527
+ add_marketplace=False,
528
+ )
529
+
530
+ @sp_endpoint("/externalFulfillment/returns/2021-08-19/returns/{}", method="PATCH")
531
+ def process_return_item(self, returnId, **kwargs) -> ApiResponse:
532
+ """
533
+ process_return_item(self, returnId, **kwargs) -> ApiResponse
534
+
535
+ Process a return by grading. Determine the item condition and update the quantities for each item condition.
536
+
537
+ **Usage Plan:**
538
+
539
+ ======================================
540
+ Rate (requests per second)
541
+ ======================================
542
+ 5
543
+ ======================================
544
+
545
+ For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
546
+
547
+ Args:
548
+ returnId:string | * REQUIRED The id of the return item to be retrieved.
549
+
550
+ body: {
551
+ "op": "increment",
552
+ "path": "/processedReturns",
553
+ "value": {
554
+ "Sellable": 0,
555
+ "Defective": 0,
556
+ "CustomerDamaged": 0,
557
+ "CarrierDamaged": 0,
558
+ "Fraud": 0,
559
+ "WrongItem": 0
560
+ }
561
+ }
562
+
563
+ Returns:
564
+ ApiResponse:
565
+ """
566
+
567
+ headers = self.headers.copy()
568
+ if "x-amzn-idempotency-token" in kwargs:
569
+ headers["x-amzn-idempotency-token"] = kwargs.pop("x-amzn-idempotency-token")
570
+ else:
571
+ headers["x-amzn-idempotency-token"] = str(uuid.uuid4())
572
+
573
+ return self._request(
574
+ fill_query_params(kwargs.pop("path"), returnId),
575
+ data=kwargs,
576
+ headers=headers,
577
+ add_marketplace=False,
578
+ )
579
+
580
+ @sp_endpoint("/externalFulfillment/inventory/2021-01-06/locations/{}/skus/{}", method="GET")
581
+ def get_inventory(self, locationId, skuId, **kwargs) -> ApiResponse:
582
+ """
583
+ get_inventory(self, locationId, skuId, **kwargs) -> ApiResponse
584
+
585
+ Get the current inventory for a given SKU at a given location.
586
+
587
+ **Usage Plan:**
588
+
589
+ ======================================
590
+ Rate (requests per second)
591
+ ======================================
592
+ 5
593
+ ======================================
594
+
595
+ For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
596
+
597
+ Args:
598
+ locationId:string | * REQUIRED The node identifier for the seller's location in smart connect for which inventory is being updated
599
+ skuId:string | * REQUIRED The seller's identifier for the SKU for which inventory is being updated
600
+
601
+ Returns:
602
+ ApiResponse:
603
+ """
604
+ return self._request(
605
+ fill_query_params(kwargs.pop("path"), locationId, skuId),
606
+ params=kwargs,
607
+ add_marketplace=False,
608
+ )
609
+
610
+ @sp_endpoint("/externalFulfillment/inventory/2021-01-06/locations/{}/skus/{}", method="PUT")
611
+ def update_inventory(self, locationId, skuId, quantity, **kwargs) -> ApiResponse:
612
+ """
613
+ update_inventory(self, locationId, skuId, quantity, **kwargs) -> ApiResponse
614
+
615
+ Get the current inventory for a given SKU at a given location.
616
+
617
+ **Usage Plan:**
618
+
619
+ ======================================
620
+ Rate (requests per second)
621
+ ======================================
622
+ 5
623
+ ======================================
624
+
625
+ For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
626
+
627
+ Args:
628
+ locationId:string | * REQUIRED The node identifier for the seller's location in smart connect for which inventory is being updated
629
+ skuId:string | * REQUIRED The seller's identifier for the SKU for which inventory is being updated
630
+ 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
631
+ 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.
632
+ 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
633
+
634
+ Returns:
635
+ ApiResponse:
636
+ """
637
+ kwargs["quantity"] = quantity
638
+
639
+ headers = self.headers.copy()
640
+ if "if_match" in kwargs:
641
+ headers["If-Match"] = kwargs.pop("if_match")
642
+ if "if_unmodified_since" in kwargs:
643
+ headers["If-Unmodified-Since"] = kwargs.pop("if_unmodified_since")
644
+
645
+ return 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
+ 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 self._request(
703
+ kwargs.pop("path"),
704
+ data=kwargs,
705
+ add_marketplace=False,
706
+ )