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 Shipping(Client):
7
7
  """
8
8
  Shipping SP-API Client
9
- :link:
9
+ :link:
10
10
 
11
11
  Provides programmatic access to Amazon Shipping APIs.
12
12
  """
13
13
 
14
-
15
- @sp_endpoint('/shipping/v1/shipments', method='POST')
14
+ @sp_endpoint("/shipping/v1/shipments", method="POST")
16
15
  def create_shipment(self, **kwargs) -> ApiResponse:
17
16
  """
18
17
  create_shipment(self, **kwargs) -> ApiResponse
@@ -101,10 +100,10 @@ class Shipping(Client):
101
100
  Returns:
102
101
  ApiResponse:
103
102
  """
104
-
105
- return self._request(kwargs.pop('path'), data=kwargs)
106
103
 
107
- @sp_endpoint('/shipping/v1/shipments/{}', method='GET')
104
+ return self._request(kwargs.pop("path"), data=kwargs)
105
+
106
+ @sp_endpoint("/shipping/v1/shipments/{}", method="GET")
108
107
  def get_shipment(self, shipmentId, **kwargs) -> ApiResponse:
109
108
  """
110
109
  get_shipment(self, shipmentId, **kwargs) -> ApiResponse
@@ -127,10 +126,12 @@ class Shipping(Client):
127
126
  Returns:
128
127
  ApiResponse:
129
128
  """
130
-
131
- return self._request(fill_query_params(kwargs.pop('path'), shipmentId), params=kwargs)
132
129
 
133
- @sp_endpoint('/shipping/v1/shipments/{}/cancel', method='POST')
130
+ return self._request(
131
+ fill_query_params(kwargs.pop("path"), shipmentId), params=kwargs
132
+ )
133
+
134
+ @sp_endpoint("/shipping/v1/shipments/{}/cancel", method="POST")
134
135
  def cancel_shipment(self, shipmentId, **kwargs) -> ApiResponse:
135
136
  """
136
137
  cancel_shipment(self, shipmentId, **kwargs) -> ApiResponse
@@ -154,11 +155,12 @@ class Shipping(Client):
154
155
  Returns:
155
156
  ApiResponse:
156
157
  """
157
-
158
- return self._request(fill_query_params(kwargs.pop('path'), shipmentId), data=kwargs)
159
-
160
158
 
161
- @sp_endpoint('/shipping/v1/shipments/{}/purchaseLabels', method='POST')
159
+ return self._request(
160
+ fill_query_params(kwargs.pop("path"), shipmentId), data=kwargs
161
+ )
162
+
163
+ @sp_endpoint("/shipping/v1/shipments/{}/purchaseLabels", method="POST")
162
164
  def purchase_labels(self, shipmentId, **kwargs) -> ApiResponse:
163
165
  """
164
166
  purchase_labels(self, shipmentId, **kwargs) -> ApiResponse
@@ -185,16 +187,17 @@ class Shipping(Client):
185
187
  "labelStockSize": "4x6"
186
188
  }
187
189
  }
188
-
190
+
189
191
 
190
192
  Returns:
191
193
  ApiResponse:
192
194
  """
193
-
194
- return self._request(fill_query_params(kwargs.pop('path'), shipmentId), data=kwargs)
195
-
196
195
 
197
- @sp_endpoint('/shipping/v1/shipments/{}/label', method='POST')
196
+ return self._request(
197
+ fill_query_params(kwargs.pop("path"), shipmentId), data=kwargs
198
+ )
199
+
200
+ @sp_endpoint("/shipping/v1/shipments/{}/label", method="POST")
198
201
  def retrieve_shipping_label(self, shipmentId, **kwargs) -> ApiResponse:
199
202
  """
200
203
  retrieve_shipping_label(self, shipmentId, **kwargs) -> ApiResponse
@@ -224,11 +227,12 @@ class Shipping(Client):
224
227
  Returns:
225
228
  ApiResponse:
226
229
  """
