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,12 +6,12 @@ from sp_api.base import Client, sp_endpoint, fill_query_params, ApiResponse
6
6
  class Messaging(Client):
7
7
  """
8
8
  Messaging SP-API Client
9
- :link:
9
+ :link:
10
10
 
11
11
  With the Messaging API you can build applications that send messages to buyers. You can get a list of message types that are available for an order that you specify, then call an operation that sends a message to the buyer for that order. The Messaging 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
- @sp_endpoint('/messaging/v1/orders/{}', method='GET')
14
+ @sp_endpoint("/messaging/v1/orders/{}", method="GET")
15
15
  def get_messaging_actions_for_order(self, order_id, **kwargs) -> ApiResponse:
16
16
  """
17
17
  get_messaging_actions_for_order(self, order_id, **kwargs) -> ApiResponse
@@ -36,9 +36,13 @@ class Messaging(Client):
36
36
  ApiResponse:
37
37
  """
38
38
 
39
- return self._request(fill_query_params(kwargs.pop('path'), order_id), params=kwargs)
39
+ return self._request(
40
+ fill_query_params(kwargs.pop("path"), order_id), params=kwargs
41
+ )
40
42
 
41
- @sp_endpoint('/messaging/v1/orders/{}/messages/confirmCustomizationDetails', method='POST')
43
+ @sp_endpoint(
44
+ "/messaging/v1/orders/{}/messages/confirmCustomizationDetails", method="POST"
45
+ )
42
46
  def confirm_customization_details(self, order_id, **kwargs) -> ApiResponse:
43
47
  """
44
48
  confirm_customization_details(self, order_id, **kwargs) -> ApiResponse
@@ -72,10 +76,17 @@ class Messaging(Client):
72
76
  """
73
77
 
74
78
  return self._request(
75
- fill_query_params(kwargs.pop('path'), order_id), data=kwargs.pop("body"), params={"marketplaceIds": self.marketplace_id, "method": kwargs.pop('method')}
79
+ fill_query_params(kwargs.pop("path"), order_id),
80
+ data=kwargs.pop("body"),
81
+ params={
82
+ "marketplaceIds": self.marketplace_id,
83
+ "method": kwargs.pop("method"),
84
+ },
76
85
  )
77
86
 
78
- @sp_endpoint('/messaging/v1/orders/{}/messages/confirmDeliveryDetails', method='POST')
87
+ @sp_endpoint(
88
+ "/messaging/v1/orders/{}/messages/confirmDeliveryDetails", method="POST"
89
+ )
79
90
  def create_confirm_delivery_details(self, order_id, **kwargs) -> ApiResponse:
80
91
  """
81
92
  create_confirm_delivery_details(self, order_id, **kwargs) -> ApiResponse
@@ -104,10 +115,15 @@ class Messaging(Client):
104
115
  """
105
116
 
106
117
  return self._request(
107
- fill_query_params(kwargs.pop('path'), order_id), data=kwargs.pop("body"), params={"marketplaceIds": self.marketplace_id, "method": kwargs.pop('method')}
118
+ fill_query_params(kwargs.pop("path"), order_id),
119
+ data=kwargs.pop("body"),
120
+ params={
121
+ "marketplaceIds": self.marketplace_id,
122
+ "method": kwargs.pop("method"),
123
+ },
108
124
  )
109
125
 
110
- @sp_endpoint('/messaging/v1/orders/{}/messages/legalDisclosure', method='POST')
126
+ @sp_endpoint("/messaging/v1/orders/{}/messages/legalDisclosure", method="POST")
111
127
  def create_legal_disclosure(self, order_id, **kwargs) -> ApiResponse:
112
128
  """
113
129
  create_legal_disclosure(self, order_id, **kwargs) -> ApiResponse
@@ -141,10 +157,17 @@ class Messaging(Client):
141
157
  """
142
158
 
143
159
  return self._request(
144
- fill_query_params(kwargs.pop('path'), order_id), data=kwargs.pop("body"), params={"marketplaceIds": self.marketplace_id, "method": kwargs.pop('method')}
160
+ fill_query_params(kwargs.pop("path"), order_id),
161
+ data=kwargs.pop("body"),
162
+ params={
163
+ "marketplaceIds": self.marketplace_id,
164
+ "method": kwargs.pop("method"),
165
+ },
145
166
  )
146
167
 
147
- @sp_endpoint('/messaging/v1/orders/{}/messages/negativeFeedbackRemoval', method='POST')
168
+ @sp_endpoint(
169
+ "/messaging/v1/orders/{}/messages/negativeFeedbackRemoval", method="POST"
170
+ )
148
171
  def create_negative_feedback_removal(self, order_id, **kwargs) -> ApiResponse:
149
172
  """
