python-amazon-sp-api 1.7.5__py3-none-any.whl → 2.0.10__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (214) hide show
  1. {python_amazon_sp_api-1.7.5.data → python_amazon_sp_api-2.0.10.data}/scripts/make_endpoint +2 -2
  2. {python_amazon_sp_api-1.7.5.dist-info → python_amazon_sp_api-2.0.10.dist-info}/METADATA +58 -8
  3. python_amazon_sp_api-2.0.10.dist-info/RECORD +253 -0
  4. {python_amazon_sp_api-1.7.5.dist-info → python_amazon_sp_api-2.0.10.dist-info}/WHEEL +1 -1
  5. {python_amazon_sp_api-1.7.5.dist-info → python_amazon_sp_api-2.0.10.dist-info}/top_level.txt +0 -1
  6. sp_api/__version__.py +1 -1
  7. sp_api/api/__init__.py +48 -41
  8. sp_api/api/amazon_warehousing_and_distribu/amazon_warehousing_and_distribu.py +82 -76
  9. sp_api/api/aplus_content/aplus_content.py +76 -45
  10. sp_api/api/application_integrations/application_integrations.py +118 -0
  11. sp_api/api/application_management/application_management.py +6 -7
  12. sp_api/api/authorization/authorization.py +5 -5
  13. sp_api/api/catalog/catalog.py +9 -10
  14. sp_api/api/catalog_items/catalog_items.py +10 -13
  15. sp_api/api/customer_feedback/customer_feedback.py +110 -0
  16. sp_api/api/data_kiosk/data_kiosk.py +59 -39
  17. sp_api/api/easy_ship/easy_ship.py +190 -0
  18. sp_api/api/external_fulfillment/external_fulfillment.py +706 -0
  19. sp_api/api/fba_inbound_eligibility/fba_inbound_eligibility.py +23 -13
  20. sp_api/api/fba_small_and_light/fba_small_and_light.py +46 -20
  21. sp_api/api/feeds/feeds.py +60 -39
  22. sp_api/api/finances/finances.py +40 -9
  23. sp_api/api/fulfillment_inbound/fulfillment_inbound.py +844 -619
  24. sp_api/api/fulfillment_outbound/fulfillment_outbound.py +63 -57
  25. sp_api/api/inventories/inventories.py +13 -11
  26. sp_api/api/listings_items/listings_items.py +38 -25
  27. sp_api/api/listings_restrictions/listings_restrictions.py +6 -7
  28. sp_api/api/merchant_fulfillment/merchant_fulfillment.py +49 -36
  29. sp_api/api/messaging/messaging.py +129 -25
  30. sp_api/api/notifications/notifications.py +85 -45
  31. sp_api/api/orders/orders.py +123 -38
  32. sp_api/api/orders/orders_2026_01_01.py +54 -0
  33. sp_api/api/product_fees/product_fees.py +75 -67
  34. sp_api/api/product_type_definitions/product_type_definitions.py +9 -10
  35. sp_api/api/products/products.py +177 -53
  36. sp_api/api/products/products_definitions.py +11 -82
  37. sp_api/api/replenishment/replenishment.py +13 -11
  38. sp_api/api/reports/reports.py +113 -95
  39. sp_api/api/sales/sales.py +23 -13
  40. sp_api/api/sellers/sellers.py +3 -3
  41. sp_api/api/services/services.py +41 -30
  42. sp_api/api/shipping/shipping.py +39 -37
  43. sp_api/api/shipping/shippingV2.py +46 -30
  44. sp_api/api/solicitations/solicitations.py +20 -11
  45. sp_api/api/supply_sources/supply_sources.py +45 -37
  46. sp_api/api/tokens/tokens.py +4 -6
  47. sp_api/api/upload/upload.py +10 -8
  48. sp_api/api/vendor_direct_fulfillment_inventory/vendor_direct_fulfillment_inventory.py +10 -6
  49. sp_api/api/vendor_direct_fulfillment_orders/vendor_direct_fulfillment_orders.py +12 -14
  50. sp_api/api/vendor_direct_fulfillment_payments/vendor_direct_fulfillment_payments.py +4 -6
  51. sp_api/api/vendor_direct_fulfillment_shipping/vendor_direct_fulfillment_shipping.py +42 -37
  52. sp_api/api/vendor_direct_fulfillment_transactions/vendor_direct_fulfillment_transactions.py +8 -6
  53. sp_api/api/vendor_invoices/vendor_invoices.py +6 -4
  54. sp_api/api/vendor_orders/vendor_orders.py +16 -19
  55. sp_api/api/vendor_shipments/vendor_shipments.py +91 -262
  56. sp_api/api/vendor_transaction_status/vendor_transaction_status.py +6 -6
  57. sp_api/asyncio/api/__init__.py +167 -0
  58. sp_api/asyncio/api/amazon_warehousing_and_distribu/__init__.py +9 -0
  59. sp_api/asyncio/api/amazon_warehousing_and_distribu/amazon_warehousing_and_distribu.py +130 -0
  60. sp_api/asyncio/api/aplus_content/__init__.py +5 -0
  61. sp_api/asyncio/api/aplus_content/aplus_content.py +330 -0
  62. sp_api/asyncio/api/application_integrations/__init__.py +5 -0
  63. sp_api/asyncio/api/application_integrations/application_integrations.py +119 -0
  64. sp_api/asyncio/api/application_management/__init__.py +5 -0
  65. sp_api/asyncio/api/application_management/application_management.py +36 -0
  66. sp_api/asyncio/api/authorization/__init__.py +5 -0
  67. sp_api/asyncio/api/authorization/authorization.py +54 -0
  68. sp_api/asyncio/api/catalog/__init__.py +5 -0
  69. sp_api/asyncio/api/catalog/catalog.py +111 -0
  70. sp_api/asyncio/api/catalog_items/__init__.py +6 -0
  71. sp_api/asyncio/api/catalog_items/catalog_items.py +93 -0
  72. sp_api/asyncio/api/clients/__init__.py +1 -0
  73. sp_api/asyncio/api/customer_feedback/__init__.py +5 -0
  74. sp_api/asyncio/api/customer_feedback/customer_feedback.py +111 -0
  75. sp_api/asyncio/api/data_kiosk/__init__.py +5 -0
  76. sp_api/asyncio/api/data_kiosk/data_kiosk.py +236 -0
  77. sp_api/asyncio/api/easy_ship/__init__.py +5 -0
  78. sp_api/asyncio/api/easy_ship/easy_ship.py +191 -0
  79. sp_api/asyncio/api/external_fulfillment/__init__.py +5 -0
  80. sp_api/asyncio/api/external_fulfillment/external_fulfillment.py +706 -0
  81. sp_api/asyncio/api/fba_inbound_eligibility/__init__.py +5 -0
  82. sp_api/asyncio/api/fba_inbound_eligibility/fba_inbound_eligibility.py +96 -0
  83. sp_api/asyncio/api/fba_small_and_light/__init__.py +5 -0
  84. sp_api/asyncio/api/fba_small_and_light/fba_small_and_light.py +213 -0
  85. sp_api/asyncio/api/feeds/feeds.py +260 -0
  86. sp_api/asyncio/api/finances/finances.py +100 -0
  87. sp_api/asyncio/api/fulfillment_inbound/fulfillment_inbound.py +1798 -0
  88. sp_api/asyncio/api/fulfillment_outbound/fulfillment_outbound.py +736 -0
  89. sp_api/asyncio/api/inventories/inventories.py +74 -0
  90. sp_api/asyncio/api/listings_items/__init__.py +0 -0
  91. sp_api/asyncio/api/listings_items/listings_items.py +170 -0
  92. sp_api/asyncio/api/listings_restrictions/__init__.py +0 -0
  93. sp_api/asyncio/api/listings_restrictions/listings_restrictions.py +36 -0
  94. sp_api/asyncio/api/merchant_fulfillment/__init__.py +0 -0
  95. sp_api/asyncio/api/merchant_fulfillment/merchant_fulfillment.py +384 -0
  96. sp_api/asyncio/api/messaging/__init__.py +0 -0
  97. sp_api/asyncio/api/messaging/messaging.py +511 -0
  98. sp_api/asyncio/api/models/__init__.py +4 -0
  99. sp_api/asyncio/api/notifications/__init__.py +0 -0
  100. sp_api/asyncio/api/notifications/notifications.py +295 -0
  101. sp_api/asyncio/api/orders/__init__.py +0 -0
  102. sp_api/asyncio/api/orders/orders.py +412 -0
  103. sp_api/asyncio/api/orders/orders_2026_01_01.py +40 -0
  104. sp_api/asyncio/api/overrides/__init__.py +1 -0
  105. sp_api/asyncio/api/product_fees/__init__.py +0 -0
  106. sp_api/asyncio/api/product_fees/product_fees.py +194 -0
  107. sp_api/asyncio/api/product_type_definitions/__init__.py +0 -0
  108. sp_api/asyncio/api/product_type_definitions/product_type_definitions.py +75 -0
  109. sp_api/asyncio/api/products/__init__.py +0 -0
  110. sp_api/asyncio/api/products/products.py +405 -0
  111. sp_api/asyncio/api/products/products_definitions.py +11 -0
  112. sp_api/asyncio/api/replenishment/__init__.py +0 -0
  113. sp_api/asyncio/api/replenishment/replenishment.py +121 -0
  114. sp_api/asyncio/api/reports/__init__.py +0 -0
  115. sp_api/asyncio/api/reports/reports.py +439 -0
  116. sp_api/asyncio/api/sales/__init__.py +0 -0
  117. sp_api/asyncio/api/sales/sales.py +93 -0
  118. sp_api/asyncio/api/sellers/__init__.py +0 -0
  119. sp_api/asyncio/api/sellers/sellers.py +70 -0
  120. sp_api/asyncio/api/services/__init__.py +0 -0
  121. sp_api/asyncio/api/services/services.py +218 -0
  122. sp_api/asyncio/api/shipping/__init__.py +0 -0
  123. sp_api/asyncio/api/shipping/shipping.py +459 -0
  124. sp_api/asyncio/api/shipping/shippingV2.py +651 -0
  125. sp_api/asyncio/api/solicitations/__init__.py +0 -0
  126. sp_api/asyncio/api/solicitations/solicitations.py +78 -0
  127. sp_api/asyncio/api/supply_sources/__init__.py +0 -0
  128. sp_api/asyncio/api/supply_sources/supply_sources.py +138 -0
  129. sp_api/asyncio/api/tokens/__init__.py +0 -0
  130. sp_api/asyncio/api/tokens/tokens.py +65 -0
  131. sp_api/asyncio/api/upload/__init__.py +0 -0
  132. sp_api/asyncio/api/upload/upload.py +18 -0
  133. sp_api/asyncio/api/vendor_direct_fulfillment_inventory/__init__.py +0 -0
  134. sp_api/asyncio/api/vendor_direct_fulfillment_inventory/vendor_direct_fulfillment_inventory.py +64 -0
  135. sp_api/asyncio/api/vendor_direct_fulfillment_orders/__init__.py +0 -0
  136. sp_api/asyncio/api/vendor_direct_fulfillment_orders/vendor_direct_fulfillment_orders.py +196 -0
  137. sp_api/asyncio/api/vendor_direct_fulfillment_payments/__init__.py +0 -0
  138. sp_api/asyncio/api/vendor_direct_fulfillment_payments/vendor_direct_fulfillment_payments.py +254 -0
  139. sp_api/asyncio/api/vendor_direct_fulfillment_shipping/__init__.py +0 -0
  140. sp_api/asyncio/api/vendor_direct_fulfillment_shipping/vendor_direct_fulfillment_shipping.py +627 -0
  141. sp_api/asyncio/api/vendor_direct_fulfillment_transactions/__init__.py +0 -0
  142. sp_api/asyncio/api/vendor_direct_fulfillment_transactions/vendor_direct_fulfillment_transactions.py +43 -0
  143. sp_api/asyncio/api/vendor_invoices/__init__.py +0 -0
  144. sp_api/asyncio/api/vendor_invoices/vendor_invoices.py +295 -0
  145. sp_api/asyncio/api/vendor_orders/__init__.py +0 -0
  146. sp_api/asyncio/api/vendor_orders/vendor_orders.py +210 -0
  147. sp_api/asyncio/api/vendor_shipments/__init__.py +0 -0
  148. sp_api/asyncio/api/vendor_shipments/vendor_shipments.py +118 -0
  149. sp_api/asyncio/api/vendor_transaction_status/__init__.py +0 -0
  150. sp_api/asyncio/api/vendor_transaction_status/vendor_transaction_status.py +41 -0
  151. sp_api/asyncio/auth/__init__.py +12 -0
  152. sp_api/asyncio/auth/access_token_client.py +145 -0
  153. sp_api/asyncio/auth/exceptions.py +5 -0
  154. sp_api/asyncio/base/__init__.py +53 -0
  155. sp_api/asyncio/base/_transport_httpx.py +50 -0
  156. sp_api/asyncio/base/base_client.py +8 -0
  157. sp_api/asyncio/base/client.py +169 -0
  158. sp_api/asyncio/util/__init__.py +29 -0
  159. sp_api/asyncio/util/key_maker.py +5 -0
  160. sp_api/asyncio/util/load_all_pages.py +55 -0
  161. sp_api/asyncio/util/load_date_bound.py +53 -0
  162. sp_api/asyncio/util/retry.py +88 -0
  163. sp_api/auth/__init__.py +3 -3
  164. sp_api/auth/_core.py +39 -0
  165. sp_api/auth/access_token_client.py +20 -31
  166. sp_api/auth/access_token_response.py +4 -4
  167. sp_api/base/ApiResponse.py +5 -4
  168. sp_api/base/__init__.py +53 -42
  169. sp_api/base/_core.py +110 -0
  170. sp_api/base/_transport_httpx.py +39 -0
  171. sp_api/base/base_client.py +4 -4
  172. sp_api/base/client.py +131 -112
  173. sp_api/base/credential_provider.py +41 -34
  174. sp_api/base/exceptions.py +14 -3
  175. sp_api/base/feedTypes.py +44 -32
  176. sp_api/base/fulfillment_channel.py +2 -2
  177. sp_api/base/helpers.py +17 -16
  178. sp_api/base/identifiersType.py +8 -8
  179. sp_api/base/included_data.py +12 -12
  180. sp_api/base/marketplaces.py +5 -1
  181. sp_api/base/notifications.py +1 -1
  182. sp_api/base/processing_status.py +5 -5
  183. sp_api/base/reportTypes.py +198 -111
  184. sp_api/base/sales_enum.py +11 -13
  185. sp_api/util/__init__.py +42 -6
  186. sp_api/util/key_maker.py +4 -2
  187. sp_api/util/load_all_pages.py +16 -5
  188. sp_api/util/load_date_bound.py +28 -13
  189. sp_api/util/params.py +57 -0
  190. sp_api/util/product_fees.py +40 -0
  191. sp_api/util/products_definitions.py +169 -0
  192. sp_api/util/report_document.py +154 -0
  193. sp_api/util/retry.py +16 -15
  194. python_amazon_sp_api-1.7.5.dist-info/RECORD +0 -144
  195. tests/api/finances/test_finances.py +0 -19
  196. tests/api/notifications/test_notifications.py +0 -26
  197. tests/api/orders/test_orders.py +0 -122
  198. tests/api/product_fees/product_fees.py +0 -49
  199. tests/api/reports/test_reports.py +0 -127
  200. tests/client/test_auth.py +0 -59
  201. tests/client/test_base.py +0 -163
  202. tests/client/test_credential_provider.py +0 -45
  203. tests/client/test_helpers.py +0 -142
  204. {python_amazon_sp_api-1.7.5.dist-info → python_amazon_sp_api-2.0.10.dist-info/licenses}/LICENSE +0 -0
  205. {tests → sp_api/api/application_integrations}/__init__.py +0 -0
  206. {tests/api → sp_api/api/customer_feedback}/__init__.py +0 -0
  207. {tests/api/finances → sp_api/api/easy_ship}/__init__.py +0 -0
  208. {tests/api/notifications → sp_api/api/external_fulfillment}/__init__.py +0 -0
  209. {tests/api/orders → sp_api/asyncio}/__init__.py +0 -0
  210. {tests/api/product_fees → sp_api/asyncio/api/feeds}/__init__.py +0 -0
  211. {tests/api/reports → sp_api/asyncio/api/finances}/__init__.py +0 -0
  212. {tests/api/sellers → sp_api/asyncio/api/fulfillment_inbound}/__init__.py +0 -0
  213. {tests/client → sp_api/asyncio/api/fulfillment_outbound}/__init__.py +0 -0
  214. /tests/api/sellers/test_sellers.py → /sp_api/asyncio/api/inventories/__init__.py +0 -0
