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,717 @@
1
+ import enum
2
+ import os
3
+ import urllib.parse
4
+ from datetime import datetime
5
+
6
+ from sp_api.base import (
7
+ sp_endpoint,
8
+ fill_query_params,
9
+ ApiResponse,
10
+ Marketplaces,
11
+ )
12
+ from sp_api.asyncio.base import AsyncBaseClient
13
+
14
+
15
+ class AmznShippingBusiness(str, enum.Enum):
16
+ US = "AmazonShipping_US"
17
+ IN = "AmazonShipping_IN"
18
+ UK = "AmazonShipping_UK"
19
+ AE = "AmazonShipping_UAE"
20
+ SA = "AmazonShipping_SA"
21
+ IT = "AmazonShipping_IT"
22
+ EG = "AmazonShipping_EG"
23
+ ES = "AmazonShipping_ES"
24
+ FR = "AmazonShipping_FR"
25
+ JP = "AmazonShipping_JP"
26
+
27
+ @classmethod
28
+ def has_key(cls, name):
29
+ return name in cls.__members__
30
+
31
+
32
+ class ShippingV2(AsyncBaseClient):
33
+ """
34
+ Shipping V2 SP-API Client
35
+ :link:
36
+
37
+ Provides programmatic access to Amazon Shipping APIs.
38
+ """
39
+
40
+ amzn_shipping_business: AmznShippingBusiness = AmznShippingBusiness.US
41
+
42
+ def __init__(self, *args, **kwargs):
43
+ if "amzn_shipping_business" in kwargs:
44
+ self.amzn_shipping_business = kwargs.pop(
45
+ "amzn_shipping_business", AmznShippingBusiness.US
46
+ )
47
+ else:
48
+ marketplace = args[0] if len(args) > 0 else Marketplaces.US
49
+ if os.environ.get("SP_API_DEFAULT_MARKETPLACE", None):
50
+ marketplace = Marketplaces[os.environ.get("SP_API_DEFAULT_MARKETPLACE")]
51
+
52
+ if AmznShippingBusiness.has_key(marketplace.name):
53
+ self.amzn_shipping_business = AmznShippingBusiness[marketplace.name]
54
+
55
+ super().__init__(*args, **kwargs)
56
+
57
+ async def _get_headers(self, access_token=None):
58
+ headers = await super()._get_headers(access_token=access_token)
59
+ headers["x-amzn-shipping-business-id"] = self.amzn_shipping_business.value
60
+ return headers
61
+
62
+ @sp_endpoint("/shipping/v2/shipments/rates", method="POST")
63
+ async def get_rates(self, **kwargs) -> ApiResponse:
64
+ """
65
+ get_rates(self, **kwargs) -> ApiResponse
66
+
67
+ Returns the available shipping service offerings.
68
+
69
+ **Usage Plan:**
70
+
71
+ ====================================== ==============
72
+ Rate (requests per second) Burst
73
+ ====================================== ==============
74
+ 80 100
75
+ ====================================== ==============
76
+
77
+ For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
78
+
79
+ Examples:
80
+ literal blocks::
81
+
82
+ await ShippingV2().get_rates()
83
+
84
+ Args:
85
+ body: GetRatesRequest | required GetRatesRequest body
86
+ x-amzn-shipping-business-id: object | Amazon shipping business to assume for this request. The default is AmazonShipping_UK.
87
+
88
+ Returns:
89
+ ApiResponse
90
+ """
91
+
92
+ return await self._request(kwargs.pop("path"), data=kwargs, add_marketplace=False)
93
+
94
+ @sp_endpoint("/shipping/v2/shipments", method="POST")
95
+ async def purchase_shipment(self, **kwargs) -> ApiResponse:
96
+ """
97
+ purchase_shipment(self, **kwargs) -> ApiResponse
98
+
99
+ Purchases a shipping service and returns purchase related details and documents.
100
+
101
+ Note: You must complete the purchase within 10 minutes of rate creation by the shipping service provider. If you make the request after the 10 minutes have expired, you will receive an error response with the error code equal to "TOKEN_EXPIRED". If you receive this error response, you must get the rates for the shipment again.
102
+
103
+ **Usage Plan:**
104
+
105
+ ====================================== ==============
106
+ Rate (requests per second) Burst
107
+ ====================================== ==============
108
+ 80 100
109
+ ====================================== ==============
110
+
111
+ For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
112
+
113
+ Examples:
114
+ literal blocks::
115
+
116
+ await ShippingV2().purchase_shipment()
117
+
118
+ Args:
119
+ body: PurchaseShipmentRequest | required PurchaseShipmentRequest body
120
+ x-amzn-IdempotencyKey: object | A unique value which the server uses to recognize subsequent retries of the same request.
121
+ x-amzn-shipping-business-id: object | Amazon shipping business to assume for this request. The default is AmazonShipping_UK.
122
+
123
+ Returns:
124
+ ApiResponse
125
+ """
126
+ return await self._request(kwargs.pop("path"), data=kwargs, add_marketplace=False)
127
+
128
+ @sp_endpoint("/shipping/v2/oneClickShipment", method="POST")
129
+ async def one_click_shipment(self, **kwargs) -> ApiResponse:
130
+ """
131
+ one_click_shipment(self, **kwargs) -> ApiResponse
132
+
133
+ Purchases a shipping service identifier and returns purchase-related details and documents.
134
+
135
+ **Usage Plan:**
136
+
137
+ ====================================== ==============
138
+ Rate (requests per second) Burst
139
+ ====================================== ==============
140
+ 80 100
141
+ ====================================== ==============
142
+
143
+ For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
144
+
145
+ Examples:
146
+ literal blocks::
147
+
148
+ await ShippingV2().one_click_shipment()
149
+
150
+ Args:
151
+ body: OneClickShipmentRequest | required OneClickShipmentRequest body
152
+ x-amzn-shipping-business-id: object | Amazon shipping business to assume for this request. The default is AmazonShipping_UK.
153
+
154
+ Returns:
155
+ ApiResponse
156
+ """
157
+ return await self._request(kwargs.pop("path"), data=kwargs, add_marketplace=False)
158
+
159
+ @sp_endpoint("/shipping/v2/tracking", method="GET")
160
+ async def get_tracking(self, **kwargs) -> ApiResponse:
161
+ """
162
+ get_tracking(self, **kwargs) -> ApiResponse
163
+
164
+ Returns tracking information for a purchased shipment.
165
+
166
+ **Usage Plan:**
167
+
168
+ ====================================== ==============
169
+ Rate (requests per second) Burst
170
+ ====================================== ==============
171
+ 80 100
172
+ ====================================== ==============
173
+
174
+ For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
175
+
176
+ Examples:
177
+ literal blocks::
178
+
179
+ await ShippingV2().get_tracking()
180
+
181
+ Args:
182
+ key trackingId: object | required A carrier-generated tracking identifier originally returned by the purchaseShipment operation.
183
+ key carrierId: object | required A carrier identifier originally returned by the getRates operation for the selected rate.
184
+ x-amzn-shipping-business-id: object | Amazon shipping business to assume for this request. The default is AmazonShipping_UK.
185
+
186
+ Returns:
187
+ ApiResponse
188
+ """
189
+ return await self._request(kwargs.pop("path"), params=kwargs, add_marketplace=False)
190
+
191
+ @sp_endpoint("/shipping/v2/shipments/{}/documents", method="GET")
192
+ async def get_shipment_documents(self, shipmentId, **kwargs) -> ApiResponse:
193
+ """
194
+ get_shipment_documents(self, shipmentId, **kwargs) -> ApiResponse
195
+
196
+ Returns the shipping documents associated with a package in a shipment.
197
+
198
+ **Usage Plan:**
199
+
200
+ ====================================== ==============
201
+ Rate (requests per second) Burst
202
+ ====================================== ==============
203
+ 80 100
204
+ ====================================== ==============
205
+
206
+ For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
207
+
208
+ Examples:
209
+ literal blocks::
210
+
211
+ await ShippingV2().get_shipment_documents("value")
212
+
213
+ Args:
214
+ shipmentId: object | required The shipment identifier originally returned by the purchaseShipment operation.
215
+ key packageClientReferenceId: object | required The package client reference identifier originally provided in the request body parameter for the getRates operation.
216
+ key format: object | The file format of the document. Must be one of the supported formats returned by the getRates operation.
217
+ key dpi: object | The resolution of the document (for example, 300 means 300 dots per inch). Must be one of the supported resolutions returned in the response to the getRates operation.
218
+ x-amzn-shipping-business-id: object | Amazon shipping business to assume for this request. The default is AmazonShipping_UK.
219
+
220
+ Returns:
221
+ ApiResponse
222
+ """
223
+
224
+ return await self._request(
225
+ fill_query_params(kwargs.pop("path"), shipmentId),
226
+ params=kwargs,
227
+ add_marketplace=False,
228
+ )
229
+
230
+ @sp_endpoint("/shipping/v2/shipments/{}/cancel", method="PUT")
231
+ async def cancel_shipment(self, shipmentId, **kwargs) -> ApiResponse:
232
+ """
233
+ cancel_shipment(self, shipmentId, **kwargs) -> ApiResponse
234
+
235
+ Cancels a purchased shipment. Returns an empty object if the shipment is successfully cancelled.
236
+
237
+ **Usage Plan:**
238
+
239
+ ====================================== ==============
240
+ Rate (requests per second) Burst
241
+ ====================================== ==============
242
+ 80 100
243
+ ====================================== ==============
244
+
245
+ For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
246
+
247
+ Examples:
248
+ literal blocks::
249
+
250
+ await ShippingV2().cancel_shipment("value")
251
+
252
+ Args:
253
+ shipmentId: object | required The shipment identifier originally returned by the purchaseShipment operation.
254
+ x-amzn-shipping-business-id: object | Amazon shipping business to assume for this request. The default is AmazonShipping_UK.
255
+
256
+ Returns:
257
+ ApiResponse
258
+ """
259
+ return await self._request(
260
+ fill_query_params(kwargs.pop("path"), shipmentId),
261
+ data=kwargs,
262
+ add_marketplace=False,
263
+ )
264
+
265
+ @sp_endpoint("/shipping/v2/accessPoints", method="GET")
266
+ async def get_access_points(self, **kwargs) -> ApiResponse:
267
+ """
268
+ get_access_points(self, **kwargs) -> ApiResponse
269
+
270
+ Returns a list of access points in proximity of input postal code.
271
+
272
+ **Usage Plan:**
273
+
274
+ ====================================== ==============
275
+ Rate (requests per second) Burst
276
+ ====================================== ==============
277
+ 80 100
278
+ ====================================== ==============
279
+
280
+ For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
281
+
282
+ Examples:
283
+ literal blocks::
284
+
285
+ await ShippingV2().get_access_points()
286
+
287
+ Args:
288
+ key accessPointTypes: object | required Access point types
289
+ key countryCode: object | required Country code for access point
290
+ key postalCode: object | required postal code for access point
291
+ x-amzn-shipping-business-id: object | Amazon shipping business to assume for this request. The default is AmazonShipping_UK.
292
+
293
+ Returns:
294
+ ApiResponse
295
+ """
296
+ return await self._request(kwargs.pop("path"), params=kwargs, add_marketplace=False)
297
+
298
+ @sp_endpoint("/shipping/v2/ndrFeedback", method="POST")
299
+ async def submit_ndr_feedback(self, **kwargs) -> ApiResponse:
300
+ """
301
+ submit_ndr_feedback(self, **kwargs) -> ApiResponse
302
+
303
+ This API submits the NDR (Non-delivery Report) Feedback for any eligible shipment.
304
+
305
+ **Usage Plan:**
306
+
307
+ ====================================== ==============
308
+ Rate (requests per second) Burst
309
+ ====================================== ==============
310
+ 80 100
311
+ ====================================== ==============
312
+
313
+ For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
314
+
315
+ Examples:
316
+ literal blocks::
317
+
318
+ await ShippingV2().submit_ndr_feedback()
319
+
320
+ Args:
321
+ body: SubmitNdrFeedbackRequest | required Request body for ndrFeedback operation
322
+ x-amzn-shipping-business-id: object | Amazon shipping business to assume for this request. The default is AmazonShipping_UK.
323
+
324
+ Returns:
325
+ ApiResponse
326
+ """
327
+ return await self._request(kwargs.pop("path"), data=kwargs, add_marketplace=False)
328
+
329
+ @sp_endpoint("/shipping/v2/shipments/additionalInputs/schema", method="GET")
330
+ async def get_additional_inputs(self, **kwargs) -> ApiResponse:
331
+ """
332
+ get_additional_inputs(self, **kwargs) -> ApiResponse
333
+
334
+ Returns the JSON schema to use for providing additional inputs when needed to purchase a shipping offering. Call the getAdditionalInputs operation when the response to a previous call to the getRates operation indicates that additional inputs are required for the rate (shipping offering) that you want to purchase.
335
+
336
+ **Usage Plan:**
337
+
338
+ ====================================== ==============
339
+ Rate (requests per second) Burst
340
+ ====================================== ==============
341
+ 80 100
342
+ ====================================== ==============
343
+
344
+ For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
345
+
346
+ Examples:
347
+ literal blocks::
348
+
349
+ await ShippingV2().get_additional_inputs()
350
+
351
+ Args:
352
+ key requestToken: object | required The request token returned in the response to the getRates operation.
353
+ key rateId: object | required The rate identifier for the shipping offering (rate) returned in the response to the getRates operation.
354
+ x-amzn-shipping-business-id: object | Amazon shipping business to assume for this request. The default is AmazonShipping_UK.
355
+
356
+ Returns:
357
+ ApiResponse
358
+ """
359
+ return await self._request(kwargs.pop("path"), params=kwargs, add_marketplace=False)
360
+
361
+
362
+ @sp_endpoint("/shipping/v2/shipments/directPurchase", method="POST")
363
+ async def direct_purchase_shipment(self, **kwargs) -> ApiResponse:
364
+ """
365
+ direct_purchase_shipment(self, **kwargs) -> ApiResponse
366
+
367
+ Purchases the shipping service for a shipment using the best fit service offering. Returns purchase related details and documents.
368
+
369
+ **Usage Plan:**
370
+
371
+ ====================================== ==============
372
+ Rate (requests per second) Burst
373
+ ====================================== ==============
374
+ 80 100
375
+ ====================================== ==============
376
+
377
+ For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
378
+
379
+ Examples:
380
+ literal blocks::
381
+
382
+ await ShippingV2().direct_purchase_shipment()
383
+
384
+ Args:
385
+ body: DirectPurchaseRequest | required DirectPurchaseRequest body
386
+ x-amzn-IdempotencyKey: object | A unique value which the server uses to recognize subsequent retries of the same request.
387
+ locale: object | The IETF Language Tag. Note that this only supports the primary language subtag with one secondary language subtag (i.e. en-US, fr-CA).
388
+ The secondary language subtag is almost always a regional designation.
389
+ This does not support additional subtags beyond the primary and secondary language subtags.
390
+ x-amzn-shipping-business-id: object | Amazon shipping business to assume for this request. The default is AmazonShipping_UK.
391
+
392
+ Returns:
393
+ ApiResponse
394
+ """
395
+ return await self._request(kwargs.pop("path"), data=kwargs)
396
+
397
+
398
+
399
+
400
+
401
+
402
+
403
+ @sp_endpoint("/shipping/v2/carrierAccountFormInputs", method="GET")
404
+ async def get_carrier_account_form_inputs(self, **kwargs) -> ApiResponse:
405
+ """
406
+ get_carrier_account_form_inputs(self, **kwargs) -> ApiResponse
407
+
408
+ This API will return a list of input schema required to register a shipper account with the carrier.
409
+
410
+ **Usage Plan:**
411
+
412
+ ====================================== ==============
413
+ Rate (requests per second) Burst
414
+ ====================================== ==============
415
+ 80 100
416
+ ====================================== ==============
417
+
418
+ For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
419
+
420
+ Examples:
421
+ literal blocks::
422
+
423
+ await ShippingV2().get_carrier_account_form_inputs()
424
+
425
+ Args:
426
+ x-amzn-shipping-business-id: object | Amazon shipping business to assume for this request. The default is AmazonShipping_UK.
427
+
428
+ Returns:
429
+ ApiResponse
430
+ """
431
+ return await self._request(kwargs.pop("path"), params=kwargs)
432
+
433
+ @sp_endpoint("/shipping/v2/carrierAccounts", method="PUT")
434
+ async def get_carrier_accounts(self, **kwargs) -> ApiResponse:
435
+ """
436
+ get_carrier_accounts(self, **kwargs) -> ApiResponse
437
+
438
+ This API will return Get all carrier accounts for a merchant.
439
+
440
+ **Usage Plan:**
441
+
442
+ ====================================== ==============
443
+ Rate (requests per second) Burst
444
+ ====================================== ==============
445
+ 80 100
446
+ ====================================== ==============
447
+
448
+ For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
449
+
450
+ Examples:
451
+ literal blocks::
452
+
453
+ await ShippingV2().get_carrier_accounts()
454
+
455
+ Args:
456
+ body: GetCarrierAccountsRequest | required GetCarrierAccountsRequest body
457
+ x-amzn-shipping-business-id: object | Amazon shipping business to assume for this request. The default is AmazonShipping_UK.
458
+
459
+ Returns:
460
+ ApiResponse
461
+ """
462
+ return await self._request(kwargs.pop("path"), data=kwargs)
463
+
464
+ @sp_endpoint("/shipping/v2/carrierAccounts/{}", method="PUT")
465
+ async def link_carrier_account(self, carrierId, **kwargs) -> ApiResponse:
466
+ """
467
+ link_carrier_account(self, carrierId, **kwargs) -> ApiResponse
468
+
469
+ This API associates/links the specified carrier account with the merchant.
470
+
471
+ **Usage Plan:**
472
+
473
+ ====================================== ==============
474
+ Rate (requests per second) Burst
475
+ ====================================== ==============
476
+ 80 100
477
+ ====================================== ==============
478
+
479
+ For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
480
+
481
+ Examples:
482
+ literal blocks::
483
+
484
+ await ShippingV2().link_carrier_account("value")
485
+
486
+ Args:
487
+ carrierId: object | required An identifier for the carrier with which the seller's account is being linked.
488
+ body: LinkCarrierAccountRequest | required LinkCarrierAccountRequest body
489
+ x-amzn-shipping-business-id: object | Amazon shipping business to assume for this request. The default is AmazonShipping_UK.
490
+
491
+ Returns:
492
+ ApiResponse
493
+ """
494
+ return await self._request(fill_query_params(kwargs.pop("path"), carrierId), data=kwargs)
495
+
496
+ @sp_endpoint("/shipping/v2/carrierAccounts/{}", method="POST")
497
+ async def link_carrier_account_post(self, carrierId, **kwargs) -> ApiResponse:
498
+ """
499
+ link_carrier_account_post(self, carrierId, **kwargs) -> ApiResponse
500
+
501
+ This API associates/links the specified carrier account with the merchant.
502
+
503
+ **Usage Plan:**
504
+
505
+ ====================================== ==============
506
+ Rate (requests per second) Burst
507
+ ====================================== ==============
508
+ 5 10
509
+ ====================================== ==============
510
+
511
+ For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
512
+
513
+ Examples:
514
+ literal blocks::
515
+
516
+ await ShippingV2().link_carrier_account_post("value")
517
+
518
+ Args:
519
+ carrierId: object | required An identifier for the carrier with which the seller's account is being linked.
520
+ body: LinkCarrierAccountRequest | required LinkCarrierAccountRequest body
521
+ x-amzn-shipping-business-id: object | Amazon shipping business to assume for this request. The default is AmazonShipping_UK.
522
+
523
+ Returns:
524
+ ApiResponse
525
+ """
526
+ return await self._request(fill_query_params(kwargs.pop("path"), carrierId), data=kwargs)
527
+
528
+ @sp_endpoint("/shipping/v2/carrierAccounts/{}/unlink", method="PUT")
529
+ async def unlink_carrier_account(self, carrierId, **kwargs) -> ApiResponse:
530
+ """
531
+ unlink_carrier_account(self, carrierId, **kwargs) -> ApiResponse
532
+
533
+ This API Unlink the specified carrier account with the merchant.
534
+
535
+ **Usage Plan:**
536
+
537
+ ====================================== ==============
538
+ Rate (requests per second) Burst
539
+ ====================================== ==============
540
+ 80 100
541
+ ====================================== ==============
542
+
543
+ For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
544
+
545
+ Examples:
546
+ literal blocks::
547
+
548
+ await ShippingV2().unlink_carrier_account("value")
549
+
550
+ Args:
551
+ carrierId: object | required carrier Id to unlink with merchant.
552
+ body: UnlinkCarrierAccountRequest | required UnlinkCarrierAccountRequest body
553
+ x-amzn-shipping-business-id: object | Amazon shipping business to assume for this request. The default is AmazonShipping_UK.
554
+
555
+ Returns:
556
+ ApiResponse
557
+ """
558
+ return await self._request(fill_query_params(kwargs.pop("path"), carrierId), data=kwargs)
559
+
560
+ @sp_endpoint("/shipping/v2/collectionForms", method="POST")
561
+ async def generate_collection_form(self, **kwargs) -> ApiResponse:
562
+ """
563
+ generate_collection_form(self, **kwargs) -> ApiResponse
564
+
565
+ This API Call to generate the collection form.
566
+
567
+ **Usage Plan:**
568
+
569
+ ====================================== ==============
570
+ Rate (requests per second) Burst
571
+ ====================================== ==============
572
+ 80 100
573
+ ====================================== ==============
574
+
575
+ For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
576
+
577
+ Examples:
578
+ literal blocks::
579
+
580
+ await ShippingV2().generate_collection_form()
581
+
582
+ Args:
583
+ body: GenerateCollectionFormRequest | required GenerateCollectionFormRequest body
584
+ x-amzn-IdempotencyKey: object | A unique value which the server uses to recognize subsequent retries of the same request.
585
+ x-amzn-shipping-business-id: object | Amazon shipping business to assume for this request. The default is AmazonShipping_UK.
586
+
587
+ Returns:
588
+ ApiResponse
589
+ """
590
+ return await self._request(kwargs.pop("path"), data=kwargs)
591
+
592
+ @sp_endpoint("/shipping/v2/collectionForms/history", method="PUT")
593
+ async def get_collection_form_history(self, **kwargs) -> ApiResponse:
594
+ """
595
+ get_collection_form_history(self, **kwargs) -> ApiResponse
596
+
597
+ This API Call to get the history of the previously generated collection forms.
598
+
599
+ **Usage Plan:**
600
+
601
+ ====================================== ==============
602
+ Rate (requests per second) Burst
603
+ ====================================== ==============
604
+ 80 100
605
+ ====================================== ==============
606
+
607
+ For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
608
+
609
+ Examples:
610
+ literal blocks::
611
+
612
+ await ShippingV2().get_collection_form_history()
613
+
614
+ Args:
615
+ body: GetCollectionFormHistoryRequest | required GetCollectionFormHistoryRequest body
616
+ x-amzn-shipping-business-id: object | Amazon shipping business to assume for this request. The default is AmazonShipping_UK.
617
+
618
+ Returns:
619
+ ApiResponse
620
+ """
621
+ return await self._request(kwargs.pop("path"), data=kwargs)
622
+
623
+ @sp_endpoint("/shipping/v2/unmanifestedShipments", method="PUT")
624
+ async def get_unmanifested_shipments(self, **kwargs) -> ApiResponse:
625
+ """
626
+ get_unmanifested_shipments(self, **kwargs) -> ApiResponse
627
+
628
+ This API Get all unmanifested carriers with shipment locations. Any locations which has unmanifested shipments
629
+ with an eligible carrier for manifesting shall be returned.
630
+
631
+ **Usage Plan:**
632
+
633
+ ====================================== ==============
634
+ Rate (requests per second) Burst
635
+ ====================================== ==============
636
+ 80 100
637
+ ====================================== ==============
638
+
639
+ For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
640
+
641
+ Examples:
642
+ literal blocks::
643
+
644
+ await ShippingV2().get_unmanifested_shipments()
645
+
646
+ Args:
647
+ body: GetUnmanifestedShipmentsRequest | required GetUmanifestedShipmentsRequest body
648
+ x-amzn-shipping-business-id: object | Amazon shipping business to assume for this request. The default is AmazonShipping_UK.
649
+
650
+ Returns:
651
+ ApiResponse
652
+ """
653
+ return await self._request(kwargs.pop("path"), data=kwargs)
654
+
655
+ @sp_endpoint("/shipping/v2/collectionForms/{}", method="GET")
656
+ async def get_collection_form(self, collectionFormId, **kwargs) -> ApiResponse:
657
+ """
658
+ get_collection_form(self, collectionFormId, **kwargs) -> ApiResponse
659
+
660
+ This API reprint a collection form.
661
+
662
+ **Usage Plan:**
663
+
664
+ ====================================== ==============
665
+ Rate (requests per second) Burst
666
+ ====================================== ==============
667
+ 80 100
668
+ ====================================== ==============
669
+
670
+ For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
671
+
672
+ Examples:
673
+ literal blocks::
674
+
675
+ await ShippingV2().get_collection_form("value")
676
+
677
+ Args:
678
+ collectionFormId: object | required collection form Id to reprint a collection.
679
+ x-amzn-shipping-business-id: object | Amazon shipping business to assume for this request. The default is AmazonShipping_UK.
680
+
681
+ Returns:
682
+ ApiResponse
683
+ """
684
+ return await self._request(fill_query_params(kwargs.pop("path"), collectionFormId), params=kwargs)
685
+
686
+
687
+
688
+ @sp_endpoint("/shipping/v2/claims", method="POST")
689
+ async def create_claim(self, **kwargs) -> ApiResponse:
690
+ """
691
+ create_claim(self, **kwargs) -> ApiResponse
692
+
693
+ This API will be used to create claim for single eligible shipment.
694
+
695
+ **Usage Plan:**
696
+
697
+ ====================================== ==============
698
+ Rate (requests per second) Burst
699
+ ====================================== ==============
700
+ 80 100
701
+ ====================================== ==============
702
+
703
+ For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
704
+
705
+ Examples:
706
+ literal blocks::
707
+
708
+ await ShippingV2().create_claim()
709
+
710
+ Args:
711
+ body: CreateClaimRequest | required Request body for the createClaim operation
712
+ x-amzn-shipping-business-id: object | Amazon shipping business to assume for this request. The default is AmazonShipping_UK.
713
+
714
+ Returns:
715
+ ApiResponse
716
+ """
717
+ return await self._request(kwargs.pop("path"), data=kwargs)