150
173
  create_negative_feedback_removal(self, order_id, **kwargs) -> ApiResponse
@@ -169,10 +192,15 @@ class Messaging(Client):
169
192
  """
170
193
 
171
194
  return self._request(
172
- fill_query_params(kwargs.pop('path'), order_id), data=kwargs.pop("body"), params={"marketplaceIds": self.marketplace_id, "method": kwargs.pop('method')}
195
+ fill_query_params(kwargs.pop("path"), order_id),
196
+ data=kwargs.pop("body"),
197
+ params={
198
+ "marketplaceIds": self.marketplace_id,
199
+ "method": kwargs.pop("method"),
200
+ },
173
201
  )
174
202
 
175
- @sp_endpoint('/messaging/v1/orders/{}/messages/confirmOrderDetails', method='POST')
203
+ @sp_endpoint("/messaging/v1/orders/{}/messages/confirmOrderDetails", method="POST")
176
204
  def create_confirm_order_details(self, order_id, **kwargs) -> ApiResponse:
177
205
  """
178
206
  create_confirm_order_details(self, order_id, **kwargs) -> ApiResponse
@@ -200,10 +228,17 @@ class Messaging(Client):
200
228
  """
201
229
 
202
230
  return self._request(
203
- fill_query_params(kwargs.pop('path'), order_id), data=kwargs.pop("body"), params={"marketplaceIds": self.marketplace_id, "method": kwargs.pop('method')}
231
+ fill_query_params(kwargs.pop("path"), order_id),
232
+ data=kwargs.pop("body"),
233
+ params={
234
+ "marketplaceIds": self.marketplace_id,
235
+ "method": kwargs.pop("method"),
236
+ },
204
237
  )
205
238
 
206
- @sp_endpoint('/messaging/v1/orders/{}/messages/confirmServiceDetails', method='POST')
239
+ @sp_endpoint(
240
+ "/messaging/v1/orders/{}/messages/confirmServiceDetails", method="POST"
241
+ )
207
242
  def create_confirm_service_details(self, order_id, **kwargs) -> ApiResponse:
208
243
  """
209
244
  create_confirm_service_details(self, order_id, **kwargs) -> ApiResponse
@@ -232,10 +267,15 @@ class Messaging(Client):
232
267
  """
233
268
 
234
269
  return self._request(
235
- fill_query_params(kwargs.pop('path'), order_id), data=kwargs.pop("body"), params={"marketplaceIds": self.marketplace_id, "method": kwargs.pop('method')}
270
+ fill_query_params(kwargs.pop("path"), order_id),
271
+ data=kwargs.pop("body"),
272
+ params={
273
+ "marketplaceIds": self.marketplace_id,
274
+ "method": kwargs.pop("method"),
275
+ },
236
276
  )
237
277
 
238
- @sp_endpoint('/messaging/v1/orders/{}/messages/amazonMotors', method='POST')
278
+ @sp_endpoint("/messaging/v1/orders/{}/messages/amazonMotors", method="POST")
239
279
  def create_amazon_motors(self, order_id, **kwargs) -> ApiResponse:
240
280
  """
241
281
  create_amazon_motors(self, order_id, **kwargs) -> ApiResponse
@@ -269,10 +309,15 @@ class Messaging(Client):
269
309
  """
270
310
 
271
311
  return self._request(
272
- fill_query_params(kwargs.pop('path'), order_id), data=kwargs.pop("body"), params={"marketplaceIds": self.marketplace_id, "method": kwargs.pop('method')}
312
+ fill_query_params(kwargs.pop("path"), order_id),
313
+ data=kwargs.pop("body"),
314
+ params={
315
+ "marketplaceIds": self.marketplace_id,
316
+ "method": kwargs.pop("method"),
317
+ },
273
318
  )
274
319
 
275
- @sp_endpoint('/messaging/v1/orders/{}/messages/warranty', method='POST')
320
+ @sp_endpoint("/messaging/v1/orders/{}/messages/warranty", method="POST")
276
321
  def create_warranty(self, order_id, **kwargs) -> ApiResponse:
277
322
  """
278
323
  create_warranty(self, order_id, **kwargs) -> ApiResponse