@@ -6,13 +6,12 @@ from sp_api.base import Client, sp_endpoint, fill_query_params, ApiResponse
6
6
  class FulfillmentOutbound(Client):
7
7
  """
8
8
  FulfillmentOutbound SP-API Client
9
- :link:
9
+ :link:
10
10
 
11
11
  The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders.
12
12
  """
13
13
 
14
-
15
- @sp_endpoint('/fba/outbound/2020-07-01/fulfillmentOrders/preview', method='POST')
14
+ @sp_endpoint("/fba/outbound/2020-07-01/fulfillmentOrders/preview", method="POST")
16
15
  def get_fulfillment_preview(self, **kwargs) -> ApiResponse:
17
16
  """
18
17
  get_fulfillment_preview(self, **kwargs) -> ApiResponse
@@ -108,16 +107,15 @@ class FulfillmentOutbound(Client):
108
107
  }
109
108
  ]
110
109
  }
111
-
110
+
112
111
 
113
112
  Returns:
114
113
  ApiResponse:
115
114
  """
116
-
117
- return self._request(kwargs.pop('path'), data=kwargs)
118
-
119
115
 
120
- @sp_endpoint('/fba/outbound/2020-07-01/fulfillmentOrders', method='GET')
116
+ return self._request(kwargs.pop("path"), data=kwargs)
117
+
118
+ @sp_endpoint("/fba/outbound/2020-07-01/fulfillmentOrders", method="GET")
121
119
  def list_all_fulfillment_orders(self, **kwargs) -> ApiResponse:
122
120
  """
123
121
  list_all_fulfillment_orders(self, **kwargs) -> ApiResponse
@@ -141,11 +139,10 @@ class FulfillmentOutbound(Client):
141
139
  Returns:
142
140
  ApiResponse:
143
141
  """
144
-
145
- return self._request(kwargs.pop('path'), params=kwargs)
146
-
147
142
 
148
- @sp_endpoint('/fba/outbound/2020-07-01/fulfillmentOrders', method='POST')
143
+ return self._request(kwargs.pop("path"), params=kwargs)
144
+
145
+ @sp_endpoint("/fba/outbound/2020-07-01/fulfillmentOrders", method="POST")
149
146
  def create_fulfillment_order(self, **kwargs) -> ApiResponse:
150
147
  """
151
148
  create_fulfillment_order(self, **kwargs) -> ApiResponse
@@ -322,16 +319,15 @@ class FulfillmentOutbound(Client):
322
319
  }
323
320
  ]
324
321
  }
325
-
322
+
326
323
 
327
324
  Returns:
328
325
  ApiResponse:
329
326
  """
330
-
331
- return self._request(kwargs.pop('path'), data=kwargs)
332
-
333
327
 
334
- @sp_endpoint('/fba/outbound/2020-07-01/tracking', method='GET')
328
+ return self._request(kwargs.pop("path"), data=kwargs)
329
+
330
+ @sp_endpoint("/fba/outbound/2020-07-01/tracking", method="GET")
335
331
  def get_package_tracking_details(self, **kwargs) -> ApiResponse:
336
332
  """
337
333
  get_package_tracking_details(self, **kwargs) -> ApiResponse
@@ -354,11 +350,10 @@ class FulfillmentOutbound(Client):
354
350
  Returns:
355
351
  ApiResponse:
356
352
  """
357
-
358
- return self._request(kwargs.pop('path'), params=kwargs)
359
-
360
353
 
361
- @sp_endpoint('/fba/outbound/2020-07-01/returnReasonCodes', method='GET')
354
+ return self._request(kwargs.pop("path"), params=kwargs)
355
+
356
+ @sp_endpoint("/fba/outbound/2020-07-01/returnReasonCodes", method="GET")
362
357
  def list_return_reason_codes(self, **kwargs) -> ApiResponse:
363
358
  """
364
359
  list_return_reason_codes(self, **kwargs) -> ApiResponse
@@ -385,16 +380,17 @@ class FulfillmentOutbound(Client):
385
380
  Returns:
386
381
  ApiResponse:
387
382
  """
388
-
389
- return self._request(kwargs.pop('path'), params=kwargs)
390
-
391
383
 
392
- @sp_endpoint('/fba/outbound/2020-07-01/fulfillmentOrders/{}/return', method='PUT')
393
- def create_fulfillment_return(self, sellerFulfillmentOrderId, **kwargs) -> ApiResponse:
384
+ return self._request(kwargs.pop("path"), params=kwargs)
385
+
386
+ @sp_endpoint("/fba/outbound/2020-07-01/fulfillmentOrders/{}/return", method="PUT")
387
+ def create_fulfillment_return(
388
+ self, sellerFulfillmentOrderId, **kwargs
389
+ ) -> ApiResponse:
394
390
  """
395
391
  create_fulfillment_return(self, sellerFulfillmentOrderId, **kwargs) -> ApiResponse
396
392
 
397
- Creates a fulfillment return.
393
+ Creates a fulfillment return.
398
394
 
399
395
  **Usage Plan:**
400
396
 
@@ -440,11 +436,12 @@ class FulfillmentOutbound(Client):
440
436
  Returns:
441
437
  ApiResponse:
442
438
  """
443
-
444
- return self._request(fill_query_params(kwargs.pop('path'), sellerFulfillmentOrderId), data=kwargs)
445
-
446
439
 
447
- @sp_endpoint('/fba/outbound/2020-07-01/fulfillmentOrders/{}', method='GET')
440
+ return self._request(
441
+ fill_query_params(kwargs.pop("path"), sellerFulfillmentOrderId), data=kwargs
442
+ )
443
+
444
+ @sp_endpoint("/fba/outbound/2020-07-01/fulfillmentOrders/{}", method="GET")
448
445
  def get_fulfillment_order(self, sellerFulfillmentOrderId, **kwargs) -> ApiResponse:
449
446
  """
450
447
  get_fulfillment_order(self, sellerFulfillmentOrderId, **kwargs) -> ApiResponse
@@ -467,12 +464,16 @@ class FulfillmentOutbound(Client):
467
464
  Returns:
468
465
  ApiResponse:
469
466
  """
470
-
471
- return self._request(fill_query_params(kwargs.pop('path'), sellerFulfillmentOrderId), params=kwargs)
472
-
473
467
 
474
- @sp_endpoint('/fba/outbound/2020-07-01/fulfillmentOrders/{}', method='PUT')
475
- def update_fulfillment_order(self, sellerFulfillmentOrderId, **kwargs) -> ApiResponse:
468
+ return self._request(
469
+ fill_query_params(kwargs.pop("path"), sellerFulfillmentOrderId),
470
+ params=kwargs,
471
+ )
472
+
473
+ @sp_endpoint("/fba/outbound/2020-07-01/fulfillmentOrders/{}", method="PUT")
474
+ def update_fulfillment_order(
475
+ self, sellerFulfillmentOrderId, **kwargs
476
+ ) -> ApiResponse:
476
477
  """
477
478
  update_fulfillment_order(self, sellerFulfillmentOrderId, **kwargs) -> ApiResponse
478
479
 
@@ -609,12 +610,15 @@ class FulfillmentOutbound(Client):
609
610
  Returns:
610
611
  ApiResponse:
611
612
  """
