python-amazon-sp-api 2.0.15__py3-none-any.whl → 2.1.3__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-2.0.15.dist-info → python_amazon_sp_api-2.1.3.dist-info}/METADATA +7 -7
  2. python_amazon_sp_api-2.1.3.dist-info/RECORD +350 -0
  3. sp_api/__version__.py +1 -1
  4. sp_api/api/__init__.py +160 -4
  5. sp_api/api/amazon_warehousing_and_distribu/amazon_warehousing_and_distribu.py +85 -110
  6. sp_api/api/amazon_warehousing_and_distribu/amazon_warehousing_and_distribu_2024_05_09.py +456 -0
  7. sp_api/api/aplus_content/aplus_content.py +176 -125
  8. sp_api/api/application_integrations/application_integrations.py +59 -68
  9. sp_api/api/application_management/application_management.py +20 -13
  10. sp_api/api/authorization/authorization.py +8 -26
  11. sp_api/api/catalog/catalog.py +27 -61
  12. sp_api/api/catalog_items/catalog_items.py +108 -78
  13. sp_api/api/catalog_items/catalog_items_2020_12_01.py +86 -0
  14. sp_api/api/catalog_items/catalog_items_2022_04_01.py +89 -0
  15. sp_api/api/customer_feedback/customer_feedback.py +100 -0
  16. sp_api/api/data_kiosk/data_kiosk.py +80 -75
  17. sp_api/api/delivery_by_amazon/__init__.py +0 -0
  18. sp_api/api/delivery_by_amazon/delivery_by_amazon.py +92 -0
  19. sp_api/api/delivery_by_amazon/delivery_by_amazon_2022_07_01.py +81 -0
  20. sp_api/api/easy_ship/easy_ship.py +121 -111
  21. sp_api/api/external_fulfillment/external_fulfillment.py +211 -434
  22. sp_api/api/external_fulfillment/inventory.py +120 -0
  23. sp_api/api/external_fulfillment/inventory_2021_01_06.py +71 -0
  24. sp_api/api/external_fulfillment/inventory_2024_09_11.py +96 -0
  25. sp_api/api/external_fulfillment/returns.py +120 -0
  26. sp_api/api/external_fulfillment/returns_2021_08_19.py +88 -0
  27. sp_api/api/external_fulfillment/returns_2024_09_11.py +141 -0
  28. sp_api/api/external_fulfillment/shipping.py +120 -0
  29. sp_api/api/external_fulfillment/shipping_2021_01_06.py +256 -0
  30. sp_api/api/external_fulfillment/shipping_2024_09_11.py +233 -0
  31. sp_api/api/fba_inbound_eligibility/fba_inbound_eligibility.py +30 -24
  32. sp_api/api/fba_small_and_light/fba_small_and_light.py +60 -99
  33. sp_api/api/feeds/feeds.py +75 -245
  34. sp_api/api/feeds/feeds_2021_06_30.py +320 -0
  35. sp_api/api/finances/finances.py +123 -90
  36. sp_api/api/finances/finances_2024_06_01.py +71 -0
  37. sp_api/api/finances/finances_2024_06_19.py +114 -0
  38. sp_api/api/finances/finances_v0.py +116 -0
  39. sp_api/api/fulfillment_inbound/fulfillment_inbound.py +107 -1784
  40. sp_api/api/fulfillment_inbound/fulfillment_inbound_2024_03_20.py +1722 -0
  41. sp_api/api/fulfillment_inbound/fulfillment_inbound_v0.py +1384 -0
  42. sp_api/api/fulfillment_outbound/fulfillment_outbound.py +256 -480
  43. sp_api/api/inventories/inventories.py +79 -42
  44. sp_api/api/invoices/__init__.py +0 -0
  45. sp_api/api/invoices/invoices.py +92 -0
  46. sp_api/api/invoices/invoices_2024_06_19.py +344 -0
  47. sp_api/api/listings_items/listings_items.py +110 -163
  48. sp_api/api/listings_items/listings_items_2020_09_01.py +189 -0
  49. sp_api/api/listings_items/listings_items_2021_08_01.py +233 -0
  50. sp_api/api/listings_restrictions/listings_restrictions.py +23 -10
  51. sp_api/api/merchant_fulfillment/merchant_fulfillment.py +107 -222
  52. sp_api/api/messaging/messaging.py +184 -198
  53. sp_api/api/notifications/notifications.py +144 -106
  54. sp_api/api/orders/orders.py +9 -46
  55. sp_api/api/orders/orders_2026_01_01.py +19 -65
  56. sp_api/api/orders/orders_v0.py +152 -184
  57. sp_api/api/product_fees/product_fees.py +101 -75
  58. sp_api/api/product_type_definitions/product_type_definitions.py +47 -36
  59. sp_api/api/products/products.py +94 -386
  60. sp_api/api/products/products_2022_05_01.py +96 -0
  61. sp_api/api/products/products_v0.py +389 -0
  62. sp_api/api/replenishment/replenishment.py +58 -69
  63. sp_api/api/reports/reports.py +124 -157
  64. sp_api/api/sales/sales.py +22 -39
  65. sp_api/api/seller_wallet/__init__.py +0 -0
  66. sp_api/api/seller_wallet/seller_wallet.py +92 -0
  67. sp_api/api/seller_wallet/seller_wallet_2024_03_01.py +300 -0
  68. sp_api/api/sellers/sellers.py +15 -35
  69. sp_api/api/services/services.py +479 -82
  70. sp_api/api/shipment_invoicing/__init__.py +0 -0
  71. sp_api/api/shipment_invoicing/shipment_invoicing.py +92 -0
  72. sp_api/api/shipment_invoicing/shipment_invoicing_v0.py +101 -0
  73. sp_api/api/shipping/shipping.py +94 -440
  74. sp_api/api/shipping/shippingV2.py +183 -474
  75. sp_api/api/shipping/shipping_v1.py +330 -0
  76. sp_api/api/shipping/shipping_v2.py +723 -0
  77. sp_api/api/solicitations/solicitations.py +28 -18
  78. sp_api/api/supply_sources/supply_sources.py +67 -57
  79. sp_api/api/tokens/tokens.py +14 -35
  80. sp_api/api/vehicles/__init__.py +0 -0
  81. sp_api/api/vehicles/vehicles.py +92 -0
  82. sp_api/api/vehicles/vehicles_2024_11_01.py +33 -0
  83. sp_api/api/vendor_direct_fulfillment_inventory/vendor_direct_fulfillment_inventory.py +16 -29
  84. sp_api/api/vendor_direct_fulfillment_orders/vendor_direct_fulfillment_orders.py +116 -189
  85. sp_api/api/vendor_direct_fulfillment_orders/vendor_direct_fulfillment_orders_2021_12_28.py +114 -0
  86. sp_api/api/vendor_direct_fulfillment_orders/vendor_direct_fulfillment_orders_v1.py +114 -0
  87. sp_api/api/vendor_direct_fulfillment_payments/vendor_direct_fulfillment_payments.py +15 -225
  88. sp_api/api/vendor_direct_fulfillment_sandbox_test_data/__init__.py +0 -0
  89. sp_api/api/vendor_direct_fulfillment_sandbox_test_data/vendor_direct_fulfillment_sandbox_test_data.py +92 -0
  90. sp_api/api/vendor_direct_fulfillment_sandbox_test_data/vendor_direct_fulfillment_sandbox_test_data_2021_10_28.py +50 -0
  91. sp_api/api/vendor_direct_fulfillment_shipping/vendor_direct_fulfillment_shipping.py +122 -624
  92. sp_api/api/vendor_direct_fulfillment_shipping/vendor_direct_fulfillment_shipping_2021_12_28.py +390 -0
  93. sp_api/api/vendor_direct_fulfillment_shipping/vendor_direct_fulfillment_shipping_v1.py +320 -0
  94. sp_api/api/vendor_direct_fulfillment_transactions/vendor_direct_fulfillment_transactions.py +113 -29
  95. sp_api/api/vendor_direct_fulfillment_transactions/vendor_direct_fulfillment_transactions_2021_12_28.py +47 -0
  96. sp_api/api/vendor_direct_fulfillment_transactions/vendor_direct_fulfillment_transactions_v1.py +47 -0
  97. sp_api/api/vendor_invoices/vendor_invoices.py +15 -264
  98. sp_api/api/vendor_orders/vendor_orders.py +83 -131
  99. sp_api/api/vendor_shipments/vendor_shipments.py +149 -68
  100. sp_api/api/vendor_transaction_status/vendor_transaction_status.py +16 -11
  101. sp_api/asyncio/api/__init__.py +159 -4
  102. sp_api/asyncio/api/amazon_warehousing_and_distribu/amazon_warehousing_and_distribu.py +84 -110
  103. sp_api/asyncio/api/amazon_warehousing_and_distribu/amazon_warehousing_and_distribu_2024_05_09.py +457 -0
  104. sp_api/asyncio/api/aplus_content/aplus_content.py +176 -125
  105. sp_api/asyncio/api/application_integrations/application_integrations.py +59 -68
  106. sp_api/asyncio/api/application_management/application_management.py +20 -13
  107. sp_api/asyncio/api/authorization/authorization.py +8 -26
  108. sp_api/asyncio/api/catalog/catalog.py +27 -61
  109. sp_api/asyncio/api/catalog_items/catalog_items.py +94 -71
  110. sp_api/asyncio/api/catalog_items/catalog_items_2020_12_01.py +87 -0
  111. sp_api/asyncio/api/catalog_items/catalog_items_2022_04_01.py +90 -0
  112. sp_api/asyncio/api/customer_feedback/customer_feedback.py +100 -0
  113. sp_api/asyncio/api/data_kiosk/data_kiosk.py +80 -75
  114. sp_api/asyncio/api/delivery_by_amazon/__init__.py +0 -0
  115. sp_api/asyncio/api/delivery_by_amazon/delivery_by_amazon.py +92 -0
  116. sp_api/asyncio/api/delivery_by_amazon/delivery_by_amazon_2022_07_01.py +82 -0
  117. sp_api/asyncio/api/easy_ship/easy_ship.py +121 -111
  118. sp_api/asyncio/api/external_fulfillment/external_fulfillment.py +212 -435
  119. sp_api/asyncio/api/external_fulfillment/inventory.py +126 -0
  120. sp_api/asyncio/api/external_fulfillment/inventory_2021_01_06.py +73 -0
  121. sp_api/asyncio/api/external_fulfillment/inventory_2024_09_11.py +98 -0
  122. sp_api/asyncio/api/external_fulfillment/returns.py +124 -0
  123. sp_api/asyncio/api/external_fulfillment/returns_2021_08_19.py +90 -0
  124. sp_api/asyncio/api/external_fulfillment/returns_2024_09_11.py +143 -0
  125. sp_api/asyncio/api/external_fulfillment/shipping.py +124 -0
  126. sp_api/asyncio/api/external_fulfillment/shipping_2021_01_06.py +258 -0
  127. sp_api/asyncio/api/external_fulfillment/shipping_2024_09_11.py +235 -0
  128. sp_api/asyncio/api/fba_inbound_eligibility/fba_inbound_eligibility.py +31 -25
  129. sp_api/asyncio/api/fba_small_and_light/fba_small_and_light.py +61 -100
  130. sp_api/asyncio/api/feeds/feeds.py +75 -243
  131. sp_api/asyncio/api/feeds/feeds_2021_06_30.py +318 -0
  132. sp_api/asyncio/api/finances/finances.py +123 -91
  133. sp_api/asyncio/api/finances/finances_2024_06_01.py +72 -0
  134. sp_api/asyncio/api/finances/finances_2024_06_19.py +115 -0
  135. sp_api/asyncio/api/finances/finances_v0.py +117 -0
  136. sp_api/asyncio/api/fulfillment_inbound/fulfillment_inbound.py +107 -1785
  137. sp_api/asyncio/api/fulfillment_inbound/fulfillment_inbound_2024_03_20.py +1723 -0
  138. sp_api/asyncio/api/fulfillment_inbound/fulfillment_inbound_v0.py +1385 -0
  139. sp_api/asyncio/api/fulfillment_outbound/fulfillment_outbound.py +257 -481
  140. sp_api/asyncio/api/inventories/inventories.py +79 -42
  141. sp_api/asyncio/api/invoices/__init__.py +0 -0
  142. sp_api/asyncio/api/invoices/invoices.py +92 -0
  143. sp_api/asyncio/api/invoices/invoices_2024_06_19.py +345 -0
  144. sp_api/asyncio/api/listings_items/listings_items.py +109 -163
  145. sp_api/asyncio/api/listings_items/listings_items_2020_09_01.py +190 -0
  146. sp_api/asyncio/api/listings_items/listings_items_2021_08_01.py +233 -0
  147. sp_api/asyncio/api/listings_restrictions/listings_restrictions.py +23 -10
  148. sp_api/asyncio/api/merchant_fulfillment/merchant_fulfillment.py +110 -222
  149. sp_api/asyncio/api/messaging/messaging.py +185 -199
  150. sp_api/asyncio/api/notifications/notifications.py +145 -107
  151. sp_api/asyncio/api/orders/orders.py +9 -46
  152. sp_api/asyncio/api/orders/orders_2026_01_01.py +19 -65
  153. sp_api/asyncio/api/orders/orders_v0.py +152 -184
  154. sp_api/asyncio/api/product_fees/product_fees.py +101 -75
  155. sp_api/asyncio/api/product_type_definitions/product_type_definitions.py +47 -36
  156. sp_api/asyncio/api/products/products.py +94 -387
  157. sp_api/asyncio/api/products/products_2022_05_01.py +109 -0
  158. sp_api/asyncio/api/products/products_v0.py +388 -0
  159. sp_api/asyncio/api/replenishment/replenishment.py +59 -70
  160. sp_api/asyncio/api/reports/reports.py +124 -157
  161. sp_api/asyncio/api/sales/sales.py +22 -39
  162. sp_api/asyncio/api/seller_wallet/__init__.py +0 -0
  163. sp_api/asyncio/api/seller_wallet/seller_wallet.py +92 -0
  164. sp_api/asyncio/api/seller_wallet/seller_wallet_2024_03_01.py +301 -0
  165. sp_api/asyncio/api/sellers/sellers.py +16 -36
  166. sp_api/asyncio/api/services/services.py +479 -82
  167. sp_api/asyncio/api/shipment_invoicing/__init__.py +0 -0
  168. sp_api/asyncio/api/shipment_invoicing/shipment_invoicing.py +92 -0
  169. sp_api/asyncio/api/shipment_invoicing/shipment_invoicing_v0.py +102 -0
  170. sp_api/asyncio/api/shipping/shipping.py +94 -441
  171. sp_api/asyncio/api/shipping/shippingV2.py +181 -472
  172. sp_api/asyncio/api/shipping/shipping_v1.py +331 -0
  173. sp_api/asyncio/api/shipping/shipping_v2.py +717 -0
  174. sp_api/asyncio/api/solicitations/solicitations.py +29 -19
  175. sp_api/asyncio/api/supply_sources/supply_sources.py +67 -57
  176. sp_api/asyncio/api/tokens/tokens.py +14 -35
  177. sp_api/asyncio/api/vehicles/__init__.py +0 -0
  178. sp_api/asyncio/api/vehicles/vehicles.py +92 -0
  179. sp_api/asyncio/api/vehicles/vehicles_2024_11_01.py +34 -0
  180. sp_api/asyncio/api/vendor_direct_fulfillment_inventory/vendor_direct_fulfillment_inventory.py +16 -29
  181. sp_api/asyncio/api/vendor_direct_fulfillment_orders/vendor_direct_fulfillment_orders.py +120 -192
  182. sp_api/asyncio/api/vendor_direct_fulfillment_orders/vendor_direct_fulfillment_orders_2021_12_28.py +116 -0
  183. sp_api/asyncio/api/vendor_direct_fulfillment_orders/vendor_direct_fulfillment_orders_v1.py +115 -0
  184. sp_api/asyncio/api/vendor_direct_fulfillment_payments/vendor_direct_fulfillment_payments.py +15 -225
  185. sp_api/asyncio/api/vendor_direct_fulfillment_sandbox_test_data/__init__.py +0 -0
  186. sp_api/asyncio/api/vendor_direct_fulfillment_sandbox_test_data/vendor_direct_fulfillment_sandbox_test_data.py +92 -0
  187. sp_api/asyncio/api/vendor_direct_fulfillment_sandbox_test_data/vendor_direct_fulfillment_sandbox_test_data_2021_10_28.py +51 -0
  188. sp_api/asyncio/api/vendor_direct_fulfillment_shipping/vendor_direct_fulfillment_shipping.py +120 -623
  189. sp_api/asyncio/api/vendor_direct_fulfillment_shipping/vendor_direct_fulfillment_shipping_2021_12_28.py +392 -0
  190. sp_api/asyncio/api/vendor_direct_fulfillment_shipping/vendor_direct_fulfillment_shipping_v1.py +321 -0
  191. sp_api/asyncio/api/vendor_direct_fulfillment_transactions/vendor_direct_fulfillment_transactions.py +112 -29
  192. sp_api/asyncio/api/vendor_direct_fulfillment_transactions/vendor_direct_fulfillment_transactions_2021_12_28.py +49 -0
  193. sp_api/asyncio/api/vendor_direct_fulfillment_transactions/vendor_direct_fulfillment_transactions_v1.py +48 -0
  194. sp_api/asyncio/api/vendor_invoices/vendor_invoices.py +16 -265
  195. sp_api/asyncio/api/vendor_orders/vendor_orders.py +84 -132
  196. sp_api/asyncio/api/vendor_shipments/vendor_shipments.py +150 -69
  197. sp_api/asyncio/api/vendor_transaction_status/vendor_transaction_status.py +17 -12
  198. sp_api/asyncio/base/client.py +2 -2
  199. sp_api/asyncio/util/load_date_bound.py +1 -1
  200. sp_api/base/__init__.py +10 -0
  201. sp_api/base/_core.py +2 -2
  202. sp_api/base/client.py +3 -3
  203. sp_api/base/helpers.py +12 -1
  204. sp_api/base/marketplaces.py +6 -3
  205. sp_api/util/__init__.py +2 -0
  206. sp_api/util/load_date_bound.py +1 -1
  207. sp_api/util/versioned_client.py +45 -0
  208. python_amazon_sp_api-2.0.15.dist-info/RECORD +0 -255
  209. sp_api/asyncio/api/models/__init__.py +0 -4
  210. sp_api/asyncio/api/overrides/__init__.py +0 -1
  211. {python_amazon_sp_api-2.0.15.data → python_amazon_sp_api-2.1.3.data}/scripts/make_endpoint +0 -0
  212. {python_amazon_sp_api-2.0.15.dist-info → python_amazon_sp_api-2.1.3.dist-info}/WHEEL +0 -0
  213. {python_amazon_sp_api-2.0.15.dist-info → python_amazon_sp_api-2.1.3.dist-info}/licenses/LICENSE +0 -0
  214. {python_amazon_sp_api-2.0.15.dist-info → python_amazon_sp_api-2.1.3.dist-info}/top_level.txt +0 -0