227
-
228
- return self._request(fill_query_params(kwargs.pop('path'), shipmentId), data=kwargs)
229
-
230
230
 
231
- @sp_endpoint('/shipping/v1/purchaseShipment', method='POST')
231
+ return self._request(
232
+ fill_query_params(kwargs.pop("path"), shipmentId), data=kwargs
233
+ )
234
+
235
+ @sp_endpoint("/shipping/v1/purchaseShipment", method="POST")
232
236
  def purchase_shipment(self, **kwargs) -> ApiResponse:
233
237
  """
234
238
  purchase_shipment(self, **kwargs) -> ApiResponse
@@ -323,11 +327,10 @@ class Shipping(Client):
323
327
  Returns:
324
328
  ApiResponse:
325
329
  """
326
-
327
- return self._request(kwargs.pop('path'), data=kwargs)
328
-
329
330
 
330
- @sp_endpoint('/shipping/v1/rates', method='POST')
331
+ return self._request(kwargs.pop("path"), data=kwargs)
332
+
333
+ @sp_endpoint("/shipping/v1/rates", method="POST")
331
334
  def get_rates(self, **kwargs) -> ApiResponse:
332
335
  """
333
336
  get_rates(self, **kwargs) -> ApiResponse
@@ -399,11 +402,10 @@ class Shipping(Client):
399
402
  Returns:
400
403
  ApiResponse:
401
404
  """
402
-
403
- return self._request(kwargs.pop('path'), data=kwargs)
404
-
405
405
 
406
- @sp_endpoint('/shipping/v1/account', method='GET')
406
+ return self._request(kwargs.pop("path"), data=kwargs)
407
+
408
+ @sp_endpoint("/shipping/v1/account", method="GET")
407
409
  def get_account(self, **kwargs) -> ApiResponse:
408
410
  """
409
411
  get_account(self, **kwargs) -> ApiResponse
@@ -423,11 +425,10 @@ class Shipping(Client):
423
425
  Returns:
424
426
  ApiResponse:
425
427
  """
426
-
427
- return self._request(kwargs.pop('path'), params=kwargs)
428
-
429
428
 
430
- @sp_endpoint('/shipping/v1/tracking/{}', method='GET')
429
+ return self._request(kwargs.pop("path"), params=kwargs)
430
+
431
+ @sp_endpoint("/shipping/v1/tracking/{}", method="GET")
431
432
  def get_tracking_information(self, trackingId, **kwargs) -> ApiResponse:
432
433
  """
433
434
  get_tracking_information(self, trackingId, **kwargs) -> ApiResponse
@@ -451,6 +452,7 @@ class Shipping(Client):
451
452
  Returns:
452
453
  ApiResponse:
453
454
  """
454
-
455
- return self._request(fill_query_params(kwargs.pop('path'), trackingId), params=kwargs)
456
-
455
+
456
+ return self._request(
457
+ fill_query_params(kwargs.pop("path"), trackingId), params=kwargs
458
+ )
@@ -3,7 +3,13 @@ import os
3
3
  import urllib.parse
4
4
  from datetime import datetime
5
5
 
6
- from sp_api.base import Client, sp_endpoint, fill_query_params, ApiResponse, Marketplaces
6
+ from sp_api.base import (
7
+ Client,
8
+ sp_endpoint,
9
+ fill_query_params,
10
+ ApiResponse,
11
+ Marketplaces,
12
+ )
7
13
 
8
14
 
9
15
  class AmznShippingBusiness(str, enum.Enum):
@@ -26,7 +32,7 @@ class AmznShippingBusiness(str, enum.Enum):
26
32
  class Shipping(Client):
27
33
  """
28
34
  Shipping V2 SP-API Client
29
- :link:
35
+ :link:
30
36
 
31
37
  Provides programmatic access to Amazon Shipping APIs.
32
38
  """