612
-
613
- return self._request(fill_query_params(kwargs.pop('path'), sellerFulfillmentOrderId), data=kwargs)
614
-
615
613
 
616
- @sp_endpoint('/fba/outbound/2020-07-01/fulfillmentOrders/{}/cancel', method='PUT')
617
- def cancel_fulfillment_order(self, sellerFulfillmentOrderId, **kwargs) -> ApiResponse:
614
+ return self._request(
615
+ fill_query_params(kwargs.pop("path"), sellerFulfillmentOrderId), data=kwargs
616
+ )
617
+
618
+ @sp_endpoint("/fba/outbound/2020-07-01/fulfillmentOrders/{}/cancel", method="PUT")
619
+ def cancel_fulfillment_order(
620
+ self, sellerFulfillmentOrderId, **kwargs
621
+ ) -> ApiResponse:
618
622
  """
619
623
  cancel_fulfillment_order(self, sellerFulfillmentOrderId, **kwargs) -> ApiResponse
620
624
 
@@ -632,16 +636,17 @@ class FulfillmentOutbound(Client):
632
636
 
633
637
  Args:
634
638
  sellerFulfillmentOrderId:string | * REQUIRED The identifier assigned to the item by the seller when the fulfillment order was created.
635
-
639
+
636
640
 
637
641
  Returns:
638
642
  ApiResponse:
639
643
  """
640
-
641
- return self._request(fill_query_params(kwargs.pop('path'), sellerFulfillmentOrderId), data=kwargs)
642
-
643
644
 
644
- @sp_endpoint('/fba/outbound/2020-07-01/features', method='GET')
645
+ return self._request(
646
+ fill_query_params(kwargs.pop("path"), sellerFulfillmentOrderId), data=kwargs
647
+ )
648
+
649
+ @sp_endpoint("/fba/outbound/2020-07-01/features", method="GET")
645
650
  def get_features(self, **kwargs) -> ApiResponse:
646
651
  """
647
652
  get_features(self, **kwargs) -> ApiResponse
@@ -665,11 +670,10 @@ class FulfillmentOutbound(Client):
665
670
  Returns:
666
671
  ApiResponse:
667
672
  """
668
-
669
- return self._request(kwargs.pop('path'), params=kwargs)
670
-
671
673
 
672
- @sp_endpoint('/fba/outbound/2020-07-01/features/inventory/{}', method='GET')
674
+ return self._request(kwargs.pop("path"), params=kwargs)
675
+
676
+ @sp_endpoint("/fba/outbound/2020-07-01/features/inventory/{}", method="GET")
673
677
  def get_feature_inventory(self, featureName, **kwargs) -> ApiResponse:
674
678
  """
675
679
  get_feature_inventory(self, featureName, **kwargs) -> ApiResponse
@@ -694,11 +698,12 @@ class FulfillmentOutbound(Client):
694
698
  Returns:
695
699
  ApiResponse:
696
700
  """
697
-
698
- return self._request(fill_query_params(kwargs.pop('path'), featureName), params=kwargs)
699
-
700
701
 
701
- @sp_endpoint('/fba/outbound/2020-07-01/features/inventory/{}', method='GET')
702
+ return self._request(
703
+ fill_query_params(kwargs.pop("path"), featureName), params=kwargs
704
+ )
705
+
706
+ @sp_endpoint("/fba/outbound/2020-07-01/features/inventory/{}", method="GET")
702
707
  def get_feature_s_k_u(self, featureName, **kwargs) -> ApiResponse:
703
708
  """
704
709
  get_feature_s_k_u(self, featureName, **kwargs) -> ApiResponse
@@ -724,6 +729,7 @@ class FulfillmentOutbound(Client):
724
729
  Returns:
725
730
  ApiResponse:
726
731
  """
727
-
728
- return self._request(fill_query_params(kwargs.pop('path'), featureName), params=kwargs)
729
-
732
+
733
+ return self._request(
734
+ fill_query_params(kwargs.pop("path"), featureName), params=kwargs
735
+ )
@@ -1,8 +1,8 @@
1
- from collections import abc
2
1
  import urllib
3
2
 
4
3
  from sp_api.base import Client, Marketplaces, sp_endpoint, ApiResponse
5
4
  from sp_api.base.InventoryEnums import InventoryGranularity
5
+ from sp_api.util import normalize_csv_param
6
6
 
7
7
 
8
8
  class Inventories(Client):
@@ -10,7 +10,7 @@ class Inventories(Client):
10
10
  :link: https://github.com/amzn/selling-partner-api-docs/blob/main/references/fba-inventory-api/fbaInventory.md#getinventorysummaries
11
11
  """
12
12
 
13
- @sp_endpoint('/fba/inventory/v1/summaries')
13
+ @sp_endpoint("/fba/inventory/v1/summaries")
14
14
  def get_inventory_summary_marketplace(self, **kwargs) -> ApiResponse:
15
15
  """
16
16
  get_inventory_summary_marketplace(self, **kwargs) -> GetInventorySummariesResponse
@@ -60,12 +60,14 @@ class Inventories(Client):
60
60
 