@@ -1,170 +1,116 @@
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
1
+ from __future__ import annotations
2
+
3
+ import enum
4
+ from typing import Any, Literal, TYPE_CHECKING, overload
5
+
9
6
  from sp_api.asyncio.base import AsyncBaseClient
7
+ from sp_api.util.versioned_client import VersionedClientMeta
10
8
 
9
+ from .listings_items_2020_09_01 import ListingsItemsV20200901
10
+ from .listings_items_2021_08_01 import ListingsItemsV20210801
11
+
12
+
13
+ class ListingsItemsVersion(str, enum.Enum):
14
+ V_2020_09_01 = "2020-09-01"
15
+ V_2021_08_01 = "2021-08-01"
16
+ LATEST = "2021-08-01"
17
+
18
+
19
+ if TYPE_CHECKING:
20
+
21
+ class _ListingsItemsMeta(VersionedClientMeta):
22
+ @overload
23
+ def __call__(
24
+ cls,
25
+ *args: Any,
26
+ version: Literal[
27
+ ListingsItemsVersion.V_2021_08_01, ListingsItemsVersion.LATEST, "2021-08-01"
28
+ ],
29
+ **kwargs: Any,
30
+ ) -> ListingsItemsV20210801: ...
31
+
32
+ @overload
33
+ def __call__(
34
+ cls,
35
+ *args: Any,
36
+ version: Literal[ListingsItemsVersion.V_2020_09_01, "2020-09-01"],
37
+ **kwargs: Any,
38
+ ) -> ListingsItemsV20200901: ...
39
+
40
+ @overload
41
+ def __call__(
42
+ cls,
43
+ *args: Any,
44
+ version: None = None,
45
+ **kwargs: Any,
46
+ ) -> ListingsItemsV20200901: ...
47
+
48
+ @overload
49
+ def __call__(
50
+ cls,
51
+ *args: Any,
52
+ version: str | ListingsItemsVersion,
53
+ **kwargs: Any,
54
+ ) -> AsyncBaseClient: ...
11
55
 
