python-amazon-sp-api 1.9.39__py3-none-any.whl → 2.0.10__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {python_amazon_sp_api-1.9.39.dist-info → python_amazon_sp_api-2.0.10.dist-info}/METADATA +44 -8
- python_amazon_sp_api-2.0.10.dist-info/RECORD +253 -0
- {python_amazon_sp_api-1.9.39.dist-info → python_amazon_sp_api-2.0.10.dist-info}/WHEEL +1 -1
- {python_amazon_sp_api-1.9.39.dist-info → python_amazon_sp_api-2.0.10.dist-info}/top_level.txt +0 -1
- sp_api/__version__.py +1 -1
- sp_api/api/__init__.py +9 -3
- sp_api/api/application_integrations/application_integrations.py +2 -2
- 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 +5 -5
- sp_api/api/external_fulfillment/external_fulfillment.py +706 -0
- sp_api/api/feeds/feeds.py +11 -8
- 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 +59 -3
- sp_api/api/orders/orders_2026_01_01.py +54 -0
- sp_api/api/product_fees/product_fees.py +31 -74
- sp_api/api/products/products.py +3 -1
- sp_api/api/products/products_definitions.py +11 -169
- sp_api/api/reports/reports.py +61 -96
- sp_api/api/sales/sales.py +2 -2
- sp_api/asyncio/api/__init__.py +167 -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/listings_items.py +170 -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 +412 -0
- sp_api/asyncio/api/orders/orders_2026_01_01.py +40 -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 +2 -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/util/__init__.py +36 -0
- 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.39.dist-info/RECORD +0 -148
- 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.39.data → python_amazon_sp_api-2.0.10.data}/scripts/make_endpoint +0 -0
- {python_amazon_sp_api-1.9.39.dist-info → python_amazon_sp_api-2.0.10.dist-info}/licenses/LICENSE +0 -0
- {tests → sp_api/api/customer_feedback}/__init__.py +0 -0
- {tests/api → sp_api/api/external_fulfillment}/__init__.py +0 -0
- {tests/api/finances → sp_api/asyncio}/__init__.py +0 -0
- {tests/api/notifications → sp_api/asyncio/api/feeds}/__init__.py +0 -0
- {tests/api/orders → sp_api/asyncio/api/finances}/__init__.py +0 -0
- {tests/api/product_fees → sp_api/asyncio/api/fulfillment_inbound}/__init__.py +0 -0
- {tests/api/reports → sp_api/asyncio/api/fulfillment_outbound}/__init__.py +0 -0
- {tests/api/sellers → sp_api/asyncio/api/inventories}/__init__.py +0 -0
- {tests/client → sp_api/asyncio/api/listings_items}/__init__.py +0 -0
- /tests/api/sellers/test_sellers.py → /sp_api/asyncio/api/listings_restrictions/__init__.py +0 -0
|
@@ -0,0 +1,218 @@
|
|
|
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 Services(AsyncBaseClient):
|
|
8
|
+
"""
|
|
9
|
+
Services SP-API Client
|
|
10
|
+
:link:
|
|
11
|
+
|
|
12
|
+
With the Services API, you can build applications that help service providers get and modify their service orders.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
@sp_endpoint("/service/v1/serviceJobs/{}", method="GET")
|
|
16
|
+
async def get_service_job_by_service_job_id(self, serviceJobId, **kwargs) -> ApiResponse:
|
|
17
|
+
"""
|
|
18
|
+
get_service_job_by_service_job_id(self, serviceJobId, **kwargs) -> ApiResponse
|
|
19
|
+
|
|
20
|
+
Gets service job details for the service job indicated by the service job identifier you specify.
|
|
21
|
+
|
|
22
|
+
**Usage Plan:**
|
|
23
|
+
|
|
24
|
+
====================================== ==============
|
|
25
|
+
Rate (requests per second) Burst
|
|
26
|
+
====================================== ==============
|
|
27
|
+
20 40
|
|
28
|
+
====================================== ==============
|
|
29
|
+
|
|
30
|
+
For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
|
|
31
|
+
|
|
32
|
+
Args:
|
|
33
|
+
serviceJobId:string | * REQUIRED A service job identifier.
|
|
34
|
+
|
|
35
|
+
Returns:
|
|
36
|
+
ApiResponse:
|
|
37
|
+
"""
|
|
38
|
+
|
|
39
|
+
return await self._request(
|
|
40
|
+
fill_query_params(kwargs.pop("path"), serviceJobId), params=kwargs
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
@sp_endpoint("/service/v1/serviceJobs/{}/cancellations", method="PUT")
|
|
44
|
+
async def cancel_service_job_by_service_job_id(
|
|
45
|
+
self, serviceJobId, **kwargs
|
|
46
|
+
) -> ApiResponse:
|
|
47
|
+
"""
|
|
48
|
+
cancel_service_job_by_service_job_id(self, serviceJobId, **kwargs) -> ApiResponse
|
|
49
|
+
|
|
50
|
+
Cancels the service job indicated by the service job identifier you specify.
|
|
51
|
+
|
|
52
|
+
**Usage Plan:**
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
====================================== ==============
|
|
56
|
+
Rate (requests per second) Burst
|
|
57
|
+
====================================== ==============
|
|
58
|
+
5 20
|
|
59
|
+
====================================== ==============
|
|
60
|
+
|
|
61
|
+
For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
|
|
62
|
+
|
|
63
|
+
Args:
|
|
64
|
+
serviceJobId:string | * REQUIRED An Amazon defined service job identifier.
|
|
65
|
+
key cancellationReasonCode:string | * REQUIRED A cancel reason code that specifies the reason for cancelling a service job.
|
|
66
|
+
|
|
67
|
+
Returns:
|
|
68
|
+
ApiResponse:
|
|
69
|
+
"""
|
|
70
|
+
|
|
71
|
+
return await self._request(
|
|
72
|
+
fill_query_params(kwargs.pop("path"), serviceJobId), data=kwargs
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
@sp_endpoint("/service/v1/serviceJobs/{}/completions", method="PUT")
|
|
76
|
+
async def complete_service_job_by_service_job_id(
|
|
77
|
+
self, serviceJobId, **kwargs
|
|
78
|
+
) -> ApiResponse:
|
|
79
|
+
"""
|
|
80
|
+
complete_service_job_by_service_job_id(self, serviceJobId, **kwargs) -> ApiResponse
|
|
81
|
+
|
|
82
|
+
Completes the service job indicated by the service job identifier you specify.
|
|
83
|
+
|
|
84
|
+
**Usage Plan:**
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
====================================== ==============
|
|
88
|
+
Rate (requests per second) Burst
|
|
89
|
+
====================================== ==============
|
|
90
|
+
5 20
|
|
91
|
+
====================================== ==============
|
|
92
|
+
|
|
93
|
+
For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
|
|
94
|
+
|
|
95
|
+
Args:
|
|
96
|
+
serviceJobId:string | * REQUIRED An Amazon defined service job identifier.
|
|
97
|
+
|
|
98
|
+
Returns:
|
|
99
|
+
ApiResponse:
|
|
100
|
+
"""
|
|
101
|
+
|
|
102
|
+
return await self._request(
|
|
103
|
+
fill_query_params(kwargs.pop("path"), serviceJobId), data=kwargs
|
|
104
|
+
)
|
|
105
|
+
|
|
106
|
+
@sp_endpoint("/service/v1/serviceJobs", method="GET")
|
|
107
|
+
async def get_service_jobs(self, **kwargs) -> ApiResponse:
|
|
108
|
+
"""
|
|
109
|
+
get_service_jobs(self, **kwargs) -> ApiResponse
|
|
110
|
+
|
|
111
|
+
Gets service job details for the specified filter query.
|
|
112
|
+
|
|
113
|
+
**Usage Plan:**
|
|
114
|
+
|
|
115
|
+
====================================== ==============
|
|
116
|
+
Rate (requests per second) Burst
|
|
117
|
+
====================================== ==============
|
|
118
|
+
10 40
|
|
119
|
+
====================================== ==============
|
|
120
|
+
|
|
121
|
+
For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
|
|
122
|
+
|
|
123
|
+
Args:
|
|
124
|
+
key serviceOrderIds: array | List of service order ids for the query you want to perform.Max values supported 20.
|
|
125
|
+
key serviceJobStatus: array | A list of one or more job status by which to filter the list of jobs.
|
|
126
|
+
key pageToken: string | String returned in the response of your previous request.
|
|
127
|
+
key pageSize: integer | A non-negative integer that indicates the maximum number of jobs to return in the list, Value must be 1 - 20. Default 20.
|
|
128
|
+
key sortField: string | Sort fields on which you want to sort the output.
|
|
129
|
+
key sortOrder: string | Sort order for the query you want to perform.
|
|
130
|
+
key createdAfter: string | A date used for selecting jobs created after (or at) a specified time must be in ISO 8601 format. Required if LastUpdatedAfter is not specified.Specifying both CreatedAfter and LastUpdatedAfter returns an error.
|
|
131
|
+
key createdBefore: string | A date used for selecting jobs created before (or at) a specified time must be in ISO 8601 format.
|
|
132
|
+
key lastUpdatedAfter: string | A date used for selecting jobs updated after (or at) a specified time must be in ISO 8601 format. Required if createdAfter is not specified.Specifying both CreatedAfter and LastUpdatedAfter returns an error.
|
|
133
|
+
key lastUpdatedBefore: string | A date used for selecting jobs updated before (or at) a specified time must be in ISO 8601 format.
|
|
134
|
+
key scheduleStartDate: string | A date used for filtering jobs schedule after (or at) a specified time must be in ISO 8601 format. schedule end date should not be earlier than schedule start date.
|
|
135
|
+
key scheduleEndDate: string | A date used for filtering jobs schedule before (or at) a specified time must be in ISO 8601 format. schedule end date should not be earlier than schedule start date.
|
|
136
|
+
key marketplaceIds: array | * REQUIRED Used to select jobs that were placed in the specified marketplaces.
|
|
137
|
+
|
|
138
|
+
Returns:
|
|
139
|
+
ApiResponse:
|
|
140
|
+
"""
|
|
141
|
+
|
|
142
|
+
return await self._request(kwargs.pop("path"), params=kwargs)
|
|
143
|
+
|
|
144
|
+
@sp_endpoint("/service/v1/serviceJobs/{}/appointments", method="POST")
|
|
145
|
+
async def add_appointment_for_service_job_by_service_job_id(
|
|
146
|
+
self, serviceJobId, **kwargs
|
|
147
|
+
) -> ApiResponse:
|
|
148
|
+
"""
|
|
149
|
+
add_appointment_for_service_job_by_service_job_id(self, serviceJobId, **kwargs) -> ApiResponse
|
|
150
|
+
|
|
151
|
+
Adds an appointment to the service job indicated by the service job identifier you specify.
|
|
152
|
+
|
|
153
|
+
**Usage Plan:**
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
====================================== ==============
|
|
157
|
+
Rate (requests per second) Burst
|
|
158
|
+
====================================== ==============
|
|
159
|
+
5 20
|
|
160
|
+
====================================== ==============
|
|
161
|
+
|
|
162
|
+
For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
|
|
163
|
+
|
|
164
|
+
Args:
|
|
165
|
+
serviceJobId:string | * REQUIRED An Amazon defined service job identifier.
|
|
166
|
+
body: {
|
|
167
|
+
"appointmentTime": {
|
|
168
|
+
"startTime": "2019-08-24T14:15:22Z",
|
|
169
|
+
"durationInMinutes": 0
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
Returns:
|
|
174
|
+
ApiResponse:
|
|
175
|
+
"""
|
|
176
|
+
|
|
177
|
+
return await self._request(
|
|
178
|
+
fill_query_params(kwargs.pop("path"), serviceJobId), data=kwargs
|
|
179
|
+
)
|
|
180
|
+
|
|
181
|
+
@sp_endpoint("/service/v1/serviceJobs/{}", method="POST")
|
|
182
|
+
async def reschedule_appointment_for_service_job_by_service_job_id(
|
|
183
|
+
self, serviceJobId, **kwargs
|
|
184
|
+
) -> ApiResponse:
|
|
185
|
+
"""
|
|
186
|
+
reschedule_appointment_for_service_job_by_service_job_id(self, serviceJobId, **kwargs) -> ApiResponse
|
|
187
|
+
|
|
188
|
+
Reschedules an appointment for the service job indicated by the service job identifier you specify.
|
|
189
|
+
|
|
190
|
+
**Usage Plan:**
|
|
191
|
+
|
|
192
|
+
====================================== ==============
|
|
193
|
+
Rate (requests per second) Burst
|
|
194
|
+
====================================== ==============
|
|
195
|
+
5 20
|
|
196
|
+
====================================== ==============
|
|
197
|
+
|
|
198
|
+
For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
|
|
199
|
+
|
|
200
|
+
Args:
|
|
201
|
+
serviceJobId:string | * REQUIRED An Amazon defined service job identifier.
|
|
202
|
+
appointmentId:string | * REQUIRED An existing appointment identifier for the Service Job.
|
|
203
|
+
kwargs: Example | >>>
|
|
204
|
+
{
|
|
205
|
+
"appointmentTime": {
|
|
206
|
+
"startTime": "2019-08-24T14:15:22Z",
|
|
207
|
+
"durationInMinutes": 0
|
|
208
|
+
},
|
|
209
|
+
"rescheduleReasonCode": "string"
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
Returns:
|
|
213
|
+
ApiResponse:
|
|
214
|
+
"""
|
|
215
|
+
|
|
216
|
+
return await self._request(
|
|
217
|
+
fill_query_params(kwargs.pop("path"), serviceJobId), data=kwargs
|
|
218
|
+
)
|
|
File without changes
|
|
@@ -0,0 +1,459 @@
|
|
|
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 Shipping(AsyncBaseClient):
|
|
8
|
+
"""
|
|
9
|
+
Shipping SP-API Client
|
|
10
|
+
:link:
|
|
11
|
+
|
|
12
|
+
Provides programmatic access to Amazon Shipping APIs.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
@sp_endpoint("/shipping/v1/shipments", method="POST")
|
|
16
|
+
async def create_shipment(self, **kwargs) -> ApiResponse:
|
|
17
|
+
"""
|
|
18
|
+
create_shipment(self, **kwargs) -> ApiResponse
|
|
19
|
+
|
|
20
|
+
Create a new shipment.
|
|
21
|
+
|
|
22
|
+
**Usage Plan:**
|
|
23
|
+
|
|
24
|
+
====================================== ==============
|
|
25
|
+
Rate (requests per second) Burst
|
|
26
|
+
====================================== ==============
|
|
27
|
+
5 15
|
|
28
|
+
====================================== ==============
|
|
29
|
+
|
|
30
|
+
For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
|
|
31
|
+
|
|
32
|
+
Args:
|
|
33
|
+
body: {
|
|
34
|
+
"clientReferenceId": "string",
|
|
35
|
+
"shipTo": {
|
|
36
|
+
"name": "string",
|
|
37
|
+
"addressLine1": "string",
|
|
38
|
+
"addressLine2": "string",
|
|
39
|
+
"addressLine3": "string",
|
|
40
|
+
"stateOrRegion": "string",
|
|
41
|
+
"city": "string",
|
|
42
|
+
"countryCode": "st",
|
|
43
|
+
"postalCode": "string",
|
|
44
|
+
"email": "string",
|
|
45
|
+
"copyEmails": [
|
|
46
|
+
"string"
|
|
47
|
+
],
|
|
48
|
+
"phoneNumber": "string"
|
|
49
|
+
},
|
|
50
|
+
"shipFrom": {
|
|
51
|
+
"name": "string",
|
|
52
|
+
"addressLine1": "string",
|
|
53
|
+
"addressLine2": "string",
|
|
54
|
+
"addressLine3": "string",
|
|
55
|
+
"stateOrRegion": "string",
|
|
56
|
+
"city": "string",
|
|
57
|
+
"countryCode": "st",
|
|
58
|
+
"postalCode": "string",
|
|
59
|
+
"email": "string",
|
|
60
|
+
"copyEmails": [
|
|
61
|
+
"string"
|
|
62
|
+
],
|
|
63
|
+
"phoneNumber": "string"
|
|
64
|
+
},
|
|
65
|
+
"containers": [
|
|
66
|
+
{
|
|
67
|
+
"containerType": "PACKAGE",
|
|
68
|
+
"containerReferenceId": "string",
|
|
69
|
+
"value": {
|
|
70
|
+
"value": 0,
|
|
71
|
+
"unit": "str"
|
|
72
|
+
},
|
|
73
|
+
"dimensions": {
|
|
74
|
+
"length": 0,
|
|
75
|
+
"width": 0,
|
|
76
|
+
"height": 0,
|
|
77
|
+
"unit": "IN"
|
|
78
|
+
},
|
|
79
|
+
"items": [
|
|
80
|
+
{
|
|
81
|
+
"quantity": 0,
|
|
82
|
+
"unitPrice": {
|
|
83
|
+
"value": 0,
|
|
84
|
+
"unit": "str"
|
|
85
|
+
},
|
|
86
|
+
"unitWeight": {
|
|
87
|
+
"unit": "g",
|
|
88
|
+
"value": 0
|
|
89
|
+
},
|
|
90
|
+
"title": "string"
|
|
91
|
+
}
|
|
92
|
+
],
|
|
93
|
+
"weight": {
|
|
94
|
+
"unit": "g",
|
|
95
|
+
"value": 0
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
]
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
Returns:
|
|
102
|
+
ApiResponse:
|
|
103
|
+
"""
|
|
104
|
+
|
|
105
|
+
return await self._request(kwargs.pop("path"), data=kwargs)
|
|
106
|
+
|
|
107
|
+
@sp_endpoint("/shipping/v1/shipments/{}", method="GET")
|
|
108
|
+
async def get_shipment(self, shipmentId, **kwargs) -> ApiResponse:
|
|
109
|
+
"""
|
|
110
|
+
get_shipment(self, shipmentId, **kwargs) -> ApiResponse
|
|
111
|
+
|
|
112
|
+
Return the entire shipment object for the shipmentId.
|
|
113
|
+
|
|
114
|
+
**Usage Plan:**
|
|
115
|
+
|
|
116
|
+
====================================== ==============
|
|
117
|
+
Rate (requests per second) Burst
|
|
118
|
+
====================================== ==============
|
|
119
|
+
5 15
|
|
120
|
+
====================================== ==============
|
|
121
|
+
|
|
122
|
+
For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
|
|
123
|
+
|
|
124
|
+
Args:
|
|
125
|
+
shipmentId:string | * REQUIRED
|
|
126
|
+
|
|
127
|
+
Returns:
|
|
128
|
+
ApiResponse:
|
|
129
|
+
"""
|
|
130
|
+
|
|
131
|
+
return await self._request(
|
|
132
|
+
fill_query_params(kwargs.pop("path"), shipmentId), params=kwargs
|
|
133
|
+
)
|
|
134
|
+
|
|
135
|
+
@sp_endpoint("/shipping/v1/shipments/{}/cancel", method="POST")
|
|
136
|
+
async def cancel_shipment(self, shipmentId, **kwargs) -> ApiResponse:
|
|
137
|
+
"""
|
|
138
|
+
cancel_shipment(self, shipmentId, **kwargs) -> ApiResponse
|
|
139
|
+
|
|
140
|
+
Cancel a shipment by the given shipmentId.
|
|
141
|
+
|
|
142
|
+
**Usage Plan:**
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
====================================== ==============
|
|
146
|
+
Rate (requests per second) Burst
|
|
147
|
+
====================================== ==============
|
|
148
|
+
5 15
|
|
149
|
+
====================================== ==============
|
|
150
|
+
|
|
151
|
+
For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
|
|
152
|
+
|
|
153
|
+
Args:
|
|
154
|
+
shipmentId:string | * REQUIRED
|
|
155
|
+
|
|
156
|
+
Returns:
|
|
157
|
+
ApiResponse:
|
|
158
|
+
"""
|
|
159
|
+
|
|
160
|
+
return await self._request(
|
|
161
|
+
fill_query_params(kwargs.pop("path"), shipmentId), data=kwargs
|
|
162
|
+
)
|
|
163
|
+
|
|
164
|
+
@sp_endpoint("/shipping/v1/shipments/{}/purchaseLabels", method="POST")
|
|
165
|
+
async def purchase_labels(self, shipmentId, **kwargs) -> ApiResponse:
|
|
166
|
+
"""
|
|
167
|
+
purchase_labels(self, shipmentId, **kwargs) -> ApiResponse
|
|
168
|
+
|
|
169
|
+
Purchase shipping labels based on a given rate.
|
|
170
|
+
|
|
171
|
+
**Usage Plan:**
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
====================================== ==============
|
|
175
|
+
Rate (requests per second) Burst
|
|
176
|
+
====================================== ==============
|
|
177
|
+
5 15
|
|
178
|
+
====================================== ==============
|
|
179
|
+
|
|
180
|
+
For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
|
|
181
|
+
|
|
182
|
+
Args:
|
|
183
|
+
shipmentId:string | * REQUIRED
|
|
184
|
+
body: {
|
|
185
|
+
"rateId": "string",
|
|
186
|
+
"labelSpecification": {
|
|
187
|
+
"labelFormat": "PNG",
|
|
188
|
+
"labelStockSize": "4x6"
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
Returns:
|
|
194
|
+
ApiResponse:
|
|
195
|
+
"""
|
|
196
|
+
|
|
197
|
+
return await self._request(
|
|
198
|
+
fill_query_params(kwargs.pop("path"), shipmentId), data=kwargs
|
|
199
|
+
)
|
|
200
|
+
|
|
201
|
+
@sp_endpoint("/shipping/v1/shipments/{}/label", method="POST")
|
|
202
|
+
async def retrieve_shipping_label(self, shipmentId, **kwargs) -> ApiResponse:
|
|
203
|
+
"""
|
|
204
|
+
retrieve_shipping_label(self, shipmentId, **kwargs) -> ApiResponse
|
|
205
|
+
|
|
206
|
+
Retrieve shipping label based on the shipment id and tracking id.
|
|
207
|
+
|
|
208
|
+
**Usage Plan:**
|
|
209
|
+
|
|
210
|
+
====================================== ==============
|
|
211
|
+
Rate (requests per second) Burst
|
|
212
|
+
====================================== ==============
|
|
213
|
+
5 15
|
|
214
|
+
====================================== ==============
|
|
215
|
+
|
|
216
|
+
For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
|
|
217
|
+
|
|
218
|
+
Args:
|
|
219
|
+
shipmentId:string | * REQUIRED
|
|
220
|
+
trackingId:string | * REQUIRED
|
|
221
|
+
body: {
|
|
222
|
+
"labelSpecification": {
|
|
223
|
+
"labelFormat": "PNG",
|
|
224
|
+
"labelStockSize": "4x6"
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
Returns:
|
|
229
|
+
ApiResponse:
|
|
230
|
+
"""
|
|
231
|
+
|
|
232
|
+
return await self._request(
|
|
233
|
+
fill_query_params(kwargs.pop("path"), shipmentId), data=kwargs
|
|
234
|
+
)
|
|
235
|
+
|
|
236
|
+
@sp_endpoint("/shipping/v1/purchaseShipment", method="POST")
|
|
237
|
+
async def purchase_shipment(self, **kwargs) -> ApiResponse:
|
|
238
|
+
"""
|
|
239
|
+
purchase_shipment(self, **kwargs) -> ApiResponse
|
|
240
|
+
|
|
241
|
+
Purchase shipping labels.
|
|
242
|
+
|
|
243
|
+
**Usage Plan:**
|
|
244
|
+
|
|
245
|
+
====================================== ==============
|
|
246
|
+
Rate (requests per second) Burst
|
|
247
|
+
====================================== ==============
|
|
248
|
+
5 15
|
|
249
|
+
====================================== ==============
|
|
250
|
+
|
|
251
|
+
For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
|
|
252
|
+
|
|
253
|
+
Args:
|
|
254
|
+
body: {
|
|
255
|
+
"clientReferenceId": "string",
|
|
256
|
+
"shipTo": {
|
|
257
|
+
"name": "string",
|
|
258
|
+
"addressLine1": "string",
|
|
259
|
+
"addressLine2": "string",
|
|
260
|
+
"addressLine3": "string",
|
|
261
|
+
"stateOrRegion": "string",
|
|
262
|
+
"city": "string",
|
|
263
|
+
"countryCode": "st",
|
|
264
|
+
"postalCode": "string",
|
|
265
|
+
"email": "string",
|
|
266
|
+
"copyEmails": [
|
|
267
|
+
"string"
|
|
268
|
+
],
|
|
269
|
+
"phoneNumber": "string"
|
|
270
|
+
},
|
|
271
|
+
"shipFrom": {
|
|
272
|
+
"name": "string",
|
|
273
|
+
"addressLine1": "string",
|
|
274
|
+
"addressLine2": "string",
|
|
275
|
+
"addressLine3": "string",
|
|
276
|
+
"stateOrRegion": "string",
|
|
277
|
+
"city": "string",
|
|
278
|
+
"countryCode": "st",
|
|
279
|
+
"postalCode": "string",
|
|
280
|
+
"email": "string",
|
|
281
|
+
"copyEmails": [
|
|
282
|
+
"string"
|
|
283
|
+
],
|
|
284
|
+
"phoneNumber": "string"
|
|
285
|
+
},
|
|
286
|
+
"shipDate": "2019-08-24T14:15:22Z",
|
|
287
|
+
"serviceType": "Amazon Shipping Ground",
|
|
288
|
+
"containers": [
|
|
289
|
+
{
|
|
290
|
+
"containerType": "PACKAGE",
|
|
291
|
+
"containerReferenceId": "string",
|
|
292
|
+
"value": {
|
|
293
|
+
"value": 0,
|
|
294
|
+
"unit": "str"
|
|
295
|
+
},
|
|
296
|
+
"dimensions": {
|
|
297
|
+
"length": 0,
|
|
298
|
+
"width": 0,
|
|
299
|
+
"height": 0,
|
|
300
|
+
"unit": "IN"
|
|
301
|
+
},
|
|
302
|
+
"items": [
|
|
303
|
+
{
|
|
304
|
+
"quantity": 0,
|
|
305
|
+
"unitPrice": {
|
|
306
|
+
"value": 0,
|
|
307
|
+
"unit": "str"
|
|
308
|
+
},
|
|
309
|
+
"unitWeight": {
|
|
310
|
+
"unit": "g",
|
|
311
|
+
"value": 0
|
|
312
|
+
},
|
|
313
|
+
"title": "string"
|
|
314
|
+
}
|
|
315
|
+
],
|
|
316
|
+
"weight": {
|
|
317
|
+
"unit": "g",
|
|
318
|
+
"value": 0
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
],
|
|
322
|
+
"labelSpecification": {
|
|
323
|
+
"labelFormat": "PNG",
|
|
324
|
+
"labelStockSize": "4x6"
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
Returns:
|
|
329
|
+
ApiResponse:
|
|
330
|
+
"""
|
|
331
|
+
|
|
332
|
+
return await self._request(kwargs.pop("path"), data=kwargs)
|
|
333
|
+
|
|
334
|
+
@sp_endpoint("/shipping/v1/rates", method="POST")
|
|
335
|
+
async def get_rates(self, **kwargs) -> ApiResponse:
|
|
336
|
+
"""
|
|
337
|
+
get_rates(self, **kwargs) -> ApiResponse
|
|
338
|
+
|
|
339
|
+
Get service rates.
|
|
340
|
+
|
|
341
|
+
**Usage Plan:**
|
|
342
|
+
|
|
343
|
+
====================================== ==============
|
|
344
|
+
Rate (requests per second) Burst
|
|
345
|
+
====================================== ==============
|
|
346
|
+
5 15
|
|
347
|
+
====================================== ==============
|
|
348
|
+
|
|
349
|
+
For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
|
|
350
|
+
|
|
351
|
+
Args:
|
|
352
|
+
body:{
|
|
353
|
+
"shipTo": {
|
|
354
|
+
"name": "string",
|
|
355
|
+
"addressLine1": "string",
|
|
356
|
+
"addressLine2": "string",
|
|
357
|
+
"addressLine3": "string",
|
|
358
|
+
"stateOrRegion": "string",
|
|
359
|
+
"city": "string",
|
|
360
|
+
"countryCode": "st",
|
|
361
|
+
"postalCode": "string",
|
|
362
|
+
"email": "string",
|
|
363
|
+
"copyEmails": [
|
|
364
|
+
"string"
|
|
365
|
+
],
|
|
366
|
+
"phoneNumber": "string"
|
|
367
|
+
},
|
|
368
|
+
"shipFrom": {
|
|
369
|
+
"name": "string",
|
|
370
|
+
"addressLine1": "string",
|
|
371
|
+
"addressLine2": "string",
|
|
372
|
+
"addressLine3": "string",
|
|
373
|
+
"stateOrRegion": "string",
|
|
374
|
+
"city": "string",
|
|
375
|
+
"countryCode": "st",
|
|
376
|
+
"postalCode": "string",
|
|
377
|
+
"email": "string",
|
|
378
|
+
"copyEmails": [
|
|
379
|
+
"string"
|
|
380
|
+
],
|
|
381
|
+
"phoneNumber": "string"
|
|
382
|
+
},
|
|
383
|
+
"serviceTypes": [
|
|
384
|
+
"Amazon Shipping Ground"
|
|
385
|
+
],
|
|
386
|
+
"shipDate": "2019-08-24T14:15:22Z",
|
|
387
|
+
"containerSpecifications": [
|
|
388
|
+
{
|
|
389
|
+
"dimensions": {
|
|
390
|
+
"length": 0,
|
|
391
|
+
"width": 0,
|
|
392
|
+
"height": 0,
|
|
393
|
+
"unit": "IN"
|
|
394
|
+
},
|
|
395
|
+
"weight": {
|
|
396
|
+
"unit": "g",
|
|
397
|
+
"value": 0
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
]
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
Returns:
|
|
404
|
+
ApiResponse:
|
|
405
|
+
"""
|
|
406
|
+
|
|
407
|
+
return await self._request(kwargs.pop("path"), data=kwargs)
|
|
408
|
+
|
|
409
|
+
@sp_endpoint("/shipping/v1/account", method="GET")
|
|
410
|
+
async def get_account(self, **kwargs) -> ApiResponse:
|
|
411
|
+
"""
|
|
412
|
+
get_account(self, **kwargs) -> ApiResponse
|
|
413
|
+
|
|
414
|
+
Verify if the current account is valid.
|
|
415
|
+
|
|
416
|
+
**Usage Plan:**
|
|
417
|
+
|
|
418
|
+
====================================== ==============
|
|
419
|
+
Rate (requests per second) Burst
|
|
420
|
+
====================================== ==============
|
|
421
|
+
5 15
|
|
422
|
+
====================================== ==============
|
|
423
|
+
|
|
424
|
+
For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
|
|
425
|
+
|
|
426
|
+
Returns:
|
|
427
|
+
ApiResponse:
|
|
428
|
+
"""
|
|
429
|
+
|
|
430
|
+
return await self._request(kwargs.pop("path"), params=kwargs)
|
|
431
|
+
|
|
432
|
+
@sp_endpoint("/shipping/v1/tracking/{}", method="GET")
|
|
433
|
+
async def get_tracking_information(self, trackingId, **kwargs) -> ApiResponse:
|
|
434
|
+
"""
|
|
435
|
+
get_tracking_information(self, trackingId, **kwargs) -> ApiResponse
|
|
436
|
+
|
|
437
|
+
Return the tracking information of a shipment.
|
|
438
|
+
|
|
439
|
+
**Usage Plan:**
|
|
440
|
+
|
|
441
|
+
|
|
442
|
+
====================================== ==============
|
|
443
|
+
Rate (requests per second) Burst
|
|
444
|
+
====================================== ==============
|
|
445
|
+
1 1
|
|
446
|
+
====================================== ==============
|
|
447
|
+
|
|
448
|
+
For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
|
|
449
|
+
|
|
450
|
+
Args:
|
|
451
|
+
trackingId:string | * REQUIRED
|
|
452
|
+
|
|
453
|
+
Returns:
|
|
454
|
+
ApiResponse:
|
|
455
|
+
"""
|
|
456
|
+
|
|
457
|
+
return await self._request(
|
|
458
|
+
fill_query_params(kwargs.pop("path"), trackingId), params=kwargs
|
|
459
|
+
)
|