61
61
  """
62
62
 
63
- kwargs.update({
64
- 'granularityType': kwargs.get('granularityType', InventoryGranularity.MARKETPLACE.value),
65
- "granularityId": kwargs.get('granularityId', self.marketplace_id)
66
- })
67
- if 'sellerSkus' in kwargs and isinstance(kwargs.get('sellerSkus'), abc.Iterable) and not isinstance(kwargs.get('sellerSkus'), str):
68
- kwargs.update({'sellerSkus': ','.join(kwargs.get('sellerSkus'))})
69
-
70
- return self._request(kwargs.pop('path'), params=kwargs)
71
-
63
+ kwargs.update(
64
+ {
65
+ "granularityType": kwargs.get(
66
+ "granularityType", InventoryGranularity.MARKETPLACE.value
67
+ ),
68
+ "granularityId": kwargs.get("granularityId", self.marketplace_id),
69
+ }
70
+ )
71
+ normalize_csv_param(kwargs, "sellerSkus")
72
+
73
+ return self._request(kwargs.pop("path"), params=kwargs)
@@ -1,19 +1,24 @@
1
- from collections import abc
2
-
3
- from sp_api.base import Client, sp_endpoint, fill_query_params, ApiResponse, IncludedData
1
+ from sp_api.base import (
2
+ Client,
3
+ sp_endpoint,
4
+ fill_query_params,
5
+ ApiResponse,
6
+ IncludedData,
7
+ )
8
+ from sp_api.util import normalize_included_data
4
9
 
5
10
 
6
11
  class ListingsItems(Client):
7
12
  """
8
- ListingsItems SP-API Client
9
- :link:
13
+ ListingsItems SP-API Client
14
+ :link:
10
15
 
11
- The Selling Partner API for Listings Items (Listings Items API) provides programmatic access to selling partner listings on Amazon. Use this API in collaboration with the Selling Partner API for Product Type Definitions, which you use to retrieve the information about Amazon product types needed to use the Listings Items API.
16
+ The Selling Partner API for Listings Items (Listings Items API) provides programmatic access to selling partner listings on Amazon. Use this API in collaboration with the Selling Partner API for Product Type Definitions, which you use to retrieve the information about Amazon product types needed to use the Listings Items API.
12
17
 