@@ -309,10 +354,15 @@ class Messaging(Client):
309
354
  """
310
355
 
311
356
  return self._request(
312
- fill_query_params(kwargs.pop('path'), order_id), data=kwargs.pop("body"), params={"marketplaceIds": self.marketplace_id, "method": kwargs.pop('method')}
357
+ fill_query_params(kwargs.pop("path"), order_id),
358
+ data=kwargs.pop("body"),
359
+ params={
360
+ "marketplaceIds": self.marketplace_id,
361
+ "method": kwargs.pop("method"),
362
+ },
313
363
  )
314
364
 
315
- @sp_endpoint('/messaging/v1/orders/{}/attributes', method='GET')
365
+ @sp_endpoint("/messaging/v1/orders/{}/attributes", method="GET")
316
366
  def get_attributes(self, order_id, **kwargs) -> ApiResponse:
317
367
  """
318
368
  get_attributes(self, order_id, **kwargs) -> ApiResponse
@@ -334,9 +384,11 @@ class Messaging(Client):
334
384
  ApiResponse:
335
385
  """
336
386
 
337
- return self._request(fill_query_params(kwargs.pop('path'), order_id), params=kwargs)
387
+ return self._request(
388
+ fill_query_params(kwargs.pop("path"), order_id), params=kwargs
389
+ )
338
390
 
339
- @sp_endpoint('/messaging/v1/orders/{}/messages/digitalAccessKey', method='POST')
391
+ @sp_endpoint("/messaging/v1/orders/{}/messages/digitalAccessKey", method="POST")
340
392
  def create_digital_access_key(self, order_id, **kwargs) -> ApiResponse:
341
393
  """
342
394
  create_digital_access_key(self, order_id, **kwargs) -> ApiResponse
@@ -371,10 +423,15 @@ class Messaging(Client):
371
423
  """
372
424
 
373
425
  return self._request(
374
- fill_query_params(kwargs.pop('path'), order_id), data=kwargs.pop("body"), params={"marketplaceIds": self.marketplace_id, "method": kwargs.pop('method')}
426
+ fill_query_params(kwargs.pop("path"), order_id),
427
+ data=kwargs.pop("body"),
428
+ params={
429
+ "marketplaceIds": self.marketplace_id,
430
+ "method": kwargs.pop("method"),
431
+ },
375
432
  )
376
433
 
377
- @sp_endpoint('/messaging/v1/orders/{}/messages/unexpectedProblem', method='POST')
434
+ @sp_endpoint("/messaging/v1/orders/{}/messages/unexpectedProblem", method="POST")
378
435
  def create_unexpected_problem(self, order_id, **kwargs) -> ApiResponse:
379
436
  """
380
437
  create_unexpected_problem(self, order_id, **kwargs) -> ApiResponse
@@ -402,5 +459,52 @@ class Messaging(Client):
402
459
  """
403
460
 
404
461
  return self._request(
405
- fill_query_params(kwargs.pop('path'), order_id), data=kwargs.pop("body"), params={"marketplaceIds": self.marketplace_id, "method": kwargs.pop('method')}
462
+ fill_query_params(kwargs.pop("path"), order_id),
463
+ data=kwargs.pop("body"),
464
+ params={
465
+ "marketplaceIds": self.marketplace_id,
466
+ "method": kwargs.pop("method"),
467
+ },
468
+ )
469
+
470
+ @sp_endpoint("/messaging/v1/orders/{}/messages/invoice", method="POST")
471
+ def send_invoice(self, order_id, **kwargs) -> ApiResponse:
472
+ """
473
+ send_invoice(self, order_id, **kwargs) -> ApiResponse
474
+
475
+ Sends a message providing the buyer an invoice
476
+
477
+ **Usage Plan:**
478
+
479
+ ====================================== ==============
480
+ Rate (requests per second) Burst
481
+ ====================================== ==============
482
+ 1 5
483
+ ====================================== ==============
484
+
485
+ For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
486
+
487
+ Args:
488
+ order_id:string | * REQUIRED An Amazon order identifier. This specifies the order for which a message is sent.
489
+ body: {
490
+ "attachments": [
491
+ {
492
+ "uploadDestinationId": "string",
493
+ "fileName": "string"
494
+ }
495
+ ]
496
+ }
497
+
498
+
499
+ Returns:
500
+ ApiResponse:
501
+ """
502
+
503
+ return self._request(
504
+ fill_query_params(kwargs.pop("path"), order_id),
505
+ data=kwargs.pop("body"),
506
+ params={
507
+ "marketplaceIds": self.marketplace_id,
508
+ "method": kwargs.pop("method"),
509
+ },
406
510
  )
@@ -6,16 +6,21 @@ class Notifications(Client):
6
6
  """