12
- class ListingsItems(AsyncBaseClient):
13
- """
14
- ListingsItems SP-API Client
15
- :link:
16
56
 
17
- 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.
57
+ else:
58
+ _ListingsItemsMeta = VersionedClientMeta
18
59
 
19
- 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).
60
+
61
+ class ListingsItems(AsyncBaseClient, metaclass=_ListingsItemsMeta):
62
+ """Listings Items API client.
63
+
64
+ This class dispatches to a versioned Listings Items API client.
65
+
66
+ If you do not pass a version, the constructor returns the 2021-08-01 supported implementation ("2021-08-01").
20
67
  """
21
68
 
22
- @sp_endpoint("/listings/2021-08-01/items/{}/{}", method="DELETE")
23
- async def delete_listings_item(self, sellerId, sku, **kwargs) -> ApiResponse:
24
- """
25
- delete_listings_item(self, sellerId, sku, **kwargs) -> ApiResponse
26
- Delete a listings item for a selling partner.
27
- **Usage Plans:**
28
- ====================================== ==============
29
- Rate (requests per second) Burst
30
- ====================================== ==============
31
- 5 10
32
- ====================================== ==============
33
- The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
34
- Args:
35
- sellerId:string | * REQUIRED A selling partner identifier, such as a merchant account or vendor code.
36
- sku:string | * REQUIRED A selling partner provided identifier for an Amazon listing.
37
- key marketplaceIds:array | * REQUIRED A comma-delimited list of Amazon marketplace identifiers for the request.
38
- key issueLocale:string | A locale for localization of issues. 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.
39
- Returns:
40
- ApiResponse:
41
- """
42
-
43
- return await self._request(
44
- fill_query_params(kwargs.pop("path"), sellerId, sku), data=kwargs
45
- )
46
-
47
- @sp_endpoint("/listings/2021-08-01/items/{}/{}", method="GET")
48
- async def get_listings_item(self, sellerId, sku, **kwargs) -> ApiResponse:
49
- """
50
- get_listings_item(self, sellerId, **kwargs) -> ApiResponse
51
- Returns details about a listings item for a selling partner.
52
- **Usage Plan:**
53
- ====================================== ==============
54
- Rate (requests per second) Burst
55
- ====================================== ==============
56
- 5 10
57
- ====================================== ==============
58
- The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values then those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://github.com/amzn/selling-partner-api-docs/blob/main/guides/en-US/usage-plans-rate-limits/Usage-Plans-and-Rate-Limits.md).
59
- Args:
60
- sellerId:string | * REQUIRED A selling partner identifier, such as a merchant account or vendor code
61
- sku:string | * REQUIRED A selling partner provided identifier for an Amazon listing.
62
- key marketplaceIds:array | * REQUIRED A comma-delimited list of Amazon marketplace identifiers for the request.
63
- key issueLocale:string | A locale for localization of issues. 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.
64
- key includedData:array | A comma-delimited list of data sets to include in the response. Default: summaries.
65
- Returns:
66
- ApiResponse:
67
- """
68
- normalize_included_data(kwargs, enum_cls=IncludedData)
69
-
70
- return await self._request(
71
- fill_query_params(kwargs.pop("path"), sellerId, sku), params=kwargs
72
- )
73
-
74
- @sp_endpoint("/listings/2021-08-01/items/{}", method="GET")
75
- async def search_listings_items(self, sellerId, **kwargs) -> ApiResponse:
76
- """
77
- search_listings_items(self, sellerId, **kwargs) -> ApiResponse
78
- Search for and return list of listings items and respective details for a selling partner.
79
- **Usage Plan:**
80
- ====================================== ==============
81
- Rate (requests per second) Burst
82
- ====================================== ==============
83
- 5 5
84
- ====================================== ==============
85
- The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values then those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://github.com/amzn/selling-partner-api-docs/blob/main/guides/en-US/usage-plans-rate-limits/Usage-Plans-and-Rate-Limits.md).
86
- Args:
87
- sellerId:string | * REQUIRED A selling partner identifier, such as a merchant account or vendor code
88
- key marketplaceIds:array | * REQUIRED A comma-delimited list of Amazon marketplace identifiers for the request.
89
- key issueLocale:string | A locale for localization of issues. 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.
90
- key includedData:array | A comma-delimited list of data sets to include in the response. Default: summaries.
91
- Returns:
92
- ApiResponse:
93
- """
94
- normalize_included_data(kwargs, enum_cls=IncludedData)
95
-
96
- return await self._request(
97
- fill_query_params(kwargs.pop("path"), sellerId), params=kwargs
98
- )
99
-
100
- @sp_endpoint("/listings/2021-08-01/items/{}/{}", method="PATCH")
101
- async def patch_listings_item(self, sellerId, sku, **kwargs) -> ApiResponse:
102
- """
103
- patch_listings_item(self, sellerId, sku, **kwargs) -> ApiResponse
104
- Partially update (patch) a listings item for a selling partner. Only top-level listings item attributes can be patched. Patching nested attributes is not supported.
105
- **Usage Plans:**
106
- ====================================== ==============
107
- Rate (requests per second) Burst
108
- ====================================== ==============
109
- 5 10
110
- ====================================== ==============
111
- The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
112
- Args:
113
- sellerId:string | * REQUIRED A selling partner identifier, such as a merchant account or vendor code.
114
- sku:string | * REQUIRED A selling partner provided identifier for an Amazon listing.
115
- key marketplaceIds:array | * REQUIRED A comma-delimited list of Amazon marketplace identifiers for the request.
116
- key issueLocale:string | A locale for localization of issues. 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.
117
- body: {
118
- "productType": "string",
119
- "patches": [
120
- {
121
- "op": "add",
122
- "path": "string",
123
- "value": [
124
- {}
125
- ]
126
- }
127
- ]
128
- }
129
-
130
- Returns:
131
- ApiResponse:
132
- """
133
- return await self._request(
134
- fill_query_params(kwargs.pop("path"), sellerId, sku),
135
- data=kwargs.pop("body"),
136
- params=kwargs,
137
- )
138
-
139
- @sp_endpoint("/listings/2021-08-01/items/{}/{}", method="PUT")
140
- async def put_listings_item(self, sellerId, sku, **kwargs) -> ApiResponse:
141
- """
142
- put_listings_item(self, sellerId, sku, **kwargs) -> ApiResponse
143
- Creates a new or fully-updates an existing listings item for a selling partner.
144
- **Usage Plans:**
145
- ====================================== ==============
146
- Rate (requests per second) Burst
147
- ====================================== ==============
148
- 5 10
149
- ====================================== ==============
150
- The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
151
- Args:
152
- sellerId:string | * REQUIRED A selling partner identifier, such as a merchant account or vendor code.
153
- sku:string | * REQUIRED A selling partner provided identifier for an Amazon listing.
154
- key marketplaceIds:array | * REQUIRED A comma-delimited list of Amazon marketplace identifiers for the request.
155
- key issueLocale:string | A locale for localization of issues. 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.
156
- body: {
157
- "productType": "string",
158
- "requirements": "LISTING",
159
- "attributes": {}
160
- }
161
-
162
- Returns:
163
- ApiResponse:
164
- """
165
-
166
- return await self._request(
167
- fill_query_params(kwargs.pop("path"), sellerId, sku),
168
- data=kwargs.pop("body"),
169
- params=kwargs,
170
- )
69
+ if TYPE_CHECKING:
70
+ @overload
71
+ def __new__(
72
+ cls,
73
+ *args: Any,
74
+ version: Literal[
75
+ ListingsItemsVersion.V_2021_08_01, ListingsItemsVersion.LATEST, "2021-08-01"
76
+ ],
77
+ **kwargs: Any,
78
+ ) -> ListingsItemsV20210801: ...
79
+
80
+ @overload
81
+ def __new__(
82
+ cls,
83
+ *args: Any,
84
+ version: Literal[ListingsItemsVersion.V_2020_09_01, "2020-09-01"],
85
+ **kwargs: Any,
86
+ ) -> ListingsItemsV20200901: ...
87
+
88
+ @overload
89
+ def __new__(
90
+ cls,
91
+ *args: Any,
92
+ version: None = None,
93
+ **kwargs: Any,
94
+ ) -> ListingsItemsV20200901: ...
95
+
96
+ @overload
97
+ def __new__(
98
+ cls,
99
+ *args: Any,
100
+ version: str | ListingsItemsVersion,
101
+ **kwargs: Any,
102
+ ) -> AsyncBaseClient: ...
103
+
104
+ _DISPATCH = True
105
+
106
+ _DEFAULT_VERSION = "2021-08-01"
107
+
108
+ _VERSION_MAP = {
109
+ "2020-09-01": ListingsItemsV20200901,
110
+ "2021-08-01": ListingsItemsV20210801,
111
+ }
112
+
113
+ _VERSION_ALIASES = {
114
+ "2020-09-01": "2020-09-01",
115
+ "2021-08-01": "2021-08-01",
116
+ }
@@ -0,0 +1,190 @@
1
+ from sp_api.base import (
2
+ sp_endpoint,
3
+ fill_query_params,
4
+ ApiResponse,
5
+ IncludedData,
6
+ )
7
+ from sp_api.asyncio.base import AsyncBaseClient
8
+
9
+ from sp_api.util import normalize_included_data
10
+
11
+
12
+ class ListingsItemsV20200901(AsyncBaseClient):
13
+ """
14
+ ListingsItems SP-API Client
15
+ :link:
16
+
17
+ 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.
18
+
19
+ 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_2020-09-01.md).
20
+ """
21
+
22
+ @sp_endpoint("/listings/2020-09-01/items/{}/{}", method="DELETE")
23
+ async def delete_listings_item(self, sellerId, sku, **kwargs) -> ApiResponse:
24
+ """
25
+ delete_listings_item(self, sellerId, sku, **kwargs) -> ApiResponse
26
+
27
+ Delete a listings item for a selling partner.
28
+
29
+ **Note:** The parameters associated with this operation may contain special characters that must be encoded to successfully call the API. To avoid errors with SKUs when encoding URLs, refer to [URL Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding).
30
+
31
+ **Usage Plan:**
32
+
33
+ ====================================== ==============
34
+ Rate (requests per second) Burst
35
+ ====================================== ==============
36
+ 5 10
37
+ ====================================== ==============
38
+
39
+ For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
40
+
41
+ Examples:
42
+ literal blocks::
43
+
44
+ await ListingsItemsV20200901().delete_listings_item("value", "value")
45
+
46
+ Args:
47
+ sellerId: object | required A selling partner identifier, such as a merchant account or vendor code.
48
+ sku: object | required A selling partner provided identifier for an Amazon listing.
49
+ key marketplaceIds: object | required A comma-delimited list of Amazon marketplace identifiers for the request.
50
+ key issueLocale: object | A locale for localization of issues. 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.
51
+
52
+ Returns:
53
+ ApiResponse
54
+ """
55
+
56
+ return await self._request(
57
+ fill_query_params(kwargs.pop("path"), sellerId, sku), data=kwargs
58
+ )
59
+
60
+ @sp_endpoint("/listings/2020-09-01/items/{}/{}", method="GET")
61
+ async def get_listings_item(self, sellerId, sku, **kwargs) -> ApiResponse:
62
+ """
63
+ get_listings_item(self, sellerId, sku, **kwargs) -> ApiResponse
64
+
65
+ Returns details about a listings item for a selling partner.
66
+
67
+ Examples:
68
+ literal blocks::
69
+
70
+ await ListingsItemsV20200901().get_listings_item("value", "value")
71
+
72
+ Args:
73
+ sellerId: | required
74
+ sku: | required
75
+ **kwargs:
76
+
77
+ Returns:
78
+ ApiResponse
79
+ """
80
+ normalize_included_data(kwargs, enum_cls=IncludedData)
81
+
82
+ return await self._request(
83
+ fill_query_params(kwargs.pop("path"), sellerId, sku), params=kwargs
84
+ )
85
+
86
+ @sp_endpoint("/listings/2020-09-01/items/{}", method="GET")
87
+ async def search_listings_items(self, sellerId, **kwargs) -> ApiResponse:
88
+ """
89
+ search_listings_items(self, sellerId, **kwargs) -> ApiResponse
90
+
91
+ Search for and return list of listings items and respective details for a selling partner.
92
+
93
+ Examples:
94
+ literal blocks::
95
+
96
+ await ListingsItemsV20200901().search_listings_items("value")
97
+
98
+ Args:
99
+ sellerId: | required
100
+ **kwargs:
101
+
102
+ Returns:
103
+ ApiResponse
104
+ """
105
+ normalize_included_data(kwargs, enum_cls=IncludedData)
106
+
107
+ return await self._request(
108
+ fill_query_params(kwargs.pop("path"), sellerId), params=kwargs
109
+ )
110
+
111
+ @sp_endpoint("/listings/2020-09-01/items/{}/{}", method="PATCH")
112
+ async def patch_listings_item(self, sellerId, sku, **kwargs) -> ApiResponse:
113
+ """
114
+ patch_listings_item(self, sellerId, sku, **kwargs) -> ApiResponse
115
+
116
+ Partially update (patch) a listings item for a selling partner. Only top-level listings item attributes can be patched. Patching nested attributes is not supported.
117
+
118
+ **Note:** The parameters associated with this operation may contain special characters that must be encoded to successfully call the API. To avoid errors with SKUs when encoding URLs, refer to [URL Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding).
119
+
120
+ **Usage Plan:**
121
+
122
+ ====================================== ==============
123
+ Rate (requests per second) Burst
124
+ ====================================== ==============
125
+ 5 10
126
+ ====================================== ==============
127
+
128
+ For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
129
+
130
+ Examples:
131
+ literal blocks::
132
+
133
+ await ListingsItemsV20200901().patch_listings_item("value", "value")
134
+
135
+ Args:
136
+ sellerId: object | required A selling partner identifier, such as a merchant account or vendor code.
137
+ sku: object | required A selling partner provided identifier for an Amazon listing.
138
+ key marketplaceIds: object | required A comma-delimited list of Amazon marketplace identifiers for the request.
139
+ key issueLocale: object | A locale for localization of issues. 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.
140
+ body: ListingsItemPatchRequest | required The request body schema for the patchListingsItem operation.
141
+
142
+ Returns:
143
+ ApiResponse
144
+ """
145
+ return await self._request(
146
+ fill_query_params(kwargs.pop("path"), sellerId, sku),
147
+ data=kwargs.pop("body"),
148
+ params=kwargs,
149
+ )
150
+
151
+ @sp_endpoint("/listings/2020-09-01/items/{}/{}", method="PUT")
152
+ async def put_listings_item(self, sellerId, sku, **kwargs) -> ApiResponse:
153
+ """
154
+ put_listings_item(self, sellerId, sku, **kwargs) -> ApiResponse
155
+
156
+ Creates a new or fully-updates an existing listings item for a selling partner.
157
+
158
+ **Note:** The parameters associated with this operation may contain special characters that must be encoded to successfully call the API. To avoid errors with SKUs when encoding URLs, refer to [URL Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding).
159
+
160
+ **Usage Plan:**
161
+
162
+ ====================================== ==============
163
+ Rate (requests per second) Burst
164
+ ====================================== ==============
165
+ 5 10
166
+ ====================================== ==============
167
+
168
+ For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
169
+
170
+ Examples:
171
+ literal blocks::
172
+
173
+ await ListingsItemsV20200901().put_listings_item("value", "value")
174
+
175
+ Args:
176
+ sellerId: object | required A selling partner identifier, such as a merchant account or vendor code.
177
+ sku: object | required A selling partner provided identifier for an Amazon listing.
178
+ key marketplaceIds: object | required A comma-delimited list of Amazon marketplace identifiers for the request.
179
+ key issueLocale: object | A locale for localization of issues. 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.
180
+ body: ListingsItemPutRequest | required The request body schema for the putListingsItem operation.
181
+
182
+ Returns:
183
+ ApiResponse
184
+ """
185
+
186
+ return await self._request(
187
+ fill_query_params(kwargs.pop("path"), sellerId, sku),
188
+ data=kwargs.pop("body"),
189
+ params=kwargs,
190
+ )