peddler 2.4.4 → 3.0.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +406 -134
- data/lib/peddler/access_token.rb +76 -0
- data/lib/peddler/api/amazon_warehousing_and_distribution_2024_05_09.rb +80 -0
- data/lib/peddler/api/aplus_content_2020_11_01.rb +208 -0
- data/lib/peddler/api/application_management_2023_11_30.rb +25 -0
- data/lib/peddler/api/catalog_items_2020_12_01.rb +70 -0
- data/lib/peddler/api/catalog_items_2022_04_01.rb +83 -0
- data/lib/peddler/api/catalog_items_v0.rb +90 -0
- data/lib/peddler/api/data_kiosk_2023_11_15.rb +92 -0
- data/lib/peddler/api/easy_ship_2022_03_23.rb +108 -0
- data/lib/peddler/api/fba_inbound_eligibility_v1.rb +36 -0
- data/lib/peddler/api/fba_inventory_v1.rb +106 -0
- data/lib/peddler/api/feeds_2021_06_30.rb +104 -0
- data/lib/peddler/api/finances_v0.rb +121 -0
- data/lib/peddler/api/fulfillment_inbound_2024_03_20.rb +660 -0
- data/lib/peddler/api/fulfillment_inbound_v0.rb +314 -0
- data/lib/peddler/api/fulfillment_outbound_2020_07_01.rb +222 -0
- data/lib/peddler/api/listings_items_2020_09_01.rb +84 -0
- data/lib/peddler/api/listings_items_2021_08_01.rb +154 -0
- data/lib/peddler/api/listings_restrictions_2021_08_01.rb +37 -0
- data/lib/peddler/api/merchant_fulfillment_v0.rb +64 -0
- data/lib/peddler/api/messaging_v1.rb +241 -0
- data/lib/peddler/api/notifications_v1.rb +114 -0
- data/lib/peddler/api/orders_v0.rb +264 -0
- data/lib/peddler/api/product_fees_v0.rb +69 -0
- data/lib/peddler/api/product_pricing_2022_05_01.rb +43 -0
- data/lib/peddler/api/product_pricing_v0.rb +144 -0
- data/lib/peddler/api/product_type_definitions_2020_09_01.rb +75 -0
- data/lib/peddler/api/replenishment_2022_11_07.rb +45 -0
- data/lib/peddler/api/reports_2021_06_30.rb +139 -0
- data/lib/peddler/api/sales_v1.rb +69 -0
- data/lib/peddler/api/sellers_v1.rb +33 -0
- data/lib/peddler/api/services_v1.rb +308 -0
- data/lib/peddler/api/shipment_invoicing_v0.rb +46 -0
- data/lib/peddler/api/shipping_v1.rb +107 -0
- data/lib/peddler/api/shipping_v2.rb +267 -0
- data/lib/peddler/api/solicitations_v1.rb +53 -0
- data/lib/peddler/api/supply_sources_2020_07_01.rb +82 -0
- data/lib/peddler/api/tokens_2021_03_01.rb +30 -0
- data/lib/peddler/api/uploads_2020_11_01.rb +40 -0
- data/lib/peddler/api/vendor_direct_fulfillment_inventory_v1.rb +24 -0
- data/lib/peddler/api/vendor_direct_fulfillment_orders_2021_12_28.rb +72 -0
- data/lib/peddler/api/vendor_direct_fulfillment_orders_v1.rb +72 -0
- data/lib/peddler/api/vendor_direct_fulfillment_payments_v1.rb +23 -0
- data/lib/peddler/api/vendor_direct_fulfillment_sandbox_test_data_2021_10_28.rb +35 -0
- data/lib/peddler/api/vendor_direct_fulfillment_shipping_2021_12_28.rb +177 -0
- data/lib/peddler/api/vendor_direct_fulfillment_shipping_v1.rb +165 -0
- data/lib/peddler/api/vendor_direct_fulfillment_transactions_2021_12_28.rb +24 -0
- data/lib/peddler/api/vendor_direct_fulfillment_transactions_v1.rb +24 -0
- data/lib/peddler/api/vendor_invoices_v1.rb +22 -0
- data/lib/peddler/api/vendor_orders_v1.rb +148 -0
- data/lib/peddler/api/vendor_shipments_v1.rb +120 -0
- data/lib/peddler/api/vendor_transaction_status_v1.rb +24 -0
- data/lib/peddler/api.rb +115 -0
- data/lib/peddler/error.rb +30 -0
- data/lib/peddler/region.rb +30 -0
- data/lib/peddler/version.rb +1 -1
- data/lib/peddler.rb +52 -1
- metadata +70 -80
- data/lib/mws/easy_ship/client.rb +0 -93
- data/lib/mws/easy_ship.rb +0 -3
- data/lib/mws/feeds/client.rb +0 -122
- data/lib/mws/feeds.rb +0 -3
- data/lib/mws/finances/client.rb +0 -82
- data/lib/mws/finances.rb +0 -3
- data/lib/mws/fulfillment_inbound_shipment/client.rb +0 -388
- data/lib/mws/fulfillment_inbound_shipment.rb +0 -3
- data/lib/mws/fulfillment_inventory/client.rb +0 -57
- data/lib/mws/fulfillment_inventory.rb +0 -3
- data/lib/mws/fulfillment_outbound_shipment/client.rb +0 -211
- data/lib/mws/fulfillment_outbound_shipment.rb +0 -3
- data/lib/mws/merchant_fulfillment/client.rb +0 -87
- data/lib/mws/merchant_fulfillment.rb +0 -3
- data/lib/mws/off_amazon_payments.rb +0 -3
- data/lib/mws/orders/client.rb +0 -120
- data/lib/mws/orders.rb +0 -3
- data/lib/mws/products/client.rb +0 -268
- data/lib/mws/products.rb +0 -3
- data/lib/mws/recommendations/client.rb +0 -72
- data/lib/mws/recommendations.rb +0 -3
- data/lib/mws/reports/client.rb +0 -236
- data/lib/mws/reports.rb +0 -3
- data/lib/mws/sellers/client.rb +0 -44
- data/lib/mws/sellers.rb +0 -3
- data/lib/mws/shipment_invoicing/client.rb +0 -74
- data/lib/mws/shipment_invoicing.rb +0 -3
- data/lib/mws/subscriptions/client.rb +0 -179
- data/lib/mws/subscriptions.rb +0 -3
- data/lib/mws.rb +0 -29
- data/lib/peddler/client.rb +0 -159
- data/lib/peddler/errors/builder.rb +0 -64
- data/lib/peddler/errors/class_generator.rb +0 -40
- data/lib/peddler/errors/error.rb +0 -45
- data/lib/peddler/errors/parser.rb +0 -28
- data/lib/peddler/flat_file_parser.rb +0 -56
- data/lib/peddler/headers.rb +0 -102
- data/lib/peddler/marketplace.rb +0 -78
- data/lib/peddler/operation.rb +0 -78
- data/lib/peddler/parser.rb +0 -33
- data/lib/peddler/structured_list.rb +0 -23
- data/lib/peddler/vcr_matcher.rb +0 -97
- data/lib/peddler/xml_parser.rb +0 -38
- data/lib/peddler/xml_response_parser.rb +0 -25
@@ -0,0 +1,660 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "peddler/api"
|
4
|
+
|
5
|
+
module Peddler
|
6
|
+
class API
|
7
|
+
# The Selling Partner API for FBA inbound operations.
|
8
|
+
#
|
9
|
+
# The Selling Partner API for Fulfillment By Amazon (FBA) Inbound. The FBA Inbound API enables building inbound
|
10
|
+
# workflows to create, manage, and send shipments into Amazon's fulfillment network. The API has interoperability
|
11
|
+
# with the Send-to-Amazon user interface.
|
12
|
+
class FulfillmentInbound20240320 < API
|
13
|
+
# Provides a list of inbound plans with minimal information.
|
14
|
+
#
|
15
|
+
# @param [Integer] page_size The number of inbound plans to return in the response matching the given query.
|
16
|
+
# @param [String] pagination_token A token to fetch a certain page when there are multiple pages worth of results.
|
17
|
+
# The value of this token is fetched from the `pagination` returned in the API response. In the absence of the
|
18
|
+
# token value from the query parameter the API returns the first page of the result.
|
19
|
+
# @param [String] status The status of an inbound plan.
|
20
|
+
# @param [String] sort_by Sort by field.
|
21
|
+
# @param [String] sort_order The sort order.
|
22
|
+
# @return [Hash] The API response
|
23
|
+
def list_inbound_plans(page_size: nil, pagination_token: nil, status: nil, sort_by: nil, sort_order: nil)
|
24
|
+
path = "/inbound/fba/2024-03-20/inboundPlans"
|
25
|
+
params = {
|
26
|
+
"pageSize" => page_size,
|
27
|
+
"paginationToken" => pagination_token,
|
28
|
+
"status" => status,
|
29
|
+
"sortBy" => sort_by,
|
30
|
+
"sortOrder" => sort_order,
|
31
|
+
}.compact
|
32
|
+
|
33
|
+
rate_limit(2.0).get(path, params:)
|
34
|
+
end
|
35
|
+
|
36
|
+
# Creates an inbound plan. An inbound plan contains all the necessary information to send shipments into Amazon's
|
37
|
+
# fufillment network.
|
38
|
+
#
|
39
|
+
# @param [Hash] body The body of the request to `createInboundPlan`.
|
40
|
+
# @return [Hash] The API response
|
41
|
+
def create_inbound_plan(body)
|
42
|
+
path = "/inbound/fba/2024-03-20/inboundPlans"
|
43
|
+
|
44
|
+
rate_limit(2.0).post(path, body:)
|
45
|
+
end
|
46
|
+
|
47
|
+
# Fetches the top level information about an inbound plan.
|
48
|
+
#
|
49
|
+
# @param [String] inbound_plan_id Identifier of an inbound plan.
|
50
|
+
# @return [Hash] The API response
|
51
|
+
def get_inbound_plan(inbound_plan_id)
|
52
|
+
path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}"
|
53
|
+
|
54
|
+
rate_limit(2.0).get(path)
|
55
|
+
end
|
56
|
+
|
57
|
+
# Provides a paginated list of box packages in an inbound plan.
|
58
|
+
#
|
59
|
+
# @param [String] inbound_plan_id Identifier of an inbound plan.
|
60
|
+
# @param [Integer] page_size The number of boxes to return in the response matching the given query.
|
61
|
+
# @param [String] pagination_token A token to fetch a certain page when there are multiple pages worth of results.
|
62
|
+
# The value of this token is fetched from the `pagination` returned in the API response. In the absence of the
|
63
|
+
# token value from the query parameter the API returns the first page of the result.
|
64
|
+
# @return [Hash] The API response
|
65
|
+
def list_inbound_plan_boxes(inbound_plan_id, page_size: nil, pagination_token: nil)
|
66
|
+
path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/boxes"
|
67
|
+
params = {
|
68
|
+
"pageSize" => page_size,
|
69
|
+
"paginationToken" => pagination_token,
|
70
|
+
}.compact
|
71
|
+
|
72
|
+
rate_limit(2.0).get(path, params:)
|
73
|
+
end
|
74
|
+
|
75
|
+
# Cancels an Inbound Plan. Charges may apply if the cancellation is performed outside of a void window. The window
|
76
|
+
# for Amazon Partnered Carriers is 24 hours for Small Parcel Delivery (SPD) and one hour for Less-Than-Truckload
|
77
|
+
# (LTL) carrier shipments.
|
78
|
+
#
|
79
|
+
# @param [String] inbound_plan_id Identifier of an inbound plan.
|
80
|
+
# @return [Hash] The API response
|
81
|
+
def cancel_inbound_plan(inbound_plan_id)
|
82
|
+
path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/cancellation"
|
83
|
+
|
84
|
+
rate_limit(2.0).put(path)
|
85
|
+
end
|
86
|
+
|
87
|
+
# Provides a paginated list of item packages in an inbound plan.
|
88
|
+
#
|
89
|
+
# @param [String] inbound_plan_id Identifier of an inbound plan.
|
90
|
+
# @param [Integer] page_size The number of items to return in the response matching the given query.
|
91
|
+
# @param [String] pagination_token A token to fetch a certain page when there are multiple pages worth of results.
|
92
|
+
# The value of this token is fetched from the `pagination` returned in the API response. In the absence of the
|
93
|
+
# token value from the query parameter the API returns the first page of the result.
|
94
|
+
# @return [Hash] The API response
|
95
|
+
def list_inbound_plan_items(inbound_plan_id, page_size: nil, pagination_token: nil)
|
96
|
+
path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/items"
|
97
|
+
params = {
|
98
|
+
"pageSize" => page_size,
|
99
|
+
"paginationToken" => pagination_token,
|
100
|
+
}.compact
|
101
|
+
|
102
|
+
rate_limit(2.0).get(path, params:)
|
103
|
+
end
|
104
|
+
|
105
|
+
# Updates the name of an existing inbound plan.
|
106
|
+
#
|
107
|
+
# @param [String] inbound_plan_id Identifier of an inbound plan.
|
108
|
+
# @param [Hash] body The body of the request to `updateInboundPlanName`.
|
109
|
+
# @return [Hash] The API response
|
110
|
+
def update_inbound_plan_name(inbound_plan_id, body)
|
111
|
+
path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/name"
|
112
|
+
|
113
|
+
rate_limit(2.0).put(path, body:)
|
114
|
+
end
|
115
|
+
|
116
|
+
# Retrieves a page of boxes from a given packing group. These boxes were previously provided through the
|
117
|
+
# `setPackingInformation` operation. This API is used for workflows where boxes are packed before Amazon
|
118
|
+
# determines shipment splits.
|
119
|
+
#
|
120
|
+
# @param [String] inbound_plan_id Identifier of an inbound plan.
|
121
|
+
# @param [String] packing_group_id Identifier of a packing group.
|
122
|
+
# @param [Integer] page_size The number of packing group boxes to return in the response matching the given query.
|
123
|
+
# @param [String] pagination_token A token to fetch a certain page when there are multiple pages worth of results.
|
124
|
+
# The value of this token is fetched from the `pagination` returned in the API response. In the absence of the
|
125
|
+
# token value from the query parameter the API returns the first page of the result.
|
126
|
+
# @return [Hash] The API response
|
127
|
+
def list_packing_group_boxes(inbound_plan_id, packing_group_id, page_size: nil, pagination_token: nil)
|
128
|
+
path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/packingGroups/#{packing_group_id}/boxes"
|
129
|
+
params = {
|
130
|
+
"pageSize" => page_size,
|
131
|
+
"paginationToken" => pagination_token,
|
132
|
+
}.compact
|
133
|
+
|
134
|
+
rate_limit(2.0).get(path, params:)
|
135
|
+
end
|
136
|
+
|
137
|
+
# Retrieves a page of items in a given packing group. Packing options must first be generated by the corresponding
|
138
|
+
# operation before packing group items can be listed.
|
139
|
+
#
|
140
|
+
# @param [String] inbound_plan_id Identifier of an inbound plan.
|
141
|
+
# @param [String] packing_group_id Identifier of a packing group.
|
142
|
+
# @param [Integer] page_size The number of packing group items to return in the response matching the given query.
|
143
|
+
# @param [String] pagination_token A token to fetch a certain page when there are multiple pages worth of results.
|
144
|
+
# The value of this token is fetched from the `pagination` returned in the API response. In the absence of the
|
145
|
+
# token value from the query parameter the API returns the first page of the result.
|
146
|
+
# @return [Hash] The API response
|
147
|
+
def list_packing_group_items(inbound_plan_id, packing_group_id, page_size: nil, pagination_token: nil)
|
148
|
+
path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/packingGroups/#{packing_group_id}/items"
|
149
|
+
params = {
|
150
|
+
"pageSize" => page_size,
|
151
|
+
"paginationToken" => pagination_token,
|
152
|
+
}.compact
|
153
|
+
|
154
|
+
rate_limit(2.0).get(path, params:)
|
155
|
+
end
|
156
|
+
|
157
|
+
# Sets packing information for an inbound plan. This should be called after an inbound plan is created to populate
|
158
|
+
# the box level information required for planning and transportation estimates.
|
159
|
+
#
|
160
|
+
# @param [String] inbound_plan_id Identifier of an inbound plan.
|
161
|
+
# @param [Hash] body The body of the request to `setPackingInformation`.
|
162
|
+
# @return [Hash] The API response
|
163
|
+
def set_packing_information(inbound_plan_id, body)
|
164
|
+
path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/packingInformation"
|
165
|
+
|
166
|
+
rate_limit(2.0).post(path, body:)
|
167
|
+
end
|
168
|
+
|
169
|
+
# Retrieves a list of all packing options for an inbound plan. Packing options must first be generated by the
|
170
|
+
# corresponding operation before becoming available.
|
171
|
+
#
|
172
|
+
# @param [String] inbound_plan_id Identifier of an inbound plan.
|
173
|
+
# @param [Integer] page_size The number of packing options to return in the response matching the given query.
|
174
|
+
# @param [String] pagination_token A token to fetch a certain page when there are multiple pages worth of results.
|
175
|
+
# The value of this token is fetched from the `pagination` returned in the API response. In the absence of the
|
176
|
+
# token value from the query parameter the API returns the first page of the result.
|
177
|
+
# @return [Hash] The API response
|
178
|
+
def list_packing_options(inbound_plan_id, page_size: nil, pagination_token: nil)
|
179
|
+
path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/packingOptions"
|
180
|
+
params = {
|
181
|
+
"pageSize" => page_size,
|
182
|
+
"paginationToken" => pagination_token,
|
183
|
+
}.compact
|
184
|
+
|
185
|
+
rate_limit(2.0).get(path, params:)
|
186
|
+
end
|
187
|
+
|
188
|
+
# Generates available packing options for the inbound plan.
|
189
|
+
#
|
190
|
+
# @param [String] inbound_plan_id Identifier of an inbound plan.
|
191
|
+
# @return [Hash] The API response
|
192
|
+
def generate_packing_options(inbound_plan_id)
|
193
|
+
path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/packingOptions"
|
194
|
+
|
195
|
+
rate_limit(2.0).post(path)
|
196
|
+
end
|
197
|
+
|
198
|
+
# Confirms the packing option for an inbound plan.
|
199
|
+
#
|
200
|
+
# @param [String] inbound_plan_id Identifier of an inbound plan.
|
201
|
+
# @param [String] packing_option_id Identifier of a packing option.
|
202
|
+
# @return [Hash] The API response
|
203
|
+
def confirm_packing_option(inbound_plan_id, packing_option_id)
|
204
|
+
path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/packingOptions/#{packing_option_id}/confirmation"
|
205
|
+
|
206
|
+
rate_limit(2.0).post(path)
|
207
|
+
end
|
208
|
+
|
209
|
+
# Provides a paginated list of pallet packages in an inbound plan. An inbound plan will have pallets when the
|
210
|
+
# related details are provided after generating Less-Than-Truckload (LTL) carrier shipments.
|
211
|
+
#
|
212
|
+
# @param [String] inbound_plan_id Identifier of an inbound plan.
|
213
|
+
# @param [Integer] page_size The number of pallets to return in the response matching the given query.
|
214
|
+
# @param [String] pagination_token A token to fetch a certain page when there are multiple pages worth of results.
|
215
|
+
# The value of this token is fetched from the `pagination` returned in the API response. In the absence of the
|
216
|
+
# token value from the query parameter the API returns the first page of the result.
|
217
|
+
# @return [Hash] The API response
|
218
|
+
def list_inbound_plan_pallets(inbound_plan_id, page_size: nil, pagination_token: nil)
|
219
|
+
path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/pallets"
|
220
|
+
params = {
|
221
|
+
"pageSize" => page_size,
|
222
|
+
"paginationToken" => pagination_token,
|
223
|
+
}.compact
|
224
|
+
|
225
|
+
rate_limit(2.0).get(path, params:)
|
226
|
+
end
|
227
|
+
|
228
|
+
# Provides a list of all placement options for an inbound plan. Placement options must first be generated by the
|
229
|
+
# corresponding operation before becoming available.
|
230
|
+
#
|
231
|
+
# @param [String] inbound_plan_id Identifier of an inbound plan.
|
232
|
+
# @param [Integer] page_size The number of placement options to return in the response matching the given query.
|
233
|
+
# @param [String] pagination_token A token to fetch a certain page when there are multiple pages worth of results.
|
234
|
+
# The value of this token is fetched from the `pagination` returned in the API response. In the absence of the
|
235
|
+
# token value from the query parameter the API returns the first page of the result.
|
236
|
+
# @return [Hash] The API response
|
237
|
+
def list_placement_options(inbound_plan_id, page_size: nil, pagination_token: nil)
|
238
|
+
path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/placementOptions"
|
239
|
+
params = {
|
240
|
+
"pageSize" => page_size,
|
241
|
+
"paginationToken" => pagination_token,
|
242
|
+
}.compact
|
243
|
+
|
244
|
+
rate_limit(2.0).get(path, params:)
|
245
|
+
end
|
246
|
+
|
247
|
+
# Generates placement options for the inbound plan.
|
248
|
+
#
|
249
|
+
# @param [String] inbound_plan_id Identifier of an inbound plan.
|
250
|
+
# @param [Hash] body The body of the request to `generatePlacementOptions`.
|
251
|
+
# @return [Hash] The API response
|
252
|
+
def generate_placement_options(inbound_plan_id, body)
|
253
|
+
path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/placementOptions"
|
254
|
+
|
255
|
+
rate_limit(2.0).post(path, body:)
|
256
|
+
end
|
257
|
+
|
258
|
+
# Confirms the placement option for an inbound plan. Once confirmed, it cannot be changed for the Inbound Plan.
|
259
|
+
#
|
260
|
+
# @param [String] inbound_plan_id Identifier of an inbound plan.
|
261
|
+
# @param [String] placement_option_id The identifier of a placement option. A placement option represents the
|
262
|
+
# shipment splits and destinations of SKUs.
|
263
|
+
# @return [Hash] The API response
|
264
|
+
def confirm_placement_option(inbound_plan_id, placement_option_id)
|
265
|
+
path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/placementOptions/#{placement_option_id}/confirmation"
|
266
|
+
|
267
|
+
rate_limit(2.0).post(path)
|
268
|
+
end
|
269
|
+
|
270
|
+
# Provides the full details for a specific shipment within an inbound plan. The `transportationOptionId` inside
|
271
|
+
# `acceptedTransportationSelection` can be used to retrieve the transportation details for the shipment.
|
272
|
+
#
|
273
|
+
# @param [String] inbound_plan_id Identifier of an inbound plan.
|
274
|
+
# @param [String] shipment_id Identifier of a shipment. A shipment contains the boxes and units being inbounded.
|
275
|
+
# @return [Hash] The API response
|
276
|
+
def get_shipment(inbound_plan_id, shipment_id)
|
277
|
+
path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}"
|
278
|
+
|
279
|
+
rate_limit(2.0).get(path)
|
280
|
+
end
|
281
|
+
|
282
|
+
# Provides a paginated list of box packages in a shipment.
|
283
|
+
#
|
284
|
+
# @param [String] inbound_plan_id Identifier of an inbound plan.
|
285
|
+
# @param [String] shipment_id Identifier of a shipment. A shipment contains the boxes and units being inbounded.
|
286
|
+
# @param [Integer] page_size The number of boxes to return in the response matching the given query.
|
287
|
+
# @param [String] pagination_token A token to fetch a certain page when there are multiple pages worth of results.
|
288
|
+
# The value of this token is fetched from the `pagination` returned in the API response. In the absence of the
|
289
|
+
# token value from the query parameter the API returns the first page of the result.
|
290
|
+
# @return [Hash] The API response
|
291
|
+
def list_shipment_boxes(inbound_plan_id, shipment_id, page_size: nil, pagination_token: nil)
|
292
|
+
path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/boxes"
|
293
|
+
params = {
|
294
|
+
"pageSize" => page_size,
|
295
|
+
"paginationToken" => pagination_token,
|
296
|
+
}.compact
|
297
|
+
|
298
|
+
rate_limit(2.0).get(path, params:)
|
299
|
+
end
|
300
|
+
|
301
|
+
# Retrieve a paginated list of shipment content update previews for a given shipment. The shipment content update
|
302
|
+
# preview is a summary of the requested shipment content changes along with the transportation cost implications
|
303
|
+
# of the change that can only be confirmed prior to the expiry date specified.
|
304
|
+
#
|
305
|
+
# @param [String] inbound_plan_id Identifier of an inbound plan.
|
306
|
+
# @param [String] shipment_id Identifier of a shipment. A shipment contains the boxes and units being inbounded.
|
307
|
+
# @param [Integer] page_size The number of content update previews to return.
|
308
|
+
# @param [String] pagination_token A token to fetch a certain page when there are multiple pages worth of results.
|
309
|
+
# The value of this token is fetched from the `pagination` returned in the API response. In the absence of the
|
310
|
+
# token value from the query parameter the API returns the first page of the result.
|
311
|
+
# @return [Hash] The API response
|
312
|
+
def list_shipment_content_update_previews(inbound_plan_id, shipment_id, page_size: nil, pagination_token: nil)
|
313
|
+
path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/contentUpdatePreviews"
|
314
|
+
params = {
|
315
|
+
"pageSize" => page_size,
|
316
|
+
"paginationToken" => pagination_token,
|
317
|
+
}.compact
|
318
|
+
|
319
|
+
rate_limit(2.0).get(path, params:)
|
320
|
+
end
|
321
|
+
|
322
|
+
# Generate a shipment content update preview given a set of intended boxes and/or items for a shipment with a
|
323
|
+
# confirmed carrier. The shipment content update preview will be viewable with the updated costs and contents
|
324
|
+
# prior to confirmation.
|
325
|
+
#
|
326
|
+
# @param [String] inbound_plan_id Identifier of an inbound plan.
|
327
|
+
# @param [String] shipment_id Identifier of a shipment. A shipment contains the boxes and units being inbounded.
|
328
|
+
# @param [Hash] body The body of the request to `generateShipmentContentUpdatePreviews`.
|
329
|
+
# @return [Hash] The API response
|
330
|
+
def generate_shipment_content_update_previews(inbound_plan_id, shipment_id, body)
|
331
|
+
path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/contentUpdatePreviews"
|
332
|
+
|
333
|
+
rate_limit(2.0).post(path, body:)
|
334
|
+
end
|
335
|
+
|
336
|
+
# Retrieve a shipment content update preview which provides a summary of the requested shipment content changes
|
337
|
+
# along with the transportation cost implications of the change that can only be confirmed prior to the expiry
|
338
|
+
# date specified.
|
339
|
+
#
|
340
|
+
# @param [String] inbound_plan_id Identifier of an inbound plan.
|
341
|
+
# @param [String] shipment_id Identifier of a shipment. A shipment contains the boxes and units being inbounded.
|
342
|
+
# @param [String] content_update_preview_id Identifier of a content update preview.
|
343
|
+
# @return [Hash] The API response
|
344
|
+
def get_shipment_content_update_preview(inbound_plan_id, shipment_id, content_update_preview_id)
|
345
|
+
path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/contentUpdatePreviews/#{content_update_preview_id}"
|
346
|
+
|
347
|
+
rate_limit(2.0).get(path)
|
348
|
+
end
|
349
|
+
|
350
|
+
# Confirm a shipment content update preview and accept the changes in transportation cost.
|
351
|
+
#
|
352
|
+
# @param [String] inbound_plan_id Identifier of an inbound plan.
|
353
|
+
# @param [String] shipment_id Identifier of a shipment. A shipment contains the boxes and units being inbounded.
|
354
|
+
# @param [String] content_update_preview_id Identifier of a content update preview.
|
355
|
+
# @return [Hash] The API response
|
356
|
+
def confirm_shipment_content_update_preview(inbound_plan_id, shipment_id, content_update_preview_id)
|
357
|
+
path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/contentUpdatePreviews/#{content_update_preview_id}/confirmation"
|
358
|
+
|
359
|
+
rate_limit(2.0).post(path)
|
360
|
+
end
|
361
|
+
|
362
|
+
# Provide delivery challan document for PCP transportation in IN marketplace.
|
363
|
+
#
|
364
|
+
# @param [String] inbound_plan_id Identifier of an inbound plan.
|
365
|
+
# @param [String] shipment_id Identifier of a shipment. A shipment contains the boxes and units being inbounded.
|
366
|
+
# @return [Hash] The API response
|
367
|
+
def get_delivery_challan_document(inbound_plan_id, shipment_id)
|
368
|
+
path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/deliveryChallanDocument"
|
369
|
+
|
370
|
+
rate_limit(2.0).get(path)
|
371
|
+
end
|
372
|
+
|
373
|
+
# Retrieves all delivery window options for a shipment. Delivery window options must first be generated by the
|
374
|
+
# `generateDeliveryWindowOptions` operation before becoming available.
|
375
|
+
#
|
376
|
+
# @param [String] inbound_plan_id Identifier of an inbound plan.
|
377
|
+
# @param [String] shipment_id The shipment to get delivery window options for.
|
378
|
+
# @param [Integer] page_size The number of delivery window options to return in the response matching the given
|
379
|
+
# query.
|
380
|
+
# @param [String] pagination_token A token to fetch a certain page when there are multiple pages worth of results.
|
381
|
+
# The value of this token is fetched from the `pagination` returned in the API response. In the absence of the
|
382
|
+
# token value from the query parameter the API returns the first page of the result.
|
383
|
+
# @return [Hash] The API response
|
384
|
+
def list_delivery_window_options(inbound_plan_id, shipment_id, page_size: nil, pagination_token: nil)
|
385
|
+
path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/deliveryWindowOptions"
|
386
|
+
params = {
|
387
|
+
"pageSize" => page_size,
|
388
|
+
"paginationToken" => pagination_token,
|
389
|
+
}.compact
|
390
|
+
|
391
|
+
rate_limit(2.0).get(path, params:)
|
392
|
+
end
|
393
|
+
|
394
|
+
# Generates available delivery window options for a given shipment.
|
395
|
+
#
|
396
|
+
# @param [String] inbound_plan_id Identifier of an inbound plan.
|
397
|
+
# @param [String] shipment_id The shipment to generate delivery window options for.
|
398
|
+
# @return [Hash] The API response
|
399
|
+
def generate_delivery_window_options(inbound_plan_id, shipment_id)
|
400
|
+
path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/deliveryWindowOptions"
|
401
|
+
|
402
|
+
rate_limit(2.0).post(path)
|
403
|
+
end
|
404
|
+
|
405
|
+
# Confirms the delivery window option for chosen shipment within an inbound plan. A placement option must be
|
406
|
+
# confirmed prior to use of this API. Once confirmed, new delivery window options cannot be generated, but the
|
407
|
+
# chosen delivery window option can be updated before shipment closure. The window is used to provide the expected
|
408
|
+
# time when a shipment will arrive at the warehouse. All transportation options which have the program
|
409
|
+
# `CONFIRMED_DELIVERY_WINDOW` require a delivery window to be confirmed prior to transportation option
|
410
|
+
# confirmation.
|
411
|
+
#
|
412
|
+
# @param [String] inbound_plan_id Identifier of an inbound plan.
|
413
|
+
# @param [String] shipment_id The shipment to confirm the delivery window option for.
|
414
|
+
# @param [String] delivery_window_option_id The id of the delivery window option to be confirmed.
|
415
|
+
# @return [Hash] The API response
|
416
|
+
def confirm_delivery_window_options(inbound_plan_id, shipment_id, delivery_window_option_id)
|
417
|
+
path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/deliveryWindowOptions/#{delivery_window_option_id}/confirmation"
|
418
|
+
|
419
|
+
rate_limit(2.0).post(path)
|
420
|
+
end
|
421
|
+
|
422
|
+
# Provides a paginated list of item packages in a shipment.
|
423
|
+
#
|
424
|
+
# @param [String] inbound_plan_id Identifier of an inbound plan.
|
425
|
+
# @param [String] shipment_id Identifier of a shipment. A shipment contains the boxes and units being inbounded.
|
426
|
+
# @param [Integer] page_size The number of items to return in the response matching the given query.
|
427
|
+
# @param [String] pagination_token A token to fetch a certain page when there are multiple pages worth of results.
|
428
|
+
# The value of this token is fetched from the `pagination` returned in the API response. In the absence of the
|
429
|
+
# token value from the query parameter the API returns the first page of the result.
|
430
|
+
# @return [Hash] The API response
|
431
|
+
def list_shipment_items(inbound_plan_id, shipment_id, page_size: nil, pagination_token: nil)
|
432
|
+
path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/items"
|
433
|
+
params = {
|
434
|
+
"pageSize" => page_size,
|
435
|
+
"paginationToken" => pagination_token,
|
436
|
+
}.compact
|
437
|
+
|
438
|
+
rate_limit(2.0).get(path, params:)
|
439
|
+
end
|
440
|
+
|
441
|
+
# Updates the name of an existing shipment.
|
442
|
+
#
|
443
|
+
# @param [String] inbound_plan_id Identifier of an inbound plan.
|
444
|
+
# @param [String] shipment_id Identifier of a shipment. A shipment contains the boxes and units being inbounded.
|
445
|
+
# @param [Hash] body The body of the request to `updateShipmentName`.
|
446
|
+
# @return [Hash] The API response
|
447
|
+
def update_shipment_name(inbound_plan_id, shipment_id, body)
|
448
|
+
path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/name"
|
449
|
+
|
450
|
+
rate_limit(2.0).put(path, body:)
|
451
|
+
end
|
452
|
+
|
453
|
+
# Provides a paginated list of pallet packages in a shipment. A palletized shipment will have pallets when the
|
454
|
+
# related details are provided after generating Less-Than-Truckload (LTL) carrier shipments.
|
455
|
+
#
|
456
|
+
# @param [String] inbound_plan_id Identifier of an inbound plan.
|
457
|
+
# @param [String] shipment_id Identifier of a shipment. A shipment contains the boxes and units being inbounded.
|
458
|
+
# @param [Integer] page_size The number of pallets to return in the response matching the given query.
|
459
|
+
# @param [String] pagination_token A token to fetch a certain page when there are multiple pages worth of results.
|
460
|
+
# The value of this token is fetched from the `pagination` returned in the API response. In the absence of the
|
461
|
+
# token value from the query parameter the API returns the first page of the result.
|
462
|
+
# @return [Hash] The API response
|
463
|
+
def list_shipment_pallets(inbound_plan_id, shipment_id, page_size: nil, pagination_token: nil)
|
464
|
+
path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/pallets"
|
465
|
+
params = {
|
466
|
+
"pageSize" => page_size,
|
467
|
+
"paginationToken" => pagination_token,
|
468
|
+
}.compact
|
469
|
+
|
470
|
+
rate_limit(2.0).get(path, params:)
|
471
|
+
end
|
472
|
+
|
473
|
+
# Cancels a self-ship appointment slot against a shipment.
|
474
|
+
#
|
475
|
+
# @param [String] inbound_plan_id Identifier of an inbound plan.
|
476
|
+
# @param [String] shipment_id Identifier of a shipment. A shipment contains the boxes and units being inbounded.
|
477
|
+
# @param [Hash] body The body of the request to `cancelSelfShipAppointment`.
|
478
|
+
# @return [Hash] The API response
|
479
|
+
def cancel_self_ship_appointment(inbound_plan_id, shipment_id, body)
|
480
|
+
path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/selfShipAppointmentCancellation"
|
481
|
+
|
482
|
+
rate_limit(2.0).put(path, body:)
|
483
|
+
end
|
484
|
+
|
485
|
+
# Retrieves a list of available self-ship appointment slots used to drop off a shipment at a warehouse.
|
486
|
+
#
|
487
|
+
# @param [String] inbound_plan_id Identifier of an inbound plan.
|
488
|
+
# @param [String] shipment_id Identifier of a shipment. A shipment contains the boxes and units being inbounded.
|
489
|
+
# @param [Integer] page_size The number of self ship appointment slots to return in the response matching the
|
490
|
+
# given query.
|
491
|
+
# @param [String] pagination_token A token to fetch a certain page when there are multiple pages worth of results.
|
492
|
+
# The value of this token is fetched from the `pagination` returned in the API response. In the absence of the
|
493
|
+
# token value from the query parameter the API returns the first page of the result.
|
494
|
+
# @return [Hash] The API response
|
495
|
+
def get_self_ship_appointment_slots(inbound_plan_id, shipment_id, page_size: nil, pagination_token: nil)
|
496
|
+
path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/selfShipAppointmentSlots"
|
497
|
+
params = {
|
498
|
+
"pageSize" => page_size,
|
499
|
+
"paginationToken" => pagination_token,
|
500
|
+
}.compact
|
501
|
+
|
502
|
+
rate_limit(2.0).get(path, params:)
|
503
|
+
end
|
504
|
+
|
505
|
+
# Initiates the process of generating the appointment slots list.
|
506
|
+
#
|
507
|
+
# @param [String] inbound_plan_id Identifier of an inbound plan.
|
508
|
+
# @param [String] shipment_id Identifier of a shipment. A shipment contains the boxes and units being inbounded.
|
509
|
+
# @param [Hash] body The body of the request to `generateSelfShipAppointmentSlots`.
|
510
|
+
# @return [Hash] The API response
|
511
|
+
def generate_self_ship_appointment_slots(inbound_plan_id, shipment_id, body)
|
512
|
+
path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/selfShipAppointmentSlots"
|
513
|
+
|
514
|
+
rate_limit(2.0).post(path, body:)
|
515
|
+
end
|
516
|
+
|
517
|
+
# Confirms or reschedules a self-ship appointment slot against a shipment.
|
518
|
+
#
|
519
|
+
# @param [String] inbound_plan_id Identifier of an inbound plan.
|
520
|
+
# @param [String] shipment_id Identifier of a shipment. A shipment contains the boxes and units being inbounded.
|
521
|
+
# @param [String] slot_id An identifier to a self-ship appointment slot.
|
522
|
+
# @param [Hash] body The body of the request to `scheduleSelfShipAppointment`.
|
523
|
+
# @return [Hash] The API response
|
524
|
+
def schedule_self_ship_appointment(inbound_plan_id, shipment_id, slot_id, body)
|
525
|
+
path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/selfShipAppointmentSlots/#{slot_id}/schedule"
|
526
|
+
|
527
|
+
rate_limit(2.0).post(path, body:)
|
528
|
+
end
|
529
|
+
|
530
|
+
# Updates the source address of an existing shipment. The shipment source address can only be updated prior to the
|
531
|
+
# confirmation of the shipment carriers. As a result of the updated source address, existing transportation
|
532
|
+
# options will be invalidated and will need to be regenerated to capture the potential difference in
|
533
|
+
# transportation options and quotes due to the new source address.
|
534
|
+
#
|
535
|
+
# @param [String] inbound_plan_id Identifier of an inbound plan.
|
536
|
+
# @param [String] shipment_id Identifier of a shipment. A shipment contains the boxes and units being inbounded.
|
537
|
+
# @param [Hash] body The body of the request to `updateShipmentSourceAddress`.
|
538
|
+
# @return [Hash] The API response
|
539
|
+
def update_shipment_source_address(inbound_plan_id, shipment_id, body)
|
540
|
+
path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/sourceAddress"
|
541
|
+
|
542
|
+
rate_limit(2.0).put(path, body:)
|
543
|
+
end
|
544
|
+
|
545
|
+
# Updates a shipment's tracking details.
|
546
|
+
#
|
547
|
+
# @param [String] inbound_plan_id Identifier of an inbound plan.
|
548
|
+
# @param [String] shipment_id Identifier of a shipment. A shipment contains the boxes and units being inbounded.
|
549
|
+
# @param [Hash] body The body of the request to `updateShipmentTrackingDetails`.
|
550
|
+
# @return [Hash] The API response
|
551
|
+
def update_shipment_tracking_details(inbound_plan_id, shipment_id, body)
|
552
|
+
path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/trackingDetails"
|
553
|
+
|
554
|
+
rate_limit(2.0).put(path, body:)
|
555
|
+
end
|
556
|
+
|
557
|
+
# Retrieves all transportation options for a shipment. Transportation options must first be generated by the
|
558
|
+
# `generateTransportationOptions` operation before becoming available.
|
559
|
+
#
|
560
|
+
# @param [String] inbound_plan_id Identifier of an inbound plan.
|
561
|
+
# @param [Integer] page_size The number of transportation options to return in the response matching the given
|
562
|
+
# query.
|
563
|
+
# @param [String] pagination_token A token to fetch a certain page when there are multiple pages worth of results.
|
564
|
+
# The value of this token is fetched from the `pagination` returned in the API response. In the absence of the
|
565
|
+
# token value from the query parameter the API returns the first page of the result.
|
566
|
+
# @param [String] placement_option_id The placement option to get transportation options for. Either
|
567
|
+
# `placementOptionId` or `shipmentId` must be specified.
|
568
|
+
# @param [String] shipment_id The shipment to get transportation options for. Either `placementOptionId` or
|
569
|
+
# `shipmentId` must be specified.
|
570
|
+
# @return [Hash] The API response
|
571
|
+
def list_transportation_options(inbound_plan_id, page_size: nil, pagination_token: nil,
|
572
|
+
placement_option_id: nil, shipment_id: nil)
|
573
|
+
path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/transportationOptions"
|
574
|
+
params = {
|
575
|
+
"pageSize" => page_size,
|
576
|
+
"paginationToken" => pagination_token,
|
577
|
+
"placementOptionId" => placement_option_id,
|
578
|
+
"shipmentId" => shipment_id,
|
579
|
+
}.compact
|
580
|
+
|
581
|
+
rate_limit(2.0).get(path, params:)
|
582
|
+
end
|
583
|
+
|
584
|
+
# Generates available transportation options for a given placement option.
|
585
|
+
#
|
586
|
+
# @param [String] inbound_plan_id Identifier of an inbound plan.
|
587
|
+
# @param [Hash] body The body of the request to `generateTransportationOptions`.
|
588
|
+
# @return [Hash] The API response
|
589
|
+
def generate_transportation_options(inbound_plan_id, body)
|
590
|
+
path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/transportationOptions"
|
591
|
+
|
592
|
+
rate_limit(2.0).post(path, body:)
|
593
|
+
end
|
594
|
+
|
595
|
+
# Confirms all the transportation options for an inbound plan. A placement option must be confirmed prior to use
|
596
|
+
# of this API. Once confirmed, new transportation options can not be generated or confirmed for the Inbound Plan.
|
597
|
+
#
|
598
|
+
# @param [String] inbound_plan_id Identifier of an inbound plan.
|
599
|
+
# @param [Hash] body The body of the request to `confirmTransportationOptions`.
|
600
|
+
# @return [Hash] The API response
|
601
|
+
def confirm_transportation_options(inbound_plan_id, body)
|
602
|
+
path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/transportationOptions/confirmation"
|
603
|
+
|
604
|
+
rate_limit(2.0).post(path, body:)
|
605
|
+
end
|
606
|
+
|
607
|
+
# List the inbound compliance details for MSKUs in a given marketplace.
|
608
|
+
#
|
609
|
+
# @param [Array<String>] mskus List of merchant SKUs - a merchant-supplied identifier for a specific SKU.
|
610
|
+
# @param [String] marketplace_id The Marketplace ID. Refer to [Marketplace
|
611
|
+
# IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids) for a list of possible values.
|
612
|
+
# @return [Hash] The API response
|
613
|
+
def list_item_compliance_details(mskus, marketplace_id)
|
614
|
+
path = "/inbound/fba/2024-03-20/items/compliance"
|
615
|
+
params = {
|
616
|
+
"mskus" => mskus,
|
617
|
+
"marketplaceId" => marketplace_id,
|
618
|
+
}.compact
|
619
|
+
|
620
|
+
rate_limit(2.0).get(path, params:)
|
621
|
+
end
|
622
|
+
|
623
|
+
# Update compliance details for list of MSKUs. The details provided here are only used for the IN marketplace
|
624
|
+
# compliance validation.
|
625
|
+
#
|
626
|
+
# @param [String] marketplace_id The Marketplace ID. Refer to [Marketplace
|
627
|
+
# IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids) for a list of possible values.
|
628
|
+
# @param [Hash] body The body of the request to `updateItemComplianceDetails`.
|
629
|
+
# @return [Hash] The API response
|
630
|
+
def update_item_compliance_details(marketplace_id, body)
|
631
|
+
path = "/inbound/fba/2024-03-20/items/compliance"
|
632
|
+
params = {
|
633
|
+
"marketplaceId" => marketplace_id,
|
634
|
+
}.compact
|
635
|
+
|
636
|
+
rate_limit(2.0).put(path, body:, params:)
|
637
|
+
end
|
638
|
+
|
639
|
+
# For a given marketplace - creates labels for a list of mskus.
|
640
|
+
#
|
641
|
+
# @param [Hash] body The body of the request to `createMarketplaceItemLabels`.
|
642
|
+
# @return [Hash] The API response
|
643
|
+
def create_marketplace_item_labels(body)
|
644
|
+
path = "/inbound/fba/2024-03-20/items/labels"
|
645
|
+
|
646
|
+
rate_limit(2.0).post(path, body:)
|
647
|
+
end
|
648
|
+
|
649
|
+
# Gets the status of the processing of an asynchronous API call.
|
650
|
+
#
|
651
|
+
# @param [String] operation_id Identifier of an asynchronous operation.
|
652
|
+
# @return [Hash] The API response
|
653
|
+
def get_inbound_operation_status(operation_id)
|
654
|
+
path = "/inbound/fba/2024-03-20/operations/#{operation_id}"
|
655
|
+
|
656
|
+
rate_limit(2.0).get(path)
|
657
|
+
end
|
658
|
+
end
|
659
|
+
end
|
660
|
+
end
|