7
7
  :link: https://github.com/amzn/selling-partner-api-docs/blob/main/references/notifications-api/notifications.md
8
8
  """
9
- grantless_scope = 'sellingpartnerapi::notifications'
9
+
10
+ grantless_scope = "sellingpartnerapi::notifications"
10
11
 
11
12
  @deprecated
12
13
  def add_subscription(self, notification_type: NotificationType or str, **kwargs):
13
14
  """deprecated, use create_subscription"""
14
15
  return self.create_subscription(notification_type, **kwargs)
15
16
 
16
- @sp_endpoint('/notifications/v1/subscriptions/{}', method='POST')
17
- def create_subscription(self, notification_type: NotificationType or str, destination_id: str = None,
18
- **kwargs) -> ApiResponse:
17
+ @sp_endpoint("/notifications/v1/subscriptions/{}", method="POST")
18
+ def create_subscription(
19
+ self,
20
+ notification_type: NotificationType or str,
21
+ destination_id: str = None,
22
+ **kwargs
23
+ ) -> ApiResponse:
19
24
  """
20
25
  create_subscription(self, notification_type: NotificationType or str, destination_id: str = None, **kwargs) -> ApiResponse
21
26
  Creates a subscription for the specified notification type to be delivered to the specified destination.
@@ -47,16 +52,25 @@ class Notifications(Client):
47
52
 
48
53
  """
49
54
  data = {
50
- 'destinationId': kwargs.pop('destinationId', destination_id),
51
- 'payloadVersion': kwargs.pop('payload_version', '1.0')
55
+ "destinationId": kwargs.pop("destinationId", destination_id),
56
+ "payloadVersion": kwargs.pop("payload_version", "1.0"),
52
57
  }
53
- return self._request(fill_query_params(kwargs.pop('path'),
54
- notification_type if isinstance(notification_type,
55
- str) else notification_type.value),
56
- data={**kwargs, **data})
57
-
58
- @sp_endpoint('/notifications/v1/subscriptions/{}')
59
- def get_subscription(self, notification_type: NotificationType or str, **kwargs) -> ApiResponse:
58
+ return self._request(
59
+ fill_query_params(
60
+ kwargs.pop("path"),
61
+ (
62
+ notification_type
63
+ if isinstance(notification_type, str)
64
+ else notification_type.value
65
+ ),
66
+ ),
67
+ data={**kwargs, **data},
68
+ )
69
+
70
+ @sp_endpoint("/notifications/v1/subscriptions/{}")
71
+ def get_subscription(
72
+ self, notification_type: NotificationType or str, **kwargs
73
+ ) -> ApiResponse:
60
74
  """
61
75
  get_subscription(self, notification_type: NotificationType or str, **kwargs) -> ApiResponse
62
76
  Returns information about subscriptions of the specified notification type. You can use this API to get subscription information when you do not have a subscription identifier.
@@ -84,13 +98,22 @@ class Notifications(Client):
84
98
  ApiResponse:
85
99
 
86
100
  """
87
- return self._request(fill_query_params(kwargs.pop('path'), notification_type if isinstance(notification_type,
88
- str) else notification_type.value),
89
- params={**kwargs})
90
-
91
- @sp_endpoint('/notifications/v1/subscriptions/{}/{}', method='DELETE')
92
- def delete_notification_subscription(self, notification_type: NotificationType or str, subscription_id: str,
93
- **kwargs) -> ApiResponse:
101
+ return self._request(
102
+ fill_query_params(
103
+ kwargs.pop("path"),
104
+ (
105
+ notification_type
106
+ if isinstance(notification_type, str)
107
+ else notification_type.value
108
+ ),
109
+ ),
110
+ params={**kwargs},
111
+ )
112
+
113
+ @sp_endpoint("/notifications/v1/subscriptions/{}/{}", method="DELETE")
114
+ def delete_notification_subscription(
115
+ self, notification_type: NotificationType or str, subscription_id: str, **kwargs
116
+ ) -> ApiResponse:
94
117
  """
95
118
  delete_notification_subscription(self, notification_type: NotificationType or str, subscription_id: str, **kwargs) -> ApiResponse
96
119
  Deletes the subscription indicated by the subscription identifier and notification type that you specify.
@@ -119,13 +142,27 @@ class Notifications(Client):
119
142
 