@@ -34,12 +40,14 @@ class Shipping(Client):
34
40
  amzn_shipping_business: AmznShippingBusiness = AmznShippingBusiness.US
35
41
 
36
42
  def __init__(self, *args, **kwargs):
37
- if 'amzn_shipping_business' in kwargs:
38
- self.amzn_shipping_business = kwargs.pop('amzn_shipping_business', AmznShippingBusiness.US)
43
+ if "amzn_shipping_business" in kwargs:
44
+ self.amzn_shipping_business = kwargs.pop(
45
+ "amzn_shipping_business", AmznShippingBusiness.US
46
+ )
39
47
  else:
40
48
  marketplace = args[0] if len(args) > 0 else Marketplaces.US
41
- if os.environ.get('SP_API_DEFAULT_MARKETPLACE', None):
42
- marketplace = Marketplaces[os.environ.get('SP_API_DEFAULT_MARKETPLACE')]
49
+ if os.environ.get("SP_API_DEFAULT_MARKETPLACE", None):
50
+ marketplace = Marketplaces[os.environ.get("SP_API_DEFAULT_MARKETPLACE")]
43
51
 
44
52
  if AmznShippingBusiness.has_key(marketplace.name):
45
53
  self.amzn_shipping_business = AmznShippingBusiness[marketplace.name]
@@ -49,15 +57,15 @@ class Shipping(Client):
49
57
  @property
50
58
  def headers(self):
51
59
  return {
52
- 'host': self.endpoint[8:],
53
- 'user-agent': self.user_agent,
54
- 'x-amz-access-token': self.restricted_data_token or self.auth.access_token,
55
- 'x-amz-date': datetime.utcnow().strftime('%Y%m%dT%H%M%SZ'),
56
- 'content-type': 'application/json',
57
- 'x-amzn-shipping-business-id': self.amzn_shipping_business.value,
60
+ "host": self.endpoint[8:],
61
+ "user-agent": self.user_agent,
62
+ "x-amz-access-token": self.restricted_data_token or self.auth.access_token,
63
+ "x-amz-date": datetime.utcnow().strftime("%Y%m%dT%H%M%SZ"),
64
+ "content-type": "application/json",
65
+ "x-amzn-shipping-business-id": self.amzn_shipping_business.value,
58
66
  }
59
67
 
60
- @sp_endpoint('/shipping/v2/shipments/rates', method='POST')
68
+ @sp_endpoint("/shipping/v2/shipments/rates", method="POST")
61
69
  def get_rates(self, **kwargs) -> ApiResponse:
62
70
  """
63
71
  get_rates(self, **kwargs) -> ApiResponse
@@ -236,9 +244,9 @@ class Shipping(Client):
236
244
  ApiResponse:
237
245
  """
238
246
 
239
- return self._request(kwargs.pop('path'), data=kwargs, add_marketplace=False)
247
+ return self._request(kwargs.pop("path"), data=kwargs, add_marketplace=False)
240
248
 
241
- @sp_endpoint('/shipping/v2/shipments', method='POST')
249
+ @sp_endpoint("/shipping/v2/shipments", method="POST")
242
250
  def purchase_shipment(self, **kwargs) -> ApiResponse:
243
251
  """
244
252
  purchase_shipment(self, **kwargs) -> ApiResponse
@@ -284,9 +292,9 @@ class Shipping(Client):
284
292
  Returns:
285
293
  ApiResponse:
286
294
  """
287
- return self._request(kwargs.pop('path'), data=kwargs, add_marketplace=False)
295
+ return self._request(kwargs.pop("path"), data=kwargs, add_marketplace=False)
288
296
 
289
- @sp_endpoint('/shipping/v2/oneClickShipment', method='POST')
297
+ @sp_endpoint("/shipping/v2/oneClickShipment", method="POST")
290
298
  def one_click_shipment(self, **kwargs) -> ApiResponse:
291
299
  """
292
300
  one_click_shipment(self, **kwargs) -> ApiResponse
@@ -472,9 +480,9 @@ class Shipping(Client):
472
480
  Returns:
473
481
  ApiResponse:
474
482
  """
475
- return self._request(kwargs.pop('path'), data=kwargs, add_marketplace=False)
483
+ return self._request(kwargs.pop("path"), data=kwargs, add_marketplace=False)
476
484
 
477
- @sp_endpoint('/shipping/v2/tracking', method='GET')
485
+ @sp_endpoint("/shipping/v2/tracking", method="GET")
478
486
  def get_tracking(self, **kwargs) -> ApiResponse:
479
487
  """
480
488
  get_tracking(self, **kwargs) -> ApiResponse
@@ -498,9 +506,9 @@ class Shipping(Client):
498
506
  Returns:
499
507
  ApiResponse:
500
508
  """
501
- return self._request(kwargs.pop('path'), params=kwargs, add_marketplace=False)
509
+ return self._request(kwargs.pop("path"), params=kwargs, add_marketplace=False)
502
510
 
503
- @sp_endpoint('/shipping/v2/shipments/{}/documents', method='GET')
511
+ @sp_endpoint("/shipping/v2/shipments/{}/documents", method="GET")
504
512
  def get_shipment_documents(self, shipmentId, **kwargs) -> ApiResponse:
505
513
  """
506
514
  get_shipment_documents(self, shipmentId, **kwargs) -> ApiResponse
@@ -527,9 +535,13 @@ class Shipping(Client):
527
535
  ApiResponse:
528
536
  """
529
537
 
530
- return self._request(fill_query_params(kwargs.pop('path'), shipmentId), params=kwargs, add_marketplace=False)
538
+ return self._request(
539
+ fill_query_params(kwargs.pop("path"), shipmentId),
540
+ params=kwargs,
541
+ add_marketplace=False,
542
+ )
531
543
 
532
- @sp_endpoint('/shipping/v2/shipments/{}/cancel', method='PUT')
544
+ @sp_endpoint("/shipping/v2/shipments/{}/cancel", method="PUT")
533
545
  def cancel_shipment(self, shipmentId, **kwargs) -> ApiResponse:
534
546
  """
535
547
  cancel_shipment(self, shipmentId, **kwargs) -> ApiResponse
@@ -552,9 +564,13 @@ class Shipping(Client):
552
564
  Returns:
553
565
  ApiResponse:
554
566
  """
555
- return self._request(fill_query_params(kwargs.pop('path'), shipmentId), data=kwargs, add_marketplace=False)
567
+ return self._request(
568
+ fill_query_params(kwargs.pop("path"), shipmentId),
569
+ data=kwargs,
570
+ add_marketplace=False,
571
+ )
556
572
 
557
- @sp_endpoint('/shipping/v2/accessPoints', method='GET')
573
+ @sp_endpoint("/shipping/v2/accessPoints", method="GET")
558
574
  def get_access_points(self, **kwargs) -> ApiResponse:
559
575
  """
560
576
  get_access_points(self, **kwargs) -> ApiResponse
@@ -579,9 +595,9 @@ class Shipping(Client):
579
595
  Returns:
580
596
  ApiResponse:
581
597
  """
582
- return self._request(kwargs.pop('path'), params=kwargs, add_marketplace=False)
598
+ return self._request(kwargs.pop("path"), params=kwargs, add_marketplace=False)
583
599
 
584
- @sp_endpoint('/shipping/v2/ndrFeedback', method='POST')
600
+ @sp_endpoint("/shipping/v2/ndrFeedback", method="POST")
585
601
  def submit_ndr_feedback(self, **kwargs) -> ApiResponse:
586
602
  """
587
603
  submit_ndr_feedback(self, **kwargs) -> ApiResponse
@@ -611,9 +627,9 @@ class Shipping(Client):
611
627
  Returns:
612
628
  ApiResponse:
613
629
  """
