python-amazon-sp-api 1.9.18__py3-none-any.whl → 2.0.7__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.
- {python_amazon_sp_api-1.9.18.data → python_amazon_sp_api-2.0.7.data}/scripts/make_endpoint +2 -2
- {python_amazon_sp_api-1.9.18.dist-info → python_amazon_sp_api-2.0.7.dist-info}/METADATA +46 -23
- python_amazon_sp_api-2.0.7.dist-info/RECORD +251 -0
- {python_amazon_sp_api-1.9.18.dist-info → python_amazon_sp_api-2.0.7.dist-info}/WHEEL +1 -1
- {python_amazon_sp_api-1.9.18.dist-info → python_amazon_sp_api-2.0.7.dist-info}/top_level.txt +0 -1
- sp_api/__version__.py +1 -1
- sp_api/api/__init__.py +18 -1
- sp_api/api/application_integrations/application_integrations.py +118 -0
- sp_api/api/application_management/application_management.py +2 -1
- sp_api/api/catalog/catalog.py +3 -4
- sp_api/api/catalog_items/catalog_items.py +3 -6
- sp_api/api/customer_feedback/customer_feedback.py +110 -0
- sp_api/api/data_kiosk/data_kiosk.py +5 -6
- sp_api/api/easy_ship/easy_ship.py +190 -0
- sp_api/api/external_fulfillment/external_fulfillment.py +706 -0
- sp_api/api/feeds/feeds.py +11 -8
- sp_api/api/finances/finances.py +30 -4
- sp_api/api/fulfillment_inbound/fulfillment_inbound.py +35 -2
- sp_api/api/inventories/inventories.py +2 -7
- sp_api/api/listings_items/listings_items.py +3 -24
- sp_api/api/messaging/messaging.py +42 -0
- sp_api/api/orders/orders.py +7 -0
- sp_api/api/product_fees/product_fees.py +31 -74
- sp_api/api/products/products.py +80 -2
- sp_api/api/products/products_definitions.py +11 -85
- sp_api/api/reports/reports.py +65 -97
- sp_api/api/sales/sales.py +2 -2
- sp_api/asyncio/api/__init__.py +164 -0
- sp_api/asyncio/api/amazon_warehousing_and_distribu/__init__.py +9 -0
- sp_api/asyncio/api/amazon_warehousing_and_distribu/amazon_warehousing_and_distribu.py +130 -0
- sp_api/asyncio/api/aplus_content/__init__.py +5 -0
- sp_api/asyncio/api/aplus_content/aplus_content.py +330 -0
- sp_api/asyncio/api/application_integrations/__init__.py +5 -0
- sp_api/asyncio/api/application_integrations/application_integrations.py +119 -0
- sp_api/asyncio/api/application_management/__init__.py +5 -0
- sp_api/asyncio/api/application_management/application_management.py +36 -0
- sp_api/asyncio/api/authorization/__init__.py +5 -0
- sp_api/asyncio/api/authorization/authorization.py +54 -0
- sp_api/asyncio/api/catalog/__init__.py +5 -0
- sp_api/asyncio/api/catalog/catalog.py +111 -0
- sp_api/asyncio/api/catalog_items/__init__.py +6 -0
- sp_api/asyncio/api/catalog_items/catalog_items.py +93 -0
- sp_api/asyncio/api/clients/__init__.py +1 -0
- sp_api/asyncio/api/customer_feedback/__init__.py +5 -0
- sp_api/asyncio/api/customer_feedback/customer_feedback.py +111 -0
- sp_api/asyncio/api/data_kiosk/__init__.py +5 -0
- sp_api/asyncio/api/data_kiosk/data_kiosk.py +236 -0
- sp_api/asyncio/api/easy_ship/__init__.py +5 -0
- sp_api/asyncio/api/easy_ship/easy_ship.py +191 -0
- sp_api/asyncio/api/external_fulfillment/__init__.py +5 -0
- sp_api/asyncio/api/external_fulfillment/external_fulfillment.py +706 -0
- sp_api/asyncio/api/fba_inbound_eligibility/__init__.py +5 -0
- sp_api/asyncio/api/fba_inbound_eligibility/fba_inbound_eligibility.py +96 -0
- sp_api/asyncio/api/fba_small_and_light/__init__.py +5 -0
- sp_api/asyncio/api/fba_small_and_light/fba_small_and_light.py +213 -0
- sp_api/asyncio/api/feeds/feeds.py +260 -0
- sp_api/asyncio/api/finances/finances.py +100 -0
- sp_api/asyncio/api/fulfillment_inbound/fulfillment_inbound.py +1798 -0
- sp_api/asyncio/api/fulfillment_outbound/fulfillment_outbound.py +736 -0
- sp_api/asyncio/api/inventories/inventories.py +74 -0
- sp_api/asyncio/api/listings_items/__init__.py +0 -0
- sp_api/asyncio/api/listings_items/listings_items.py +170 -0
- sp_api/asyncio/api/listings_restrictions/__init__.py +0 -0
- sp_api/asyncio/api/listings_restrictions/listings_restrictions.py +36 -0
- sp_api/asyncio/api/merchant_fulfillment/__init__.py +0 -0
- sp_api/asyncio/api/merchant_fulfillment/merchant_fulfillment.py +384 -0
- sp_api/asyncio/api/messaging/__init__.py +0 -0
- sp_api/asyncio/api/messaging/messaging.py +511 -0
- sp_api/asyncio/api/models/__init__.py +4 -0
- sp_api/asyncio/api/notifications/__init__.py +0 -0
- sp_api/asyncio/api/notifications/notifications.py +295 -0
- sp_api/asyncio/api/orders/__init__.py +0 -0
- sp_api/asyncio/api/orders/orders.py +362 -0
- sp_api/asyncio/api/overrides/__init__.py +1 -0
- sp_api/asyncio/api/product_fees/__init__.py +0 -0
- sp_api/asyncio/api/product_fees/product_fees.py +194 -0
- sp_api/asyncio/api/product_type_definitions/__init__.py +0 -0
- sp_api/asyncio/api/product_type_definitions/product_type_definitions.py +75 -0
- sp_api/asyncio/api/products/__init__.py +0 -0
- sp_api/asyncio/api/products/products.py +405 -0
- sp_api/asyncio/api/products/products_definitions.py +11 -0
- sp_api/asyncio/api/replenishment/__init__.py +0 -0
- sp_api/asyncio/api/replenishment/replenishment.py +121 -0
- sp_api/asyncio/api/reports/__init__.py +0 -0
- sp_api/asyncio/api/reports/reports.py +439 -0
- sp_api/asyncio/api/sales/__init__.py +0 -0
- sp_api/asyncio/api/sales/sales.py +93 -0
- sp_api/asyncio/api/sellers/__init__.py +0 -0
- sp_api/asyncio/api/sellers/sellers.py +70 -0
- sp_api/asyncio/api/services/__init__.py +0 -0
- sp_api/asyncio/api/services/services.py +218 -0
- sp_api/asyncio/api/shipping/__init__.py +0 -0
- sp_api/asyncio/api/shipping/shipping.py +459 -0
- sp_api/asyncio/api/shipping/shippingV2.py +651 -0
- sp_api/asyncio/api/solicitations/__init__.py +0 -0
- sp_api/asyncio/api/solicitations/solicitations.py +78 -0
- sp_api/asyncio/api/supply_sources/__init__.py +0 -0
- sp_api/asyncio/api/supply_sources/supply_sources.py +138 -0
- sp_api/asyncio/api/tokens/__init__.py +0 -0
- sp_api/asyncio/api/tokens/tokens.py +65 -0
- sp_api/asyncio/api/upload/__init__.py +0 -0
- sp_api/asyncio/api/upload/upload.py +18 -0
- sp_api/asyncio/api/vendor_direct_fulfillment_inventory/__init__.py +0 -0
- sp_api/asyncio/api/vendor_direct_fulfillment_inventory/vendor_direct_fulfillment_inventory.py +64 -0
- sp_api/asyncio/api/vendor_direct_fulfillment_orders/__init__.py +0 -0
- sp_api/asyncio/api/vendor_direct_fulfillment_orders/vendor_direct_fulfillment_orders.py +196 -0
- sp_api/asyncio/api/vendor_direct_fulfillment_payments/__init__.py +0 -0
- sp_api/asyncio/api/vendor_direct_fulfillment_payments/vendor_direct_fulfillment_payments.py +254 -0
- sp_api/asyncio/api/vendor_direct_fulfillment_shipping/__init__.py +0 -0
- sp_api/asyncio/api/vendor_direct_fulfillment_shipping/vendor_direct_fulfillment_shipping.py +627 -0
- sp_api/asyncio/api/vendor_direct_fulfillment_transactions/__init__.py +0 -0
- sp_api/asyncio/api/vendor_direct_fulfillment_transactions/vendor_direct_fulfillment_transactions.py +43 -0
- sp_api/asyncio/api/vendor_invoices/__init__.py +0 -0
- sp_api/asyncio/api/vendor_invoices/vendor_invoices.py +295 -0
- sp_api/asyncio/api/vendor_orders/__init__.py +0 -0
- sp_api/asyncio/api/vendor_orders/vendor_orders.py +210 -0
- sp_api/asyncio/api/vendor_shipments/__init__.py +0 -0
- sp_api/asyncio/api/vendor_shipments/vendor_shipments.py +118 -0
- sp_api/asyncio/api/vendor_transaction_status/__init__.py +0 -0
- sp_api/asyncio/api/vendor_transaction_status/vendor_transaction_status.py +41 -0
- sp_api/asyncio/auth/__init__.py +12 -0
- sp_api/asyncio/auth/access_token_client.py +145 -0
- sp_api/asyncio/auth/exceptions.py +5 -0
- sp_api/asyncio/base/__init__.py +53 -0
- sp_api/asyncio/base/_transport_httpx.py +50 -0
- sp_api/asyncio/base/base_client.py +8 -0
- sp_api/asyncio/base/client.py +169 -0
- sp_api/asyncio/util/__init__.py +29 -0
- sp_api/asyncio/util/key_maker.py +5 -0
- sp_api/asyncio/util/load_all_pages.py +55 -0
- sp_api/asyncio/util/load_date_bound.py +53 -0
- sp_api/asyncio/util/retry.py +88 -0
- sp_api/auth/_core.py +39 -0
- sp_api/auth/access_token_client.py +18 -29
- sp_api/base/ApiResponse.py +3 -2
- sp_api/base/_core.py +110 -0
- sp_api/base/_transport_httpx.py +39 -0
- sp_api/base/client.py +40 -63
- sp_api/base/helpers.py +1 -1
- sp_api/base/reportTypes.py +3 -2
- sp_api/util/__init__.py +36 -0
- sp_api/util/load_all_pages.py +2 -1
- sp_api/util/params.py +57 -0
- sp_api/util/product_fees.py +40 -0
- sp_api/util/products_definitions.py +169 -0
- sp_api/util/report_document.py +154 -0
- python_amazon_sp_api-1.9.18.dist-info/RECORD +0 -144
- tests/api/finances/test_finances.py +0 -19
- tests/api/notifications/test_notifications.py +0 -26
- tests/api/orders/test_orders.py +0 -122
- tests/api/product_fees/product_fees.py +0 -49
- tests/api/reports/test_reports.py +0 -127
- tests/client/test_auth.py +0 -59
- tests/client/test_base.py +0 -163
- tests/client/test_credential_provider.py +0 -45
- tests/client/test_helpers.py +0 -142
- {python_amazon_sp_api-1.9.18.dist-info → python_amazon_sp_api-2.0.7.dist-info/licenses}/LICENSE +0 -0
- {tests → sp_api/api/application_integrations}/__init__.py +0 -0
- {tests/api → sp_api/api/customer_feedback}/__init__.py +0 -0
- {tests/api/finances → sp_api/api/easy_ship}/__init__.py +0 -0
- {tests/api/notifications → sp_api/api/external_fulfillment}/__init__.py +0 -0
- {tests/api/orders → sp_api/asyncio}/__init__.py +0 -0
- {tests/api/product_fees → sp_api/asyncio/api/feeds}/__init__.py +0 -0
- {tests/api/reports → sp_api/asyncio/api/finances}/__init__.py +0 -0
- {tests/api/sellers → sp_api/asyncio/api/fulfillment_inbound}/__init__.py +0 -0
- {tests/client → sp_api/asyncio/api/fulfillment_outbound}/__init__.py +0 -0
- /tests/api/sellers/test_sellers.py → /sp_api/asyncio/api/inventories/__init__.py +0 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import urllib.parse
|
|
2
|
+
|
|
3
|
+
from sp_api.base import Client, sp_endpoint, fill_query_params, ApiResponse
|
|
4
|
+
from sp_api.asyncio.base import AsyncBaseClient
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class Solicitations(AsyncBaseClient):
|
|
8
|
+
"""
|
|
9
|
+
Solicitations SP-API Client
|
|
10
|
+
:link:
|
|
11
|
+
|
|
12
|
+
With the Solicitations API you can build applications that send non-critical solicitations to buyers. You can get a list of solicitation types that are available for an order that you specify, then call an operation that sends a solicitation to the buyer for that order. Buyers cannot respond to solicitations sent by this API, and these solicitations do not appear in the Messaging section of Seller Central or in the recipient's Message Center. The Solicitations API returns responses that are formed according to the <a href=https://tools.ietf.org/html/draft-kelly-json-hal-08>JSON Hypertext Application Language</a> (HAL) standard.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
@sp_endpoint("/solicitations/v1/orders/{}", method="GET")
|
|
16
|
+
async def get_solicitation_actions_for_order(
|
|
17
|
+
self, amazonOrderId, **kwargs
|
|
18
|
+
) -> ApiResponse:
|
|
19
|
+
"""
|
|
20
|
+
get_solicitation_actions_for_order(self, amazonOrderId, **kwargs) -> ApiResponse
|
|
21
|
+
|
|
22
|
+
Returns a list of solicitation types that are available for an order that you specify. A solicitation type is represented by an actions object, which contains a path and query parameter(s). You can use the path and parameter(s) to call an operation that sends a solicitation. Currently only the productReviewAndSellerFeedbackSolicitation solicitation type is available.
|
|
23
|
+
|
|
24
|
+
**Usage Plan:**
|
|
25
|
+
|
|
26
|
+
====================================== ==============
|
|
27
|
+
Rate (requests per second) Burst
|
|
28
|
+
====================================== ==============
|
|
29
|
+
1 5
|
|
30
|
+
====================================== ==============
|
|
31
|
+
|
|
32
|
+
For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
|
|
33
|
+
|
|
34
|
+
Args:
|
|
35
|
+
amazonOrderId:string | * REQUIRED An Amazon order identifier. This specifies the order for which you want a list of available solicitation types.
|
|
36
|
+
key marketplaceIds:array | * REQUIRED A marketplace identifier. This specifies the marketplace in which the order was placed. Only one marketplace can be specified.
|
|
37
|
+
|
|
38
|
+
Returns:
|
|
39
|
+
ApiResponse:
|
|
40
|
+
"""
|
|
41
|
+
|
|
42
|
+
return await self._request(
|
|
43
|
+
fill_query_params(kwargs.pop("path"), amazonOrderId), params=kwargs
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
@sp_endpoint(
|
|
47
|
+
"/solicitations/v1/orders/{}/solicitations/productReviewAndSellerFeedback",
|
|
48
|
+
method="POST",
|
|
49
|
+
)
|
|
50
|
+
async def create_product_review_and_seller_feedback_solicitation(
|
|
51
|
+
self, amazonOrderId, **kwargs
|
|
52
|
+
) -> ApiResponse:
|
|
53
|
+
"""
|
|
54
|
+
create_product_review_and_seller_feedback_solicitation(self, amazonOrderId, **kwargs) -> ApiResponse
|
|
55
|
+
|
|
56
|
+
Sends a solicitation to a buyer asking for seller feedback and a product review for the specified order. Send only one productReviewAndSellerFeedback or free form proactive message per order.
|
|
57
|
+
|
|
58
|
+
**Usage Plan:**
|
|
59
|
+
|
|
60
|
+
====================================== ==============
|
|
61
|
+
Rate (requests per second) Burst
|
|
62
|
+
====================================== ==============
|
|
63
|
+
1 5
|
|
64
|
+
====================================== ==============
|
|
65
|
+
|
|
66
|
+
For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
|
|
67
|
+
|
|
68
|
+
Args:
|
|
69
|
+
amazonOrderId:string | * REQUIRED An Amazon order identifier. This specifies the order for which a solicitation is sent.
|
|
70
|
+
key marketplaceIds:array | * REQUIRED A marketplace identifier. This specifies the marketplace in which the order was placed. Only one marketplace can be specified.
|
|
71
|
+
|
|
72
|
+
Returns:
|
|
73
|
+
ApiResponse:
|
|
74
|
+
"""
|
|
75
|
+
|
|
76
|
+
return await self._request(
|
|
77
|
+
fill_query_params(kwargs.pop("path"), amazonOrderId), params=kwargs
|
|
78
|
+
)
|
|
File without changes
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
from sp_api.base import Client, sp_endpoint, fill_query_params, ApiResponse
|
|
2
|
+
from sp_api.asyncio.base import AsyncBaseClient
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class SupplySources(AsyncBaseClient):
|
|
6
|
+
"""
|
|
7
|
+
SupplySources SP-API Client
|
|
8
|
+
:link:
|
|
9
|
+
|
|
10
|
+
Manage configurations and capabilities of seller supply sources.
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
@sp_endpoint("/supplySources/2020-07-01/supplySources", method="GET")
|
|
14
|
+
async def get_supply_sources(self, **kwargs) -> ApiResponse:
|
|
15
|
+
"""
|
|
16
|
+
get_supply_sources(self, **kwargs) -> ApiResponse
|
|
17
|
+
|
|
18
|
+
The path to retrieve paginated supply sources.
|
|
19
|
+
|
|
20
|
+
Args:
|
|
21
|
+
|
|
22
|
+
key nextPageToken:string | The pagination token to retrieve a specific page of results.
|
|
23
|
+
|
|
24
|
+
key pageSize:number | The number of supply sources to return per paginated request.
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
Returns:
|
|
28
|
+
ApiResponse:
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
return await self._request(kwargs.pop("path"), params=kwargs)
|
|
32
|
+
|
|
33
|
+
@sp_endpoint("/supplySources/2020-07-01/supplySources", method="POST")
|
|
34
|
+
async def create_supply_source(self, **kwargs) -> ApiResponse:
|
|
35
|
+
"""
|
|
36
|
+
create_supply_source(self, **kwargs) -> ApiResponse
|
|
37
|
+
|
|
38
|
+
Create a new supply source.
|
|
39
|
+
|
|
40
|
+
Args:
|
|
41
|
+
|
|
42
|
+
payload: | * REQUIRED {'description': 'A request to create a supply source.',
|
|
43
|
+
'properties': {'address': {'$ref': '#/definitions/Address'}, 'alias': {'$ref': '#/definitions/SupplySourceAlias'}, 'supplySourceCode': {'$ref': '#/definitions/SupplySourceCode'}},
|
|
44
|
+
'required': ['address', 'supplySourceCode', 'alias'],
|
|
45
|
+
'type': 'object'}
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
Returns:
|
|
49
|
+
ApiResponse:
|
|
50
|
+
"""
|
|
51
|
+
|
|
52
|
+
return await self._request(kwargs.pop("path"), data=kwargs)
|
|
53
|
+
|
|
54
|
+
@sp_endpoint("/supplySources/2020-07-01/supplySources/{}", method="GET")
|
|
55
|
+
async def get_supply_source(self, supplySourceId, **kwargs) -> ApiResponse:
|
|
56
|
+
"""
|
|
57
|
+
get_supply_source(self, supplySourceId, **kwargs) -> ApiResponse
|
|
58
|
+
|
|
59
|
+
Retrieve a supply source.
|
|
60
|
+
|
|
61
|
+
Args:
|
|
62
|
+
|
|
63
|
+
supplySourceId:string | * REQUIRED The unique identifier of a supply source.
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
Returns:
|
|
67
|
+
ApiResponse:
|
|
68
|
+
"""
|
|
69
|
+
|
|
70
|
+
return await self._request(
|
|
71
|
+
fill_query_params(kwargs.pop("path"), supplySourceId), params=kwargs
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
@sp_endpoint("/supplySources/2020-07-01/supplySources/{}", method="PUT")
|
|
75
|
+
async def update_supply_source(self, supplySourceId, **kwargs) -> ApiResponse:
|
|
76
|
+
"""
|
|
77
|
+
update_supply_source(self, supplySourceId, **kwargs) -> ApiResponse
|
|
78
|
+
|
|
79
|
+
Update the configuration and capabilities of a supply source.
|
|
80
|
+
|
|
81
|
+
Args:
|
|
82
|
+
|
|
83
|
+
supplySourceId:string | * REQUIRED The unique identitier of a supply source.
|
|
84
|
+
|
|
85
|
+
payload: | {'description': 'A request to update the configuration and capabilities of a supply source.',
|
|
86
|
+
'properties': {'alias': {'$ref': '#/definitions/SupplySourceAlias'}, 'capabilities': {'$ref': '#/definitions/SupplySourceCapabilities'}, 'configuration': {'$ref': '#/definitions/SupplySourceConfiguration'}},
|
|
87
|
+
'type': 'object'}
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
Returns:
|
|
91
|
+
ApiResponse:
|
|
92
|
+
"""
|
|
93
|
+
|
|
94
|
+
return await self._request(
|
|
95
|
+
fill_query_params(kwargs.pop("path"), supplySourceId), data=kwargs
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
@sp_endpoint("/supplySources/2020-07-01/supplySources/{}", method="DELETE")
|
|
99
|
+
async def archive_supply_source(self, supplySourceId, **kwargs) -> ApiResponse:
|
|
100
|
+
"""
|
|
101
|
+
archive_supply_source(self, supplySourceId, **kwargs) -> ApiResponse
|
|
102
|
+
|
|
103
|
+
Archive a supply source, making it inactive. Cannot be undone.
|
|
104
|
+
|
|
105
|
+
Args:
|
|
106
|
+
|
|
107
|
+
supplySourceId:string | * REQUIRED The unique identifier of a supply source.
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
Returns:
|
|
111
|
+
ApiResponse:
|
|
112
|
+
"""
|
|
113
|
+
|
|
114
|
+
return await self._request(
|
|
115
|
+
fill_query_params(kwargs.pop("path"), supplySourceId), data=kwargs
|
|
116
|
+
)
|
|
117
|
+
|
|
118
|
+
@sp_endpoint("/supplySources/2020-07-01/supplySources/{}/status", method="PUT")
|
|
119
|
+
async def update_supply_source_status(self, supplySourceId, **kwargs) -> ApiResponse:
|
|
120
|
+
"""
|
|
121
|
+
update_supply_source_status(self, supplySourceId, **kwargs) -> ApiResponse
|
|
122
|
+
|
|
123
|
+
Update the status of a supply source.
|
|
124
|
+
|
|
125
|
+
Args:
|
|
126
|
+
|
|
127
|
+
supplySourceId:string | * REQUIRED The unique identifier of a supply source.
|
|
128
|
+
|
|
129
|
+
payload: | {'description': 'A request to update the status of a supply source.', 'properties': {'status': {'$ref': '#/definitions/SupplySourceStatus'}}, 'type': 'object'}
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
Returns:
|
|
133
|
+
ApiResponse:
|
|
134
|
+
"""
|
|
135
|
+
|
|
136
|
+
return await self._request(
|
|
137
|
+
fill_query_params(kwargs.pop("path"), supplySourceId), data=kwargs
|
|
138
|
+
)
|
|
File without changes
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import urllib.parse
|
|
2
|
+
|
|
3
|
+
from sp_api.base import Client, sp_endpoint, fill_query_params, ApiResponse
|
|
4
|
+
from sp_api.asyncio.base import AsyncBaseClient
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class Tokens(AsyncBaseClient):
|
|
8
|
+
"""
|
|
9
|
+
Tokens SP-API Client
|
|
10
|
+
:link:
|
|
11
|
+
|
|
12
|
+
The Selling Partner API for Tokens provides a secure way to access a customers's PII (Personally Identifiable Information). You can call the Tokens API to get a Restricted Data Token (RDT) for one or more restricted resources that you specify. The RDT authorizes you to make subsequent requests to access these restricted resources.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
@sp_endpoint("/tokens/2021-03-01/restrictedDataToken", method="POST")
|
|
16
|
+
async def create_restricted_data_token(self, **kwargs) -> ApiResponse:
|
|
17
|
+
"""
|
|
18
|
+
create_restricted_data_token(self, **kwargs) -> ApiResponse
|
|
19
|
+
|
|
20
|
+
Returns a Restricted Data Token (RDT) for one or more restricted resources that you specify. A restricted resource is the HTTP method and path from a restricted operation that returns Personally Identifiable Information (PII). See the Tokens API Use Case Guide for a list of restricted operations. Use the RDT returned here as the access token in subsequent calls to the corresponding restricted operations.
|
|
21
|
+
|
|
22
|
+
The path of a restricted resource can be:
|
|
23
|
+
- A specific path containing a seller's order ID, for example ```/orders/v0/orders/902-3159896-1390916/address```. The returned RDT authorizes a subsequent call to the getOrderAddress operation of the Orders API for that specific order only. For example, ```GET /orders/v0/orders/902-3159896-1390916/address```.
|
|
24
|
+
- A generic path that does not contain a seller's order ID, for example```/orders/v0/orders/{orderId}/address```). The returned RDT authorizes subsequent calls to the getOrderAddress operation for *any* of a seller's order IDs. For example, ```GET /orders/v0/orders/902-3159896-1390916/address``` and ```GET /orders/v0/orders/483-3488972-0896720/address```
|
|
25
|
+
|
|
26
|
+
**Usage Plans:**
|
|
27
|
+
|
|
28
|
+
====================================== ==============
|
|
29
|
+
Rate (requests per second) Burst
|
|
30
|
+
====================================== ==============
|
|
31
|
+
1 10
|
|
32
|
+
====================================== ==============
|
|
33
|
+
|
|
34
|
+
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.
|
|
35
|
+
|
|
36
|
+
Examples:
|
|
37
|
+
literal blocks::
|
|
38
|
+
|
|
39
|
+
Tokens().create_restricted_data_token(restrictedResources=[
|
|
40
|
+
{
|
|
41
|
+
"method": "GET",
|
|
42
|
+
"path": "/orders/v0/orders",
|
|
43
|
+
"dataElements": ["buyerInfo", "shippingAddress"]
|
|
44
|
+
}
|
|
45
|
+
])
|
|
46
|
+
|
|
47
|
+
Args:
|
|
48
|
+
body: {
|
|
49
|
+
"targetApplication": "string",
|
|
50
|
+
"restrictedResources": [
|
|
51
|
+
{
|
|
52
|
+
"method": "GET",
|
|
53
|
+
"path": "string",
|
|
54
|
+
"dataElements": [
|
|
55
|
+
"string"
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
Returns:
|
|
62
|
+
ApiResponse:
|
|
63
|
+
"""
|
|
64
|
+
|
|
65
|
+
return await self._request(kwargs.pop("path"), data=kwargs)
|
|
File without changes
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
from sp_api.base import Client, sp_endpoint
|
|
2
|
+
from sp_api.asyncio.base import AsyncBaseClient
|
|
3
|
+
from sp_api.base.helpers import create_md5
|
|
4
|
+
import urllib.parse
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class Upload(AsyncBaseClient):
|
|
8
|
+
@sp_endpoint("/uploads/2020-11-01/uploadDestinations/{}", method="POST")
|
|
9
|
+
async def upload_document(self, resource, file, content_type="application/pdf", **kwargs):
|
|
10
|
+
md5 = urllib.parse.quote(create_md5(file))
|
|
11
|
+
kwargs.update(
|
|
12
|
+
{
|
|
13
|
+
"contentMD5": md5,
|
|
14
|
+
"contentType": kwargs.pop("contentType", content_type),
|
|
15
|
+
"marketplaceIds": self.marketplace_id,
|
|
16
|
+
}
|
|
17
|
+
)
|
|
18
|
+
return await self._request(kwargs.pop("path").format(resource), params=kwargs)
|
|
File without changes
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import urllib.parse
|
|
2
|
+
|
|
3
|
+
from sp_api.base import Client, sp_endpoint, fill_query_params, ApiResponse
|
|
4
|
+
from sp_api.asyncio.base import AsyncBaseClient
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class VendorDirectFulfillmentInventory(AsyncBaseClient):
|
|
8
|
+
"""
|
|
9
|
+
VendorDirectFulfillmentInventory SP-API Client
|
|
10
|
+
:link:
|
|
11
|
+
|
|
12
|
+
The Selling Partner API for Direct Fulfillment Inventory Updates provides programmatic access to a direct fulfillment vendor's inventory updates.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
@sp_endpoint(
|
|
16
|
+
"/vendor/directFulfillment/inventory/v1/warehouses/{}/items", method="POST"
|
|
17
|
+
)
|
|
18
|
+
async def submit_inventory_update(self, warehouseId, **kwargs) -> ApiResponse:
|
|
19
|
+
"""
|
|
20
|
+
submit_inventory_update(self, warehouseId, **kwargs) -> ApiResponse
|
|
21
|
+
|
|
22
|
+
Submits inventory updates for the specified warehouse for either a partial or full feed of inventory items.
|
|
23
|
+
|
|
24
|
+
**Usage Plans:**
|
|
25
|
+
|
|
26
|
+
====================================== ==============
|
|
27
|
+
Rate (requests per second) Burst
|
|
28
|
+
====================================== ==============
|
|
29
|
+
10 10
|
|
30
|
+
====================================== ==============
|
|
31
|
+
|
|
32
|
+
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.
|
|
33
|
+
|
|
34
|
+
Args:
|
|
35
|
+
warehouseId:string | * REQUIRED Identifier for the warehouse for which to update inventory.
|
|
36
|
+
body: {
|
|
37
|
+
"inventory": {
|
|
38
|
+
"sellingParty": {
|
|
39
|
+
"partyId": "string"
|
|
40
|
+
},
|
|
41
|
+
"isFullUpdate": true,
|
|
42
|
+
"items": [
|
|
43
|
+
{
|
|
44
|
+
"buyerProductIdentifier": "string",
|
|
45
|
+
"vendorProductIdentifier": "string",
|
|
46
|
+
"availableQuantity": {
|
|
47
|
+
"amount": 0,
|
|
48
|
+
"unitOfMeasure": "string"
|
|
49
|
+
},
|
|
50
|
+
"isObsolete": true
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
Returns:
|
|
57
|
+
ApiResponse:
|
|
58
|
+
"""
|
|
59
|
+
|
|
60
|
+
return await self._request(
|
|
61
|
+
fill_query_params(kwargs.pop("path"), warehouseId),
|
|
62
|
+
data=kwargs,
|
|
63
|
+
add_marketplace=False,
|
|
64
|
+
)
|
|
File without changes
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import urllib.parse
|
|
2
|
+
|
|
3
|
+
from sp_api.base import Client, sp_endpoint, fill_query_params, ApiResponse
|
|
4
|
+
from sp_api.asyncio.base import AsyncBaseClient
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class VendorDirectFulfillmentOrders(AsyncBaseClient):
|
|
8
|
+
"""
|
|
9
|
+
VendorDirectFulfillmentOrders SP-API Client
|
|
10
|
+
:link:
|
|
11
|
+
|
|
12
|
+
The Selling Partner API for Direct Fulfillment Orders provides programmatic access to a direct fulfillment vendor's order data.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
@sp_endpoint("/vendor/directFulfillment/orders/v1/purchaseOrders", method="GET")
|
|
16
|
+
async def get_orders(self, **kwargs) -> ApiResponse:
|
|
17
|
+
"""
|
|
18
|
+
get_orders(self, **kwargs) -> ApiResponse
|
|
19
|
+
|
|
20
|
+
Returns a list of purchase orders created during the time frame that you specify. You define the time frame using the createdAfter and createdBefore parameters. You must use both parameters. You can choose to get only the purchase order numbers by setting the includeDetails parameter to false. In that case, the operation returns a list of purchase order numbers. You can then call the getOrder operation to return the details of a specific order.
|
|
21
|
+
|
|
22
|
+
**Usage Plans:**
|
|
23
|
+
|
|
24
|
+
====================================== ==============
|
|
25
|
+
Rate (requests per second) Burst
|
|
26
|
+
====================================== ==============
|
|
27
|
+
10 10
|
|
28
|
+
====================================== ==============
|
|
29
|
+
|
|
30
|
+
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.
|
|
31
|
+
|
|
32
|
+
Args:
|
|
33
|
+
key shipFromPartyId:string | The vendor warehouse identifier for the fulfillment warehouse. If not specified, the result will contain orders for all warehouses.
|
|
34
|
+
key status:string | Returns only the purchase orders that match the specified status. If not specified, the result will contain orders that match any status.
|
|
35
|
+
key limit:integer | The limit to the number of purchase orders returned.
|
|
36
|
+
key createdAfter:string | * REQUIRED Purchase orders that became available after this date and time will be included in the result. Must be in ISO-8601 date/time format.
|
|
37
|
+
key createdBefore:string | * REQUIRED Purchase orders that became available before this date and time will be included in the result. Must be in ISO-8601 date/time format.
|
|
38
|
+
key sortOrder:string | Sort the list in ascending or descending order by order creation date.
|
|
39
|
+
key nextToken:string | Used for pagination when there are more orders than the specified result size limit. The token value is returned in the previous API call.
|
|
40
|
+
key includeDetails:string | When true, returns the complete purchase order details. Otherwise, only purchase order numbers are returned.
|
|
41
|
+
|
|
42
|
+
Returns:
|
|
43
|
+
ApiResponse:
|
|
44
|
+
"""
|
|
45
|
+
|
|
46
|
+
return await self._request(kwargs.pop("path"), params=kwargs)
|
|
47
|
+
|
|
48
|
+
@sp_endpoint("/vendor/directFulfillment/orders/v1/purchaseOrders/{}", method="GET")
|
|
49
|
+
async def get_order(self, purchaseOrderNumber, **kwargs) -> ApiResponse:
|
|
50
|
+
"""
|
|
51
|
+
get_order(self, purchaseOrderNumber, **kwargs) -> ApiResponse
|
|
52
|
+
|
|
53
|
+
Returns purchase order information for the purchaseOrderNumber that you specify.
|
|
54
|
+
|
|
55
|
+
**Usage Plans:**
|
|
56
|
+
|
|
57
|
+
====================================== ==============
|
|
58
|
+
Rate (requests per second) Burst
|
|
59
|
+
====================================== ==============
|
|
60
|
+
10 10
|
|
61
|
+
====================================== ==============
|
|
62
|
+
|
|
63
|
+
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.
|
|
64
|
+
|
|
65
|
+
Args:
|
|
66
|
+
purchaseOrderNumber:string | * REQUIRED The order identifier for the purchase order that you want. Formatting Notes: alpha-numeric code.
|
|
67
|
+
|
|
68
|
+
Returns:
|
|
69
|
+
ApiResponse:
|
|
70
|
+
"""
|
|
71
|
+
|
|
72
|
+
return await self._request(
|
|
73
|
+
fill_query_params(kwargs.pop("path"), purchaseOrderNumber), params=kwargs
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
@sp_endpoint("/vendor/directFulfillment/orders/v1/acknowledgements", method="POST")
|
|
77
|
+
async def submit_acknowledgement(self, **kwargs) -> ApiResponse:
|
|
78
|
+
"""
|
|
79
|
+
submit_acknowledgement(self, **kwargs) -> ApiResponse
|
|
80
|
+
|
|
81
|
+
Submits acknowledgements for one or more purchase orders.
|
|
82
|
+
|
|
83
|
+
**Usage Plans:**
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
====================================== ==============
|
|
87
|
+
Rate (requests per second) Burst
|
|
88
|
+
====================================== ==============
|
|
89
|
+
10 10
|
|
90
|
+
====================================== ==============
|
|
91
|
+
|
|
92
|
+
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.
|
|
93
|
+
|
|
94
|
+
Args:
|
|
95
|
+
body: {
|
|
96
|
+
"orderAcknowledgements": [
|
|
97
|
+
{
|
|
98
|
+
"purchaseOrderNumber": "string",
|
|
99
|
+
"vendorOrderNumber": "string",
|
|
100
|
+
"acknowledgementDate": "2019-08-24T14:15:22Z",
|
|
101
|
+
"acknowledgementStatus": {
|
|
102
|
+
"code": "string",
|
|
103
|
+
"description": "string"
|
|
104
|
+
},
|
|
105
|
+
"sellingParty": {
|
|
106
|
+
"partyId": "string",
|
|
107
|
+
"address": {
|
|
108
|
+
"name": "string",
|
|
109
|
+
"attention": "string",
|
|
110
|
+
"addressLine1": "string",
|
|
111
|
+
"addressLine2": "string",
|
|
112
|
+
"addressLine3": "string",
|
|
113
|
+
"city": "string",
|
|
114
|
+
"county": "string",
|
|
115
|
+
"district": "string",
|
|
116
|
+
"stateOrRegion": "string",
|
|
117
|
+
"postalCode": "string",
|
|
118
|
+
"countryCode": "string",
|
|
119
|
+
"phone": "string"
|
|
120
|
+
},
|
|
121
|
+
"taxInfo": {
|
|
122
|
+
"taxRegistrationType": "VAT",
|
|
123
|
+
"taxRegistrationNumber": "string",
|
|
124
|
+
"taxRegistrationAddress": {
|
|
125
|
+
"name": "string",
|
|
126
|
+
"attention": "string",
|
|
127
|
+
"addressLine1": "string",
|
|
128
|
+
"addressLine2": "string",
|
|
129
|
+
"addressLine3": "string",
|
|
130
|
+
"city": "string",
|
|
131
|
+
"county": "string",
|
|
132
|
+
"district": "string",
|
|
133
|
+
"stateOrRegion": "string",
|
|
134
|
+
"postalCode": "string",
|
|
135
|
+
"countryCode": "string",
|
|
136
|
+
"phone": "string"
|
|
137
|
+
},
|
|
138
|
+
"taxRegistrationMessages": "string"
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
"shipFromParty": {
|
|
142
|
+
"partyId": "string",
|
|
143
|
+
"address": {
|
|
144
|
+
"name": "string",
|
|
145
|
+
"attention": "string",
|
|
146
|
+
"addressLine1": "string",
|
|
147
|
+
"addressLine2": "string",
|
|
148
|
+
"addressLine3": "string",
|
|
149
|
+
"city": "string",
|
|
150
|
+
"county": "string",
|
|
151
|
+
"district": "string",
|
|
152
|
+
"stateOrRegion": "string",
|
|
153
|
+
"postalCode": "string",
|
|
154
|
+
"countryCode": "string",
|
|
155
|
+
"phone": "string"
|
|
156
|
+
},
|
|
157
|
+
"taxInfo": {
|
|
158
|
+
"taxRegistrationType": "VAT",
|
|
159
|
+
"taxRegistrationNumber": "string",
|
|
160
|
+
"taxRegistrationAddress": {
|
|
161
|
+
"name": "string",
|
|
162
|
+
"attention": "string",
|
|
163
|
+
"addressLine1": "string",
|
|
164
|
+
"addressLine2": "string",
|
|
165
|
+
"addressLine3": "string",
|
|
166
|
+
"city": "string",
|
|
167
|
+
"county": "string",
|
|
168
|
+
"district": "string",
|
|
169
|
+
"stateOrRegion": "string",
|
|
170
|
+
"postalCode": "string",
|
|
171
|
+
"countryCode": "string",
|
|
172
|
+
"phone": "string"
|
|
173
|
+
},
|
|
174
|
+
"taxRegistrationMessages": "string"
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
"itemAcknowledgements": [
|
|
178
|
+
{
|
|
179
|
+
"itemSequenceNumber": "string",
|
|
180
|
+
"buyerProductIdentifier": "string",
|
|
181
|
+
"vendorProductIdentifier": "string",
|
|
182
|
+
"acknowledgedQuantity": {
|
|
183
|
+
"amount": 0,
|
|
184
|
+
"unitOfMeasure": "Each"
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
]
|
|
188
|
+
}
|
|
189
|
+
]
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
Returns:
|
|
193
|
+
ApiResponse:
|
|
194
|
+
"""
|
|
195
|
+
|
|
196
|
+
return await self._request(kwargs.pop("path"), data=kwargs, add_marketplace=False)
|
|
File without changes
|