120
143
  """
121
144
  return self._request(
122
- fill_query_params(kwargs.pop('path'),
123
- notification_type if isinstance(notification_type, str) else notification_type.value,
124
- subscription_id),
125
- params={**kwargs})
126
-
127
- @sp_endpoint(path='/notifications/v1/destinations', method='POST')
128
- def create_destination(self, name: str, arn: str = None, account_id: str = None, region: str = None, **kwargs) -> ApiResponse:
145
+ fill_query_params(
146
+ kwargs.pop("path"),
147
+ (
148
+ notification_type
149
+ if isinstance(notification_type, str)
150
+ else notification_type.value
151
+ ),
152
+ subscription_id,
153
+ ),
154
+ params={**kwargs},
155
+ )
156
+
157
+ @sp_endpoint(path="/notifications/v1/destinations", method="POST")
158
+ def create_destination(
159
+ self,
160
+ name: str,
161
+ arn: str = None,
162
+ account_id: str = None,
163
+ region: str = None,
164
+ **kwargs
165
+ ) -> ApiResponse:
129
166
  """
130
167
  create_destination(self, name: str, arn: str, **kwargs) -> ApiResponse
131
168
  Creates a destination resource to receive notifications. The createDestination API is grantless. For more information, see "Grantless operations" in the Selling Partner API Developer Guide.
@@ -154,24 +191,25 @@ class Notifications(Client):
154
191
  ApiResponse:
155
192
 
156
193
  """
157
- resource_name = 'sqs' if not account_id else 'eventBridge'
194
+ resource_name = "sqs" if not account_id else "eventBridge"
158
195
  region = region if region else self.region
159
196
 
160
197
  data = {
161
- 'resourceSpecification': {
162
- resource_name: {
163
- 'arn': arn
164
- } if not account_id else {
165
- 'region': region,
166
- 'accountId': account_id
167
- }
198
+ "resourceSpecification": {
199
+ resource_name: (
200
+ {"arn": arn}
201
+ if not account_id
202
+ else {"region": region, "accountId": account_id}
203
+ )
168
204
  },
169
- 'name': name,
205
+ "name": name,
170
206
  }
171
207
 
172
- return self._request_grantless_operation(kwargs.pop('path'), data={**kwargs, **data})
208
+ return self._request_grantless_operation(
209
+ kwargs.pop("path"), data={**kwargs, **data}
210
+ )
173
211
 
174
- @sp_endpoint('/notifications/v1/destinations', method='GET')
212
+ @sp_endpoint("/notifications/v1/destinations", method="GET")
175
213
  def get_destinations(self, **kwargs) -> ApiResponse:
176
214
  """
177
215
  get_destinations(self, **kwargs) -> ApiResponse
@@ -195,9 +233,9 @@ class Notifications(Client):
195
233
  ApiResponse:
196
234
 
197
235
  """
198
- return self._request_grantless_operation(kwargs.pop('path'), params={**kwargs})
236
+ return self._request_grantless_operation(kwargs.pop("path"), params={**kwargs})
199
237
 
200
- @sp_endpoint('/notifications/v1/destinations/{}', method='GET')
238
+ @sp_endpoint("/notifications/v1/destinations/{}", method="GET")
201
239
  def get_destination(self, destination_id: str, **kwargs) -> ApiResponse:
202
240
  """
203
241
  get_destination(self, destination_id: str, **kwargs) -> ApiResponse
@@ -223,10 +261,11 @@ class Notifications(Client):
223
261
 
224
262
 
225
263
  """
226
- return self._request_grantless_operation(fill_query_params(kwargs.pop('path'), destination_id),
227
- params={**kwargs})
264
+ return self._request_grantless_operation(
265
+ fill_query_params(kwargs.pop("path"), destination_id), params={**kwargs}
266
+ )
228
267
 
229
- @sp_endpoint('/notifications/v1/destinations/{}', method='DELETE')
268
+ @sp_endpoint("/notifications/v1/destinations/{}", method="DELETE")
230
269
  def delete_destination(self, destination_id: str, **kwargs) -> ApiResponse:
231
270
  """
232
271
  delete_destination(self, destination_id: str, **kwargs) -> ApiResponse
@@ -250,5 +289,6 @@ class Notifications(Client):
250
289
  ApiResponse:
251
290
 
252
291
  """
253
- return self._request_grantless_operation(fill_query_params(kwargs.pop('path'), destination_id),
254
- params={**kwargs})
292
+ return self._request_grantless_operation(
293
+ fill_query_params(kwargs.pop("path"), destination_id), params={**kwargs}
294
+ )