13
- For more information, see the [Listings Items API Use Case Guide](https://github.com/amzn/selling-partner-api-docs/blob/main/guides/en-US/use-case-guides/listings-items-api-use-case-guide/listings-items-api-use-case-guide_2021-08-01.md).
18
+ For more information, see the [Listings Items API Use Case Guide](https://github.com/amzn/selling-partner-api-docs/blob/main/guides/en-US/use-case-guides/listings-items-api-use-case-guide/listings-items-api-use-case-guide_2021-08-01.md).
14
19
  """
15
20
 
16
- @sp_endpoint('/listings/2021-08-01/items/{}/{}', method='DELETE')
21
+ @sp_endpoint("/listings/2021-08-01/items/{}/{}", method="DELETE")
17
22
  def delete_listings_item(self, sellerId, sku, **kwargs) -> ApiResponse:
18
23
  """
19
24
  delete_listings_item(self, sellerId, sku, **kwargs) -> ApiResponse
@@ -34,9 +39,11 @@ For more information, see the [Listings Items API Use Case Guide](https://github
34
39
  ApiResponse:
35
40
  """
36
41
 
37
- return self._request(fill_query_params(kwargs.pop('path'), sellerId, sku), data=kwargs)
42
+ return self._request(
43
+ fill_query_params(kwargs.pop("path"), sellerId, sku), data=kwargs
44
+ )
38
45
 
39
- @sp_endpoint('/listings/2021-08-01/items/{}/{}', method='GET')
46
+ @sp_endpoint("/listings/2021-08-01/items/{}/{}", method="GET")
40
47
  def get_listings_item(self, sellerId, sku, **kwargs) -> ApiResponse:
41
48
  """
42
49
  get_listings_item(self, sellerId, **kwargs) -> ApiResponse
@@ -57,13 +64,13 @@ For more information, see the [Listings Items API Use Case Guide](https://github
57
64
  Returns:
58
65
  ApiResponse:
59
66
  """
60
- if kwargs.get('includedData') and isinstance(kwargs.get('includedData'), abc.Iterable) and not isinstance(kwargs.get('includedData'), str):
61
- kwargs['includedData'] = ','.join(
62
- [x.value if isinstance(x, IncludedData) else x for x in kwargs['includedData']])
67
+ normalize_included_data(kwargs, enum_cls=IncludedData)
63
68
 
64
- return self._request(fill_query_params(kwargs.pop('path'), sellerId, sku), params=kwargs)
69
+ return self._request(
70
+ fill_query_params(kwargs.pop("path"), sellerId, sku), params=kwargs
71
+ )
65
72
 
66
- @sp_endpoint('/listings/2021-08-01/items/{}', method='GET')
73
+ @sp_endpoint("/listings/2021-08-01/items/{}", method="GET")
67
74
  def search_listings_items(self, sellerId, **kwargs) -> ApiResponse:
68
75
  """
69
76
  search_listings_items(self, sellerId, **kwargs) -> ApiResponse
@@ -83,13 +90,13 @@ For more information, see the [Listings Items API Use Case Guide](https://github
83
90
  Returns:
84
91
  ApiResponse:
85
92
  """
86
- if kwargs.get('includedData') and isinstance(kwargs.get('includedData'), abc.Iterable) and not isinstance(kwargs.get('includedData'), str):
87
- kwargs['includedData'] = ','.join(
88
- [x.value if isinstance(x, IncludedData) else x for x in kwargs['includedData']])
93
+ normalize_included_data(kwargs, enum_cls=IncludedData)
89
94
 
90
- return self._request(fill_query_params(kwargs.pop('path'), sellerId), params=kwargs)
95
+ return self._request(
96
+ fill_query_params(kwargs.pop("path"), sellerId), params=kwargs
97
+ )
91
98
 
92
- @sp_endpoint('/listings/2021-08-01/items/{}/{}', method='PATCH')
99
+ @sp_endpoint("/listings/2021-08-01/items/{}/{}", method="PATCH")
93
100
  def patch_listings_item(self, sellerId, sku, **kwargs) -> ApiResponse:
94
101
  """
95
102
  patch_listings_item(self, sellerId, sku, **kwargs) -> ApiResponse
@@ -122,10 +129,13 @@ For more information, see the [Listings Items API Use Case Guide](https://github
122
129
  Returns:
123
130
  ApiResponse:
124
131
  """
125
- return self._request(fill_query_params(kwargs.pop('path'), sellerId, sku), data=kwargs.pop('body'),
126
- params=kwargs)
132
+ return self._request(
133
+ fill_query_params(kwargs.pop("path"), sellerId, sku),
134
+ data=kwargs.pop("body"),
135
+ params=kwargs,
136
+ )
127
137
 
128
- @sp_endpoint('/listings/2021-08-01/items/{}/{}', method='PUT')
138
+ @sp_endpoint("/listings/2021-08-01/items/{}/{}", method="PUT")
129
139
  def put_listings_item(self, sellerId, sku, **kwargs) -> ApiResponse:
130
140
  """
131
141
  put_listings_item(self, sellerId, sku, **kwargs) -> ApiResponse
@@ -152,5 +162,8 @@ For more information, see the [Listings Items API Use Case Guide](https://github
152
162
  ApiResponse:
153
163
  """
154
164
 
155
- return self._request(fill_query_params(kwargs.pop('path'), sellerId, sku), data=kwargs.pop('body'),
156
- params=kwargs)
165
+ return self._request(
166
+ fill_query_params(kwargs.pop("path"), sellerId, sku),
167
+ data=kwargs.pop("body"),
168
+ params=kwargs,
169
+ )
@@ -12,25 +12,24 @@ class ListingsRestrictions(Client):
12
12
  For more information, see the [Listings Restrictions API Use Case Guide](https://github.com/amzn/selling-partner-api-docs/blob/main/guides/en-US/use-case-guides/listings-restrictions-api-use-case-guide/listings-restrictions-api-use-case-guide_2021-08-01.md).
13
13
  """
14
14
 
15
- @sp_endpoint('/listings/2021-08-01/restrictions', method='GET')
15
+ @sp_endpoint("/listings/2021-08-01/restrictions", method="GET")
16
16
  def get_listings_restrictions(self, **kwargs) -> ApiResponse:
17
17
  """
18
18
  get_listings_restrictions(self, **kwargs) -> ApiResponse
19
19
 
20
- Returns listing restrictions for an item in the Amazon Catalog.
20
+ Returns listing restrictions for an item in the Amazon Catalog.
21
21
 
22
22
  Args:
23
-
23
+
24
24
  key asin:string | * REQUIRED The Amazon Standard Identification Number (ASIN) of the item.
25
25
  key conditionType:string | The condition used to filter restrictions.
26
26
  key sellerId:string | * REQUIRED A selling partner identifier, such as a merchant account.
27
27
  key marketplaceIds:array | * REQUIRED A comma-delimited list of Amazon marketplace identifiers for the request.
28
28
  key reasonLocale:string | A locale for reason text localization. When not provided, the default language code of the first marketplace is used. Examples: "en_US", "fr_CA", "fr_FR". Localized messages default to "en_US" when a localization is not available in the specified locale.
29
-
29
+
30
30
 
31
31
  Returns:
32
32
  ApiResponse
33
33
  """
34
-
35
- return self._request(kwargs.pop('path'), params=kwargs)
36
-
34
+
35
+ return self._request(kwargs.pop("path"), params=kwargs)
@@ -1,15 +1,16 @@
1
-
2
1
  from sp_api.base import Client, sp_endpoint, fill_query_params, ApiResponse
3
2
 
4
3
 
5
4
  class MerchantFulfillment(Client):
6
5
  """
7
- :link: https://github.com/amzn/selling-partner-api-docs/blob/main/references/merchant-fulfillment-api/merchantFulfillmentV0.md
6
+ :link: https://github.com/amzn/selling-partner-api-docs/blob/main/references/merchant-fulfillment-api/merchantFulfillmentV0.md
8
7
 
9
8
  """
10
9
 
11
- @sp_endpoint("/mfn/v0/eligibleServices", method='POST')
12
- def get_eligible_shipment_services_old(self, shipment_request_details: dict, **kwargs) -> ApiResponse:
10
+ @sp_endpoint("/mfn/v0/eligibleServices", method="POST")
11
+ def get_eligible_shipment_services_old(
12
+ self, shipment_request_details: dict, **kwargs
13
+ ) -> ApiResponse:
13
14
  """
14
15
  get_eligible_shipment_services_old(self, shipment_request_details: dict, **kwargs) -> ApiResponse
15
16
  Returns a list of shipping service offers that satisfy the specified shipment request details.
@@ -69,15 +70,14 @@ class MerchantFulfillment(Client):
69
70
  GetEligibleShipmentServicesResponse:
70
71
  """
71
72
  # GetEligibleShipmentServicesRequest
72
- data = {
73
- "ShipmentRequestDetails": shipment_request_details,
74
- **kwargs
75
- }
73
+ data = {"ShipmentRequestDetails": shipment_request_details, **kwargs}
76
74
 
77
- return self._request(kwargs.pop('path'), data=data)
75
+ return self._request(kwargs.pop("path"), data=data)
78
76
 
79
- @sp_endpoint("/mfn/v0/eligibleShippingServices", method='POST')
80
- def get_eligible_shipment_services(self, shipment_request_details: dict, **kwargs) -> ApiResponse:
77
+ @sp_endpoint("/mfn/v0/eligibleShippingServices", method="POST")
78
+ def get_eligible_shipment_services(
79
+ self, shipment_request_details: dict, **kwargs
80
+ ) -> ApiResponse:
81
81
  """
82
82
  get_eligible_shipment_services(self, shipment_request_details: dict, **kwargs) -> ApiResponse
83
83
  Returns a list of shipping service offers that satisfy the specified shipment request details.
@@ -138,12 +138,9 @@ class MerchantFulfillment(Client):
138
138
  """
139
139
 
140
140
  # GetEligibleShipmentServicesRequest
141
- data = {
142
- "ShipmentRequestDetails": shipment_request_details,
143
- **kwargs
144
- }
141
+ data = {"ShipmentRequestDetails": shipment_request_details, **kwargs}
145
142
 
146
- return self._request(kwargs.pop('path'), data=data)
143
+ return self._request(kwargs.pop("path"), data=data)
147
144
 
148
145
  @sp_endpoint("/mfn/v0/shipments/{}")
149
146
  def get_shipment(self, shipment_id: str, **kwargs) -> ApiResponse:
@@ -172,9 +169,13 @@ class MerchantFulfillment(Client):
172
169
  Returns:
173
170
  GetShipmentResponse:
174
171
  """
175
- return self._request(fill_query_params(kwargs.pop('path'), shipment_id), params=kwargs, add_marketplace=False)
172
+ return self._request(
173
+ fill_query_params(kwargs.pop("path"), shipment_id),
174
+ params=kwargs,
175
+ add_marketplace=False,
176
+ )
176
177
 
177
- @sp_endpoint("/mfn/v0/shipments/{}", method='DELETE')
178
+ @sp_endpoint("/mfn/v0/shipments/{}", method="DELETE")
178
179
  def cancel_shipment(self, shipment_id: str, **kwargs) -> ApiResponse:
179
180
  """
180
181
  cancel_shipment(self, shipment_id: str, **kwargs) -> ApiResponse
@@ -196,9 +197,13 @@ class MerchantFulfillment(Client):
196
197
  Returns:
197
198
  CancelShipmentResponse:
198
199
  """
199
- return self._request(fill_query_params(kwargs.pop('path'), shipment_id), params=kwargs, add_marketplace=False)
200
+ return self._request(
201
+ fill_query_params(kwargs.pop("path"), shipment_id),
202
+ params=kwargs,
203
+ add_marketplace=False,
204
+ )
200
205
 
201
- @sp_endpoint("/mfn/v0/shipments/{}/cancel", method='PUT')
206
+ @sp_endpoint("/mfn/v0/shipments/{}/cancel", method="PUT")
202
207
  def cancel_shipment_old(self, shipment_id: str, **kwargs) -> ApiResponse:
203
208
  """
204
209
  cancel_shipment_old(self, shipment_id: str, **kwargs) -> ApiResponse
@@ -220,10 +225,16 @@ class MerchantFulfillment(Client):
220
225
  Returns:
221
226
  CancelShipmentResponse:
222
227
  """
223
- return self._request(fill_query_params(kwargs.pop('path'), shipment_id), params=kwargs, add_marketplace=False)
224
-
225
- @sp_endpoint("/mfn/v0/shipments", method='POST')
226
- def create_shipment(self, shipment_request_details: dict, shipping_service_id: str, **kwargs) -> ApiResponse:
228
+ return self._request(
229
+ fill_query_params(kwargs.pop("path"), shipment_id),
230
+ params=kwargs,
231
+ add_marketplace=False,
232
+ )
233
+
234
+ @sp_endpoint("/mfn/v0/shipments", method="POST")
235
+ def create_shipment(
236
+ self, shipment_request_details: dict, shipping_service_id: str, **kwargs
237
+ ) -> ApiResponse:
227
238
  """
228
239
  create_shipment(self, shipment_request_details: dict, shipping_service_id: str, **kwargs) -> ApiResponse
229
240
  Create a shipment with the information provided.
@@ -295,13 +306,14 @@ class MerchantFulfillment(Client):
295
306
  data = {
296
307
  "ShipmentRequestDetails": shipment_request_details,
297
308
  "ShippingServiceId": shipping_service_id,
298
- **kwargs
309
+ **kwargs,
299
310
  }
300
- return self._request(kwargs.pop('path'), data=data, add_marketplace=False)
311
+ return self._request(kwargs.pop("path"), data=data, add_marketplace=False)
301
312
 
302
- @sp_endpoint("/mfn/v0/sellerInputs", method='POST')
303
- def get_additional_seller_inputs_old(self, shipping_service_id: str, ship_from_address: dict,
304
- order_id: str, **kwargs) -> ApiResponse:
313
+ @sp_endpoint("/mfn/v0/sellerInputs", method="POST")
314
+ def get_additional_seller_inputs_old(
315
+ self, shipping_service_id: str, ship_from_address: dict, order_id: str, **kwargs
316
+ ) -> ApiResponse:
305
317
  """
306
318
  get_additional_seller_inputs_old(self, shipping_service_id: str, ship_from_address: dict, order_id: str,
307
319
  **kwargs) -> ApiResponse
@@ -330,13 +342,14 @@ class MerchantFulfillment(Client):
330
342
  data = {
331
343
  "ShippingServiceId": shipping_service_id,
332
344
  "ShipFromAddress": ship_from_address,
333
- "OrderId": order_id
345
+ "OrderId": order_id,
334
346
  }
335
- return self._request(kwargs.pop('path'), data=data, add_marketplace=False)
347
+ return self._request(kwargs.pop("path"), data=data, add_marketplace=False)
336
348
 
337
- @sp_endpoint("/mfn/v0/additionalSellerInputs", method='POST')
338
- def get_additional_seller_inputs(self, shipping_service_id: str, ship_from_address: dict,
339
- order_id: str, **kwargs) -> ApiResponse:
349
+ @sp_endpoint("/mfn/v0/additionalSellerInputs", method="POST")
350
+ def get_additional_seller_inputs(
351
+ self, shipping_service_id: str, ship_from_address: dict, order_id: str, **kwargs
352
+ ) -> ApiResponse:
340
353
  """
341
354
  get_additional_seller_inputs(self, shipping_service_id: str, ship_from_address: dict, order_id: str,
342
355
  **kwargs) -> ApiResponse
@@ -365,6 +378,6 @@ class MerchantFulfillment(Client):
365
378
  data = {
366
379
  "ShippingServiceId": shipping_service_id,
367
380
  "ShipFromAddress": ship_from_address,
368
- "OrderId": order_id
381
+ "OrderId": order_id,
369
382
  }
370
- return self._request(kwargs.pop('path'), data=data, add_marketplace=False)
383
+ return self._request(kwargs.pop("path"), data=data, add_marketplace=False)