614
- return self._request(kwargs.pop('path'), data=kwargs, add_marketplace=False)
630
+ return self._request(kwargs.pop("path"), data=kwargs, add_marketplace=False)
615
631
 
616
- @sp_endpoint('/shipping/v2/shipments/additionalInputs/schema', method='GET')
632
+ @sp_endpoint("/shipping/v2/shipments/additionalInputs/schema", method="GET")
617
633
  def get_additional_inputs(self, **kwargs) -> ApiResponse:
618
634
  """
619
635
  get_additional_inputs(self, **kwargs) -> ApiResponse
@@ -637,4 +653,4 @@ class Shipping(Client):
637
653
  Returns:
638
654
  ApiResponse:
639
655
  """
640
- return self._request(kwargs.pop('path'), params=kwargs, add_marketplace=False)
656
+ return self._request(kwargs.pop("path"), params=kwargs, add_marketplace=False)
@@ -6,14 +6,15 @@ from sp_api.base import Client, sp_endpoint, fill_query_params, ApiResponse
6
6
  class Solicitations(Client):
7
7
  """
8
8
  Solicitations SP-API Client
9
- :link:
9
+ :link:
10
10
 
11
11
  With the Solicitations API you can build applications that send non-critical solicitations to buyers. You can get a list of solicitation types that are available for an order that you specify, then call an operation that sends a solicitation to the buyer for that order. Buyers cannot respond to solicitations sent by this API, and these solicitations do not appear in the Messaging section of Seller Central or in the recipient's Message Center. The Solicitations API returns responses that are formed according to the <a href=https://tools.ietf.org/html/draft-kelly-json-hal-08>JSON Hypertext Application Language</a> (HAL) standard.
12
12
  """
13
13
 
14
-
15
- @sp_endpoint('/solicitations/v1/orders/{}', method='GET')
16
- def get_solicitation_actions_for_order(self, amazonOrderId, **kwargs) -> ApiResponse:
14
+ @sp_endpoint("/solicitations/v1/orders/{}", method="GET")
15
+ def get_solicitation_actions_for_order(
16
+ self, amazonOrderId, **kwargs
17
+ ) -> ApiResponse:
17
18
  """
18
19
  get_solicitation_actions_for_order(self, amazonOrderId, **kwargs) -> ApiResponse
19
20
 
@@ -36,11 +37,18 @@ class Solicitations(Client):
36
37
  Returns:
37
38
  ApiResponse:
38
39
  """
39
-
40
- return self._request(fill_query_params(kwargs.pop('path'), amazonOrderId), params=kwargs)
41
40
 
42
- @sp_endpoint('/solicitations/v1/orders/{}/solicitations/productReviewAndSellerFeedback', method='POST')
43
- def create_product_review_and_seller_feedback_solicitation(self, amazonOrderId, **kwargs) -> ApiResponse:
41
+ return self._request(
42
+ fill_query_params(kwargs.pop("path"), amazonOrderId), params=kwargs
43
+ )
44
+
45
+ @sp_endpoint(
46
+ "/solicitations/v1/orders/{}/solicitations/productReviewAndSellerFeedback",
47
+ method="POST",
48
+ )
49
+ def create_product_review_and_seller_feedback_solicitation(
50
+ self, amazonOrderId, **kwargs
51
+ ) -> ApiResponse:
44
52
  """
45
53
  create_product_review_and_seller_feedback_solicitation(self, amazonOrderId, **kwargs) -> ApiResponse
46
54
 
@@ -63,6 +71,7 @@ class Solicitations(Client):
63
71
  Returns:
64
72
  ApiResponse:
65
73
  """
66
-
67
- return self._request(fill_query_params(kwargs.pop('path'), amazonOrderId), params=kwargs)
68
-
74
+
75
+ return self._request(
76
+ fill_query_params(kwargs.pop("path"), amazonOrderId), params=kwargs
77
+ )
@@ -4,12 +4,12 @@ from sp_api.base import Client, sp_endpoint, fill_query_params, ApiResponse
4
4
  class SupplySources(Client):
