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
@@ -0,0 +1,126 @@
1
+ from __future__ import annotations
2
+
3
+ import enum
4
+ from typing import Any, Literal, TYPE_CHECKING, overload
5
+
6
+ from sp_api.asyncio.base import AsyncBaseClient
7
+ from sp_api.util.versioned_client import VersionedClientMeta
8
+
9
+ from .inventory_2021_01_06 import ExternalFulfillmentInventoryV20210106
10
+ from .inventory_2024_09_11 import ExternalFulfillmentInventoryV20240911
11
+
12
+
13
+ class ExternalFulfillmentInventoryVersion(str, enum.Enum):
14
+ V_2021_01_06 = "2021-01-06"
15
+ V_2024_09_11 = "2024-09-11"
16
+ LATEST = "2024-09-11"
17
+
18
+
19
+ if TYPE_CHECKING:
20
+
21
+ class _ExternalFulfillmentInventoryMeta(VersionedClientMeta):
22
+ @overload
23
+ def __call__(
24
+ cls,
25
+ *args: Any,
26
+ version: Literal[
27
+ ExternalFulfillmentInventoryVersion.V_2024_09_11,
28
+ ExternalFulfillmentInventoryVersion.LATEST,
29
+ "2024-09-11",
30
+ ],
31
+ **kwargs: Any,
32
+ ) -> ExternalFulfillmentInventoryV20240911: ...
33
+
34
+ @overload
35
+ def __call__(
36
+ cls,
37
+ *args: Any,
38
+ version: Literal[
39
+ ExternalFulfillmentInventoryVersion.V_2021_01_06, "2021-01-06"
40
+ ],
41
+ **kwargs: Any,
42
+ ) -> ExternalFulfillmentInventoryV20210106: ...
43
+
44
+ @overload
45
+ def __call__(
46
+ cls,
47
+ *args: Any,
48
+ version: None = None,
49
+ **kwargs: Any,
50
+ ) -> ExternalFulfillmentInventoryV20210106: ...
51
+
52
+ @overload
53
+ def __call__(
54
+ cls,
55
+ *args: Any,
56
+ version: str | ExternalFulfillmentInventoryVersion,
57
+ **kwargs: Any,
58
+ ) -> AsyncBaseClient: ...
59
+
60
+
61
+ else:
62
+ _ExternalFulfillmentInventoryMeta = VersionedClientMeta
63
+
64
+
65
+ class ExternalFulfillmentInventory(
66
+ AsyncBaseClient, metaclass=_ExternalFulfillmentInventoryMeta
67
+ ):
68
+ """External Fulfillment Inventory API client.
69
+
70
+ This class dispatches to a versioned External Fulfillment Inventory API client.
71
+
72
+ If you do not pass a version, the constructor returns the oldest supported implementation ("2021-01-06").
73
+ """
74
+
75
+ if TYPE_CHECKING:
76
+ @overload
77
+ def __new__(
78
+ cls,
79
+ *args: Any,
80
+ version: Literal[
81
+ ExternalFulfillmentInventoryVersion.V_2024_09_11,
82
+ ExternalFulfillmentInventoryVersion.LATEST,
83
+ "2024-09-11",
84
+ ],
85
+ **kwargs: Any,
86
+ ) -> ExternalFulfillmentInventoryV20240911: ...
87
+
88
+ @overload
89
+ def __new__(
90
+ cls,
91
+ *args: Any,
92
+ version: Literal[
93
+ ExternalFulfillmentInventoryVersion.V_2021_01_06, "2021-01-06"
94
+ ],
95
+ **kwargs: Any,
96
+ ) -> ExternalFulfillmentInventoryV20210106: ...
97
+
98
+ @overload
99
+ def __new__(
100
+ cls,
101
+ *args: Any,
102
+ version: None = None,
103
+ **kwargs: Any,
104
+ ) -> ExternalFulfillmentInventoryV20210106: ...
105
+
106
+ @overload
107
+ def __new__(
108
+ cls,
109
+ *args: Any,
110
+ version: str | ExternalFulfillmentInventoryVersion,
111
+ **kwargs: Any,
112
+ ) -> AsyncBaseClient: ...
113
+
114
+ _DISPATCH = True
115
+
116
+ _DEFAULT_VERSION = "2021-01-06"
117
+
118
+ _VERSION_MAP = {
119
+ "2021-01-06": ExternalFulfillmentInventoryV20210106,
120
+ "2024-09-11": ExternalFulfillmentInventoryV20240911,
121
+ }
122
+
123
+ _VERSION_ALIASES = {
124
+ "2021-01-06": "2021-01-06",
125
+ "2024-09-11": "2024-09-11",
126
+ }
@@ -0,0 +1,73 @@
1
+ from sp_api.base import sp_endpoint, fill_query_params, ApiResponse
2
+ from sp_api.asyncio.base import AsyncBaseClient
3
+
4
+
5
+ class ExternalFulfillmentInventoryV20210106(AsyncBaseClient):
6
+ """
7
+ External Fulfillment Inventory API (version 2021-01-06).
8
+ """
9
+
10
+ @sp_endpoint("/externalFulfillment/inventory/2021-01-06/locations/{}/skus/{}", method="GET")
11
+ async def get_inventory(self, locationId, skuId, **kwargs) -> ApiResponse:
12
+ """
13
+ get_inventory(self, locationId, skuId, **kwargs) -> ApiResponse
14
+
15
+ Get the current inventory for a given SKU at a given location.
16
+
17
+ Examples:
18
+ literal blocks::
19
+
20
+ await ExternalFulfillmentInventoryV20210106().get_inventory("value", "value")
21
+
22
+ Args:
23
+ locationId: | required
24
+ skuId: | required
25
+ **kwargs:
26
+
27
+ Returns:
28
+ ApiResponse
29
+ """
30
+ headers = await self._get_headers()
31
+ return await self._request(
32
+ fill_query_params(kwargs.pop("path"), locationId, skuId),
33
+ params=kwargs,
34
+ headers=headers,
35
+ add_marketplace=False,
36
+ )
37
+
38
+
39
+ @sp_endpoint("/externalFulfillment/inventory/2021-01-06/locations/{}/skus/{}", method="PUT")
40
+ async def update_inventory(self, locationId, skuId, quantity, **kwargs) -> ApiResponse:
41
+ """
42
+ update_inventory(self, locationId, skuId, quantity, **kwargs) -> ApiResponse
43
+
44
+ Get the current inventory for a given SKU at a given location.
45
+
46
+ Examples:
47
+ literal blocks::
48
+
49
+ await ExternalFulfillmentInventoryV20210106().update_inventory("value", "value", "value")
50
+
51
+ Args:
52
+ locationId: | required
53
+ skuId: | required
54
+ quantity: | required
55
+ **kwargs:
56
+
57
+ Returns:
58
+ ApiResponse
59
+ """
60
+ kwargs["quantity"] = quantity
61
+
62
+ headers = await self._get_headers()
63
+ if "if_match" in kwargs:
64
+ headers["If-Match"] = kwargs.pop("if_match")
65
+ if "if_unmodified_since" in kwargs:
66
+ headers["If-Unmodified-Since"] = kwargs.pop("if_unmodified_since")
67
+
68
+ return await self._request(
69
+ fill_query_params(kwargs.pop("path"), locationId, skuId),
70
+ params=kwargs,
71
+ headers=headers,
72
+ add_marketplace=False,
73
+ )
@@ -0,0 +1,98 @@
1
+ from sp_api.base import sp_endpoint, fill_query_params, ApiResponse
2
+ from sp_api.asyncio.base import AsyncBaseClient
3
+
4
+
5
+ class ExternalFulfillmentInventoryV20240911(AsyncBaseClient):
6
+ """
7
+ External Fulfillment Inventory API (version 2024-09-11).
8
+ """
9
+
10
+ @sp_endpoint("/externalFulfillment/inventory/2024-09-11/locations/{}/skus/{}", method="GET")
11
+ async def get_inventory(self, locationId, skuId, **kwargs) -> ApiResponse:
12
+ """
13
+ get_inventory(self, locationId, skuId, **kwargs) -> ApiResponse
14
+
15
+ Get the current inventory for a given SKU at a given location.
16
+
17
+ Examples:
18
+ literal blocks::
19
+
20
+ await ExternalFulfillmentInventoryV20240911().get_inventory("value", "value")
21
+
22
+ Args:
23
+ locationId: | required
24
+ skuId: | required
25
+ **kwargs:
26
+
27
+ Returns:
28
+ ApiResponse
29
+ """
30
+ headers = await self._get_headers()
31
+ return await self._request(
32
+ fill_query_params(kwargs.pop("path"), locationId, skuId),
33
+ params=kwargs,
34
+ headers=headers,
35
+ add_marketplace=False,
36
+ )
37
+
38
+
39
+ @sp_endpoint("/externalFulfillment/inventory/2024-09-11/locations/{}/skus/{}", method="PUT")
40
+ async def update_inventory(self, locationId, skuId, quantity, **kwargs) -> ApiResponse:
41
+ """
42
+ update_inventory(self, locationId, skuId, quantity, **kwargs) -> ApiResponse
43
+
44
+ Get the current inventory for a given SKU at a given location.
45
+
46
+ Examples:
47
+ literal blocks::
48
+
49
+ await ExternalFulfillmentInventoryV20240911().update_inventory("value", "value", "value")
50
+
51
+ Args:
52
+ locationId: | required
53
+ skuId: | required
54
+ quantity: | required
55
+ **kwargs:
56
+
57
+ Returns:
58
+ ApiResponse
59
+ """
60
+ kwargs["quantity"] = quantity
61
+
62
+ headers = await self._get_headers()
63
+ if "if_match" in kwargs:
64
+ headers["If-Match"] = kwargs.pop("if_match")
65
+ if "if_unmodified_since" in kwargs:
66
+ headers["If-Unmodified-Since"] = kwargs.pop("if_unmodified_since")
67
+
68
+ return await self._request(
69
+ fill_query_params(kwargs.pop("path"), locationId, skuId),
70
+ params=kwargs,
71
+ headers=headers,
72
+ add_marketplace=False,
73
+ )
74
+
75
+ @sp_endpoint("/externalFulfillment/inventory/2024-09-11/inventories", method="POST")
76
+ async def batch_inventory(self, **kwargs) -> ApiResponse:
77
+ """
78
+ batch_inventory(self, **kwargs) -> ApiResponse
79
+
80
+ Make up to 10 inventory requests. The response includes the set of responses that correspond to requests. The response for each successful request in the set includes the inventory count for the provided `sku` and `locationId` pair.
81
+
82
+ Examples:
83
+ literal blocks::
84
+
85
+ await ExternalFulfillmentInventoryV20240911().batch_inventory()
86
+
87
+ Args:
88
+ body: BatchInventoryRequest | required A list of inventory requests.
89
+
90
+ Returns:
91
+ ApiResponse
92
+ """
93
+
94
+ return await self._request(
95
+ kwargs.pop("path"),
96
+ data=kwargs,
97
+ add_marketplace=False,
98
+ )
@@ -0,0 +1,124 @@
1
+ from __future__ import annotations
2
+
3
+ import enum
4
+ from typing import Any, Literal, TYPE_CHECKING, overload
5
+
6
+ from sp_api.asyncio.base import AsyncBaseClient
7
+ from sp_api.util.versioned_client import VersionedClientMeta
8
+
9
+ from .returns_2021_08_19 import ExternalFulfillmentReturnsV20210819
10
+ from .returns_2024_09_11 import ExternalFulfillmentReturnsV20240911
11
+
12
+
13
+ class ExternalFulfillmentReturnsVersion(str, enum.Enum):
14
+ V_2021_08_19 = "2021-08-19"
15
+ V_2024_09_11 = "2024-09-11"
16
+ LATEST = "2024-09-11"
17
+
18
+
19
+ if TYPE_CHECKING:
20
+
21
+ class _ExternalFulfillmentReturnsMeta(VersionedClientMeta):
22
+ @overload
23
+ def __call__(
24
+ cls,
25
+ *args: Any,
26
+ version: Literal[
27
+ ExternalFulfillmentReturnsVersion.V_2024_09_11,
28
+ ExternalFulfillmentReturnsVersion.LATEST,
29
+ "2024-09-11",
30
+ ],
31
+ **kwargs: Any,
32
+ ) -> ExternalFulfillmentReturnsV20240911: ...
33
+
34
+ @overload
35
+ def __call__(
36
+ cls,
37
+ *args: Any,
38
+ version: Literal[
39
+ ExternalFulfillmentReturnsVersion.V_2021_08_19, "2021-08-19"
40
+ ],
41
+ **kwargs: Any,
42
+ ) -> ExternalFulfillmentReturnsV20210819: ...
43
+
44
+ @overload
45
+ def __call__(
46
+ cls,
47
+ *args: Any,
48
+ version: None = None,
49
+ **kwargs: Any,
50
+ ) -> ExternalFulfillmentReturnsV20210819: ...
51
+
52
+ @overload
53
+ def __call__(
54
+ cls,
55
+ *args: Any,
56
+ version: str | ExternalFulfillmentReturnsVersion,
57
+ **kwargs: Any,
58
+ ) -> AsyncBaseClient: ...
59
+
60
+
61
+ else:
62
+ _ExternalFulfillmentReturnsMeta = VersionedClientMeta
63
+
64
+
65
+ class ExternalFulfillmentReturns(AsyncBaseClient, metaclass=_ExternalFulfillmentReturnsMeta):
66
+ """External Fulfillment Returns API client.
67
+
68
+ This class dispatches to a versioned External Fulfillment Returns API client.
69
+
70
+ If you do not pass a version, the constructor returns the oldest supported implementation ("2021-08-19").
71
+ """
72
+
73
+ if TYPE_CHECKING:
74
+ @overload
75
+ def __new__(
76
+ cls,
77
+ *args: Any,
78
+ version: Literal[
79
+ ExternalFulfillmentReturnsVersion.V_2024_09_11,
80
+ ExternalFulfillmentReturnsVersion.LATEST,
81
+ "2024-09-11",
82
+ ],
83
+ **kwargs: Any,
84
+ ) -> ExternalFulfillmentReturnsV20240911: ...
85
+
86
+ @overload
87
+ def __new__(
88
+ cls,
89
+ *args: Any,
90
+ version: Literal[
91
+ ExternalFulfillmentReturnsVersion.V_2021_08_19, "2021-08-19"
92
+ ],
93
+ **kwargs: Any,
94
+ ) -> ExternalFulfillmentReturnsV20210819: ...
95
+
96
+ @overload
97
+ def __new__(
98
+ cls,
99
+ *args: Any,
100
+ version: None = None,
101
+ **kwargs: Any,
102
+ ) -> ExternalFulfillmentReturnsV20210819: ...
103
+
104
+ @overload
105
+ def __new__(
106
+ cls,
107
+ *args: Any,
108
+ version: str | ExternalFulfillmentReturnsVersion,
109
+ **kwargs: Any,
110
+ ) -> AsyncBaseClient: ...
111
+
112
+ _DISPATCH = True
113
+
114
+ _DEFAULT_VERSION = "2021-08-19"
115
+
116
+ _VERSION_MAP = {
117
+ "2021-08-19": ExternalFulfillmentReturnsV20210819,
118
+ "2024-09-11": ExternalFulfillmentReturnsV20240911,
119
+ }
120
+
121
+ _VERSION_ALIASES = {
122
+ "2021-08-19": "2021-08-19",
123
+ "2024-09-11": "2024-09-11",
124
+ }
@@ -0,0 +1,90 @@
1
+ import uuid
2
+
3
+ from sp_api.base import sp_endpoint, ApiResponse, fill_query_params
4
+ from sp_api.asyncio.base import AsyncBaseClient
5
+
6
+
7
+ class ExternalFulfillmentReturnsV20210819(AsyncBaseClient):
8
+ """
9
+ External Fulfillment Returns API (version 2021-08-19).
10
+ """
11
+
12
+ @sp_endpoint("/externalFulfillment/returns/2021-08-19/returns", method="GET")
13
+ async def list_returns(self, **kwargs) -> ApiResponse:
14
+ """
15
+ list_returns(self, **kwargs) -> ApiResponse
16
+
17
+ Get a list of return items dropped for the seller in the specified node, and in the specified status. Returns can be further filtered based on their creation date/time
18
+
19
+ Examples:
20
+ literal blocks::
21
+
22
+ await ExternalFulfillmentReturnsV20210819().list_returns()
23
+
24
+ Args:
25
+ **kwargs:
26
+
27
+ Returns:
28
+ ApiResponse
29
+ """
30
+
31
+ return await self._request(kwargs.pop("path"), params=kwargs, add_marketplace=False)
32
+
33
+
34
+ @sp_endpoint("/externalFulfillment/returns/2021-08-19/returns/{}", method="GET")
35
+ async def get_return(self, returnId, **kwargs) -> ApiResponse:
36
+ """
37
+ get_return(self, returnId, **kwargs) -> ApiResponse
38
+
39
+ Get a single return item with the specified id.
40
+
41
+ Examples:
42
+ literal blocks::
43
+
44
+ await ExternalFulfillmentReturnsV20210819().get_return("value")
45
+
46
+ Args:
47
+ returnId: | required
48
+ **kwargs:
49
+
50
+ Returns:
51
+ ApiResponse
52
+ """
53
+ return await self._request(
54
+ fill_query_params(kwargs.pop("path"), returnId),
55
+ params=kwargs,
56
+ add_marketplace=False,
57
+ )
58
+
59
+ @sp_endpoint("/externalFulfillment/returns/2021-08-19/returns/{}", method="PATCH")
60
+ async def process_return_item(self, returnId, **kwargs) -> ApiResponse:
61
+ """
62
+ process_return_item(self, returnId, **kwargs) -> ApiResponse
63
+
64
+ Process a return by grading. Determine the item condition and update the quantities for each item condition.
65
+
66
+ Examples:
67
+ literal blocks::
68
+
69
+ await ExternalFulfillmentReturnsV20210819().process_return_item("value")
70
+
71
+ Args:
72
+ returnId: | required
73
+ **kwargs:
74
+
75
+ Returns:
76
+ ApiResponse
77
+ """
78
+
79
+ headers = await self._get_headers()
80
+ if "x-amzn-idempotency-token" in kwargs:
81
+ headers["x-amzn-idempotency-token"] = kwargs.pop("x-amzn-idempotency-token")
82
+ else:
83
+ headers["x-amzn-idempotency-token"] = str(uuid.uuid4())
84
+
85
+ return await self._request(
86
+ fill_query_params(kwargs.pop("path"), returnId),
87
+ data=kwargs,
88
+ headers=headers,
89
+ add_marketplace=False,
90
+ )
@@ -0,0 +1,143 @@
1
+ import uuid
2
+
3
+ from sp_api.base import sp_endpoint, ApiResponse, fill_query_params
4
+ from sp_api.asyncio.base import AsyncBaseClient
5
+
6
+
7
+ class ExternalFulfillmentReturnsV20240911(AsyncBaseClient):
8
+ """
9
+ External Fulfillment Returns API (version 2024-09-11).
10
+ """
11
+
12
+ @sp_endpoint("/externalFulfillment/returns/2024-09-11/returns", method="GET")
13
+ async def list_returns(self, **kwargs) -> ApiResponse:
14
+ """
15
+ list_returns(self, **kwargs) -> ApiResponse
16
+
17
+ Get a list of return items dropped for the seller in the specified node, and in the specified status. Returns can be further filtered based on their creation date/time
18
+
19
+ Examples:
20
+ literal blocks::
21
+
22
+ await ExternalFulfillmentReturnsV20240911().list_returns()
23
+
24
+ Args:
25
+ **kwargs:
26
+
27
+ Returns:
28
+ ApiResponse
29
+ """
30
+
31
+ return await self._request(kwargs.pop("path"), params=kwargs, add_marketplace=False)
32
+
33
+
34
+ @sp_endpoint("/externalFulfillment/returns/2024-09-11/returns/{}", method="GET")
35
+ async def get_return(self, returnId, **kwargs) -> ApiResponse:
36
+ """
37
+ get_return(self, returnId, **kwargs) -> ApiResponse
38
+
39
+ Get a single return item with the specified id.
40
+
41
+ Examples:
42
+ literal blocks::
43
+
44
+ await ExternalFulfillmentReturnsV20240911().get_return("value")
45
+
46
+ Args:
47
+ returnId: | required
48
+ **kwargs:
49
+
50
+ Returns:
51
+ ApiResponse
52
+ """
53
+ return await self._request(
54
+ fill_query_params(kwargs.pop("path"), returnId),
55
+ params=kwargs,
56
+ add_marketplace=False,
57
+ )
58
+
59
+ @sp_endpoint("/externalFulfillment/returns/2024-09-11/returns/{}", method="PATCH")
60
+ async def process_return_item(self, returnId, **kwargs) -> ApiResponse:
61
+ """
62
+ process_return_item(self, returnId, **kwargs) -> ApiResponse
63
+
64
+ Process a return by grading. Determine the item condition and update the quantities for each item condition.
65
+
66
+ Examples:
67
+ literal blocks::
68
+
69
+ await ExternalFulfillmentReturnsV20240911().process_return_item("value")
70
+
71
+ Args:
72
+ returnId: | required
73
+ **kwargs:
74
+
75
+ Returns:
76
+ ApiResponse
77
+ """
78
+
79
+ headers = await self._get_headers()
80
+ if "x-amzn-idempotency-token" in kwargs:
81
+ headers["x-amzn-idempotency-token"] = kwargs.pop("x-amzn-idempotency-token")
82
+ else:
83
+ headers["x-amzn-idempotency-token"] = str(uuid.uuid4())
84
+
85
+ return await self._request(
86
+ fill_query_params(kwargs.pop("path"), returnId),
87
+ data=kwargs,
88
+ headers=headers,
89
+ add_marketplace=False,
90
+ )
91
+
92
+ @sp_endpoint("/externalFulfillment/2024-09-11/returns", method="GET")
93
+ async def list_returns_get(self, **kwargs) -> ApiResponse:
94
+ """
95
+ list_returns_get(self, **kwargs) -> ApiResponse
96
+
97
+ Retrieve a list of return items. You can filter results by location, RMA ID, status, or time.
98
+
99
+ Examples:
100
+ literal blocks::
101
+
102
+ await ExternalFulfillmentReturnsV20240911().list_returns_get()
103
+
104
+ Args:
105
+ key returnLocationId: object | The SmartConnect location ID of the location from which you want to retrieve return items.
106
+ key rmaId: object | The RMA ID of the return items you want to list.
107
+ key status: object | The status of return items you want to list. You can retrieve all new return items with the `CREATED` status.
108
+ key reverseTrackingId: object | The reverse tracking ID of the return items you want to list.
109
+ key createdSince: object | Return items created after the specified date are included in the response. In [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format.
110
+ key createdUntil: object | Return items created before the specified date are included in the response. In [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format.
111
+ key lastUpdatedSince: object | Return items updated after the specified date are included in the response. In [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. If you supply this parameter, you must also supply `returnLocationId` and `status`.
112
+ key lastUpdatedUntil: object | Return items whose most recent update is before the specified date are included in the response. In [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. If you supply this parameter, you must also supply `returnLocationId` and `status`.
113
+ key lastUpdatedAfter: object | DEPRECATED. Use the `createdSince` parameter.
114
+ key lastUpdatedBefore: object | DEPRECATED. Use the `createdUntil` parameter.
115
+ key maxResults: object | The number of return items you want to include in the response.
116
+ **Default:** 10
117
+ **Maximum:** 100
118
+ key nextToken: object | A token that you use to retrieve the next page of results. The response includes `nextToken` when there are multiple pages of results. To get the next page of results, call the operation with this token and include the same arguments as the call that produced the token. To get a complete list, call this operation until `nextToken` is null. Note that this operation can return empty pages.
119
+
120
+ Returns:
121
+ ApiResponse
122
+ """
123
+ return await self._request(kwargs.pop("path"), params=kwargs, add_marketplace=False)
124
+
125
+ @sp_endpoint("/externalFulfillment/2024-09-11/returns/{}", method="GET")
126
+ async def get_return_get(self, returnId, **kwargs) -> ApiResponse:
127
+ """
128
+ get_return_get(self, returnId, **kwargs) -> ApiResponse
129
+
130
+ Retrieve the return item with the specified ID.
131
+
132
+ Examples:
133
+ literal blocks::
134
+
135
+ await ExternalFulfillmentReturnsV20240911().get_return_get("value")
136
+
137
+ Args:
138
+ returnId: object | required The ID of the return item you want.
139
+
140
+ Returns:
141
+ ApiResponse
142
+ """
143
+ return await self._request(fill_query_params(kwargs.pop("path"), returnId), params=kwargs, add_marketplace=False)