5
5
  """
6
6
  SupplySources SP-API Client
7
- :link:
7
+ :link:
8
8
 
9
9
  Manage configurations and capabilities of seller supply sources.
10
10
  """
11
11
 
12
- @sp_endpoint('/supplySources/2020-07-01/supplySources', method='GET')
12
+ @sp_endpoint("/supplySources/2020-07-01/supplySources", method="GET")
13
13
  def get_supply_sources(self, **kwargs) -> ApiResponse:
14
14
  """
15
15
  get_supply_sources(self, **kwargs) -> ApiResponse
@@ -17,40 +17,40 @@ class SupplySources(Client):
17
17
  The path to retrieve paginated supply sources.
18
18
 
19
19
  Args:
20
-
20
+
21
21
  key nextPageToken:string | The pagination token to retrieve a specific page of results.
22
-
22
+
23
23
  key pageSize:number | The number of supply sources to return per paginated request.
24
-
24
+
25
25
 
26
26
  Returns:
27
27
  ApiResponse:
28
28
  """
29
29
 
30
- return self._request(kwargs.pop('path'), params=kwargs)
30
+ return self._request(kwargs.pop("path"), params=kwargs)
31
31
 
32
- @sp_endpoint('/supplySources/2020-07-01/supplySources', method='POST')
32
+ @sp_endpoint("/supplySources/2020-07-01/supplySources", method="POST")
33
33
  def create_supply_source(self, **kwargs) -> ApiResponse:
34
34
  """
35
- create_supply_source(self, **kwargs) -> ApiResponse
35
+ create_supply_source(self, **kwargs) -> ApiResponse
36
36
 
37
- Create a new supply source.
37
+ Create a new supply source.
38
38
 
39
- Args:
40
-
41
- payload: | * REQUIRED {'description': 'A request to create a supply source.',
42
- 'properties': {'address': {'$ref': '#/definitions/Address'}, 'alias': {'$ref': '#/definitions/SupplySourceAlias'}, 'supplySourceCode': {'$ref': '#/definitions/SupplySourceCode'}},
43
- 'required': ['address', 'supplySourceCode', 'alias'],
44
- 'type': 'object'}
45
-
39
+ Args:
46
40
 
47
- Returns:
48
- ApiResponse:
41
+ payload: | * REQUIRED {'description': 'A request to create a supply source.',
42
+ 'properties': {'address': {'$ref': '#/definitions/Address'}, 'alias': {'$ref': '#/definitions/SupplySourceAlias'}, 'supplySourceCode': {'$ref': '#/definitions/SupplySourceCode'}},
43
+ 'required': ['address', 'supplySourceCode', 'alias'],
44
+ 'type': 'object'}
45
+
46
+
47
+ Returns:
48
+ ApiResponse:
49
49
  """
50
50
 
51
- return self._request(kwargs.pop('path'), data=kwargs)
51
+ return self._request(kwargs.pop("path"), data=kwargs)
52
52
 
53
- @sp_endpoint('/supplySources/2020-07-01/supplySources/{}', method='GET')
53
+ @sp_endpoint("/supplySources/2020-07-01/supplySources/{}", method="GET")
54
54
  def get_supply_source(self, supplySourceId, **kwargs) -> ApiResponse:
55
55
  """
56
56
  get_supply_source(self, supplySourceId, **kwargs) -> ApiResponse
@@ -58,17 +58,19 @@ class SupplySources(Client):
58
58
  Retrieve a supply source.
59
59
 
60
60
  Args:
61
-
61
+
62
62
  supplySourceId:string | * REQUIRED The unique identifier of a supply source.
63
-
63
+
64
64
 
65
65
  Returns:
66
66
  ApiResponse:
67
67
  """
68
68
 
69
- return self._request(fill_query_params(kwargs.pop('path'), supplySourceId), params=kwargs)
69
+ return self._request(
70
+ fill_query_params(kwargs.pop("path"), supplySourceId), params=kwargs
71
+ )
70
72
 
71
- @sp_endpoint('/supplySources/2020-07-01/supplySources/{}', method='PUT')
73
+ @sp_endpoint("/supplySources/2020-07-01/supplySources/{}", method="PUT")
72
74
  def update_supply_source(self, supplySourceId, **kwargs) -> ApiResponse:
73
75
  """
74
76
  update_supply_source(self, supplySourceId, **kwargs) -> ApiResponse
@@ -76,21 +78,23 @@ class SupplySources(Client):
76
78
  Update the configuration and capabilities of a supply source.
77
79
 
78
80
  Args:
79
-
81
+
80
82
  supplySourceId:string | * REQUIRED The unique identitier of a supply source.
81
-
83
+
82
84
  payload: | {'description': 'A request to update the configuration and capabilities of a supply source.',
83
85
  'properties': {'alias': {'$ref': '#/definitions/SupplySourceAlias'}, 'capabilities': {'$ref': '#/definitions/SupplySourceCapabilities'}, 'configuration': {'$ref': '#/definitions/SupplySourceConfiguration'}},
84
86
  'type': 'object'}
85
-
87
+
86
88
 
87
89
  Returns:
88
90
  ApiResponse:
89
91
  """
90
92
 
91
- return self._request(fill_query_params(kwargs.pop('path'), supplySourceId), data=kwargs)
93
+ return self._request(
94
+ fill_query_params(kwargs.pop("path"), supplySourceId), data=kwargs
95
+ )
92
96
 
93
- @sp_endpoint('/supplySources/2020-07-01/supplySources/{}', method='DELETE')
97
+ @sp_endpoint("/supplySources/2020-07-01/supplySources/{}", method="DELETE")
94
98
  def archive_supply_source(self, supplySourceId, **kwargs) -> ApiResponse:
95
99
  """
96
100
  archive_supply_source(self, supplySourceId, **kwargs) -> ApiResponse
@@ -98,17 +102,19 @@ class SupplySources(Client):
98
102
  Archive a supply source, making it inactive. Cannot be undone.
99
103
 
100
104
  Args:
101
-
105
+
102
106
  supplySourceId:string | * REQUIRED The unique identifier of a supply source.
103
-
107
+
104
108
 
105
109
  Returns:
106
110
  ApiResponse:
107
111
  """
108
112
 
109
- return self._request(fill_query_params(kwargs.pop('path'), supplySourceId), data=kwargs)
113
+ return self._request(
114
+ fill_query_params(kwargs.pop("path"), supplySourceId), data=kwargs
115
+ )
110
116
 
111
- @sp_endpoint('/supplySources/2020-07-01/supplySources/{}/status', method='PUT')
117
+ @sp_endpoint("/supplySources/2020-07-01/supplySources/{}/status", method="PUT")
112
118
  def update_supply_source_status(self, supplySourceId, **kwargs) -> ApiResponse:
113
119
  """
114
120
  update_supply_source_status(self, supplySourceId, **kwargs) -> ApiResponse
@@ -116,14 +122,16 @@ class SupplySources(Client):
116
122
  Update the status of a supply source.
117
123
 
118
124
  Args:
119
-
125
+
120
126
  supplySourceId:string | * REQUIRED The unique identifier of a supply source.
121
-
127
+
122
128
  payload: | {'description': 'A request to update the status of a supply source.', 'properties': {'status': {'$ref': '#/definitions/SupplySourceStatus'}}, 'type': 'object'}
123
-
129
+
124
130
 
125
131
  Returns:
126
132
  ApiResponse:
127
133
  """
128
134
 
129
- return self._request(fill_query_params(kwargs.pop('path'), supplySourceId), data=kwargs)
135
+ return self._request(
136
+ fill_query_params(kwargs.pop("path"), supplySourceId), data=kwargs
137
+ )
@@ -6,13 +6,12 @@ from sp_api.base import Client, sp_endpoint, fill_query_params, ApiResponse
6
6
  class Tokens(Client):
7
7
  """
8
8
  Tokens SP-API Client
9
- :link:
9
+ :link:
10
10
 
11
11
  The Selling Partner API for Tokens provides a secure way to access a customers's PII (Personally Identifiable Information). You can call the Tokens API to get a Restricted Data Token (RDT) for one or more restricted resources that you specify. The RDT authorizes you to make subsequent requests to access these restricted resources.
12
12
  """
13
13
 
14
-
15
- @sp_endpoint('/tokens/2021-03-01/restrictedDataToken', method='POST')
14
+ @sp_endpoint("/tokens/2021-03-01/restrictedDataToken", method="POST")
16
15
  def create_restricted_data_token(self, **kwargs) -> ApiResponse:
17
16
  """
18
17
  create_restricted_data_token(self, **kwargs) -> ApiResponse
@@ -61,6 +60,5 @@ class Tokens(Client):
61
60
  Returns:
62
61
  ApiResponse:
63
62
  """
64
-
65
- return self._request(kwargs.pop('path'), data=kwargs)
66
-
63
+
64
+ return self._request(kwargs.pop("path"), data=kwargs)
@@ -4,12 +4,14 @@ import urllib.parse
4
4
 
5
5
 
6
6
  class Upload(Client):
7
- @sp_endpoint('/uploads/2020-11-01/uploadDestinations/{}', method='POST')
8
- def upload_document(self, resource, file, content_type='application/pdf', **kwargs):
7
+ @sp_endpoint("/uploads/2020-11-01/uploadDestinations/{}", method="POST")
8
+ def upload_document(self, resource, file, content_type="application/pdf", **kwargs):
9
9
  md5 = urllib.parse.quote(create_md5(file))
10
- kwargs.update({
11
- 'contentMD5': md5,
12
- 'contentType': kwargs.pop('contentType', content_type),
13
- 'marketplaceIds': self.marketplace_id
14
- })
15
- return self._request(kwargs.pop('path').format(resource), params=kwargs)
10
+ kwargs.update(
11
+ {
12
+ "contentMD5": md5,
13
+ "contentType": kwargs.pop("contentType", content_type),
14
+ "marketplaceIds": self.marketplace_id,
15
+ }
16
+ )
17
+ return self._request(kwargs.pop("path").format(resource), params=kwargs)
@@ -6,13 +6,14 @@ from sp_api.base import Client, sp_endpoint, fill_query_params, ApiResponse
6
6
  class VendorDirectFulfillmentInventory(Client):
7
7
  """
8
8
  VendorDirectFulfillmentInventory SP-API Client
9
- :link:
9
+ :link:
10
10
 
11
11
  The Selling Partner API for Direct Fulfillment Inventory Updates provides programmatic access to a direct fulfillment vendor's inventory updates.
12
12
  """
13
13
 
14
-
15
- @sp_endpoint('/vendor/directFulfillment/inventory/v1/warehouses/{}/items', method='POST')
14
+ @sp_endpoint(
15
+ "/vendor/directFulfillment/inventory/v1/warehouses/{}/items", method="POST"
16
+ )
16
17
  def submit_inventory_update(self, warehouseId, **kwargs) -> ApiResponse:
17
18
  """
18
19
  submit_inventory_update(self, warehouseId, **kwargs) -> ApiResponse
@@ -54,6 +55,9 @@ class VendorDirectFulfillmentInventory(Client):
54
55
  Returns:
55
56
  ApiResponse:
56
57
  """
57
-
58
- return self._request(fill_query_params(kwargs.pop('path'), warehouseId), data=kwargs, add_marketplace=False)
59
-
58
+
59
+ return self._request(
60
+ fill_query_params(kwargs.pop("path"), warehouseId),
61
+ data=kwargs,
62
+ add_marketplace=False,
63
+ )