peddler 2.4.5 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +402 -140
  3. data/lib/peddler/api/amazon_warehousing_and_distribution_2024_05_09.rb +92 -0
  4. data/lib/peddler/api/aplus_content_2020_11_01.rb +246 -0
  5. data/lib/peddler/api/application_integrations_2024_04_01.rb +56 -0
  6. data/lib/peddler/api/application_management_2023_11_30.rb +35 -0
  7. data/lib/peddler/api/catalog_items_2020_12_01.rb +81 -0
  8. data/lib/peddler/api/catalog_items_2022_04_01.rb +93 -0
  9. data/lib/peddler/api/catalog_items_v0.rb +103 -0
  10. data/lib/peddler/api/data_kiosk_2023_11_15.rb +108 -0
  11. data/lib/peddler/api/easy_ship_2022_03_23.rb +127 -0
  12. data/lib/peddler/api/fba_inbound_eligibility_v1.rb +44 -0
  13. data/lib/peddler/api/fba_inventory_v1.rb +122 -0
  14. data/lib/peddler/api/feeds_2021_06_30.rb +122 -0
  15. data/lib/peddler/api/finances_2024_06_19.rb +50 -0
  16. data/lib/peddler/api/finances_v0.rb +148 -0
  17. data/lib/peddler/api/fulfillment_inbound_2024_03_20.rb +759 -0
  18. data/lib/peddler/api/fulfillment_inbound_v0.rb +352 -0
  19. data/lib/peddler/api/fulfillment_outbound_2020_07_01.rb +259 -0
  20. data/lib/peddler/api/invoices_2024_06_19.rb +180 -0
  21. data/lib/peddler/api/listings_items_2020_09_01.rb +95 -0
  22. data/lib/peddler/api/listings_items_2021_08_01.rb +170 -0
  23. data/lib/peddler/api/listings_restrictions_2021_08_01.rb +47 -0
  24. data/lib/peddler/api/merchant_fulfillment_v0.rb +80 -0
  25. data/lib/peddler/api/messaging_v1.rb +273 -0
  26. data/lib/peddler/api/notifications_v1.rb +145 -0
  27. data/lib/peddler/api/orders_v0.rb +279 -0
  28. data/lib/peddler/api/product_fees_v0.rb +77 -0
  29. data/lib/peddler/api/product_pricing_2022_05_01.rb +54 -0
  30. data/lib/peddler/api/product_pricing_v0.rb +162 -0
  31. data/lib/peddler/api/product_type_definitions_2020_09_01.rb +86 -0
  32. data/lib/peddler/api/replenishment_2022_11_07.rb +57 -0
  33. data/lib/peddler/api/reports_2021_06_30.rb +163 -0
  34. data/lib/peddler/api/sales_v1.rb +77 -0
  35. data/lib/peddler/api/sellers_v1.rb +45 -0
  36. data/lib/peddler/api/services_v1.rb +348 -0
  37. data/lib/peddler/api/shipment_invoicing_v0.rb +59 -0
  38. data/lib/peddler/api/shipping_v1.rb +132 -0
  39. data/lib/peddler/api/shipping_v2.rb +319 -0
  40. data/lib/peddler/api/solicitations_v1.rb +63 -0
  41. data/lib/peddler/api/supply_sources_2020_07_01.rb +100 -0
  42. data/lib/peddler/api/tokens_2021_03_01.rb +38 -0
  43. data/lib/peddler/api/uploads_2020_11_01.rb +50 -0
  44. data/lib/peddler/api/vendor_direct_fulfillment_inventory_v1.rb +32 -0
  45. data/lib/peddler/api/vendor_direct_fulfillment_orders_2021_12_28.rb +84 -0
  46. data/lib/peddler/api/vendor_direct_fulfillment_orders_v1.rb +84 -0
  47. data/lib/peddler/api/vendor_direct_fulfillment_payments_v1.rb +31 -0
  48. data/lib/peddler/api/vendor_direct_fulfillment_sandbox_test_data_2021_10_28.rb +45 -0
  49. data/lib/peddler/api/vendor_direct_fulfillment_shipping_2021_12_28.rb +203 -0
  50. data/lib/peddler/api/vendor_direct_fulfillment_shipping_v1.rb +189 -0
  51. data/lib/peddler/api/vendor_direct_fulfillment_transactions_2021_12_28.rb +32 -0
  52. data/lib/peddler/api/vendor_direct_fulfillment_transactions_v1.rb +32 -0
  53. data/lib/peddler/api/vendor_invoices_v1.rb +30 -0
  54. data/lib/peddler/api/vendor_orders_v1.rb +159 -0
  55. data/lib/peddler/api/vendor_shipments_v1.rb +132 -0
  56. data/lib/peddler/api/vendor_transaction_status_v1.rb +33 -0
  57. data/lib/peddler/api.rb +138 -0
  58. data/lib/peddler/endpoint.rb +51 -0
  59. data/lib/peddler/error.rb +31 -0
  60. data/lib/peddler/marketplace.rb +38 -68
  61. data/lib/peddler/token.rb +70 -0
  62. data/lib/peddler/version.rb +1 -1
  63. data/lib/peddler.rb +56 -1
  64. metadata +74 -80
  65. data/lib/mws/easy_ship/client.rb +0 -93
  66. data/lib/mws/easy_ship.rb +0 -3
  67. data/lib/mws/feeds/client.rb +0 -122
  68. data/lib/mws/feeds.rb +0 -3
  69. data/lib/mws/finances/client.rb +0 -82
  70. data/lib/mws/finances.rb +0 -3
  71. data/lib/mws/fulfillment_inbound_shipment/client.rb +0 -388
  72. data/lib/mws/fulfillment_inbound_shipment.rb +0 -3
  73. data/lib/mws/fulfillment_inventory/client.rb +0 -57
  74. data/lib/mws/fulfillment_inventory.rb +0 -3
  75. data/lib/mws/fulfillment_outbound_shipment/client.rb +0 -211
  76. data/lib/mws/fulfillment_outbound_shipment.rb +0 -3
  77. data/lib/mws/merchant_fulfillment/client.rb +0 -87
  78. data/lib/mws/merchant_fulfillment.rb +0 -3
  79. data/lib/mws/off_amazon_payments.rb +0 -3
  80. data/lib/mws/orders/client.rb +0 -120
  81. data/lib/mws/orders.rb +0 -3
  82. data/lib/mws/products/client.rb +0 -268
  83. data/lib/mws/products.rb +0 -3
  84. data/lib/mws/recommendations/client.rb +0 -72
  85. data/lib/mws/recommendations.rb +0 -3
  86. data/lib/mws/reports/client.rb +0 -236
  87. data/lib/mws/reports.rb +0 -3
  88. data/lib/mws/sellers/client.rb +0 -44
  89. data/lib/mws/sellers.rb +0 -3
  90. data/lib/mws/shipment_invoicing/client.rb +0 -74
  91. data/lib/mws/shipment_invoicing.rb +0 -3
  92. data/lib/mws/subscriptions/client.rb +0 -179
  93. data/lib/mws/subscriptions.rb +0 -3
  94. data/lib/mws.rb +0 -29
  95. data/lib/peddler/client.rb +0 -159
  96. data/lib/peddler/errors/builder.rb +0 -64
  97. data/lib/peddler/errors/class_generator.rb +0 -40
  98. data/lib/peddler/errors/error.rb +0 -45
  99. data/lib/peddler/errors/parser.rb +0 -28
  100. data/lib/peddler/flat_file_parser.rb +0 -56
  101. data/lib/peddler/headers.rb +0 -102
  102. data/lib/peddler/operation.rb +0 -78
  103. data/lib/peddler/parser.rb +0 -33
  104. data/lib/peddler/structured_list.rb +0 -23
  105. data/lib/peddler/vcr_matcher.rb +0 -97
  106. data/lib/peddler/xml_parser.rb +0 -38
  107. data/lib/peddler/xml_response_parser.rb +0 -25
@@ -0,0 +1,352 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "peddler/api"
4
+
5
+ module Peddler
6
+ class << self
7
+ def fulfillment_inbound_v0(...)
8
+ API::FulfillmentInboundV0.new(...)
9
+ end
10
+ end
11
+
12
+ class API
13
+ # Selling Partner API for Fulfillment Inbound
14
+ #
15
+ # The Selling Partner API for Fulfillment Inbound lets you create applications that create and update inbound
16
+ # shipments of inventory to Amazon's fulfillment network.
17
+ class FulfillmentInboundV0 < API
18
+ # Returns one or more inbound shipment plans, which provide the information you need to create one or more inbound
19
+ # shipments for a set of items that you specify. Multiple inbound shipment plans might be required so that items
20
+ # can be optimally placed in Amazon's fulfillment network—for example, positioning inventory closer to the
21
+ # customer. Alternatively, two inbound shipment plans might be created with the same Amazon fulfillment center
22
+ # destination if the two shipment plans require different processing—for example, items that require labels must
23
+ # be shipped separately from stickerless, commingled inventory.
24
+ #
25
+ # @note This operation can make a static sandbox call.
26
+ # @param body [Hash] The request schema for the CreateInboundShipmentPlanRequest operation.
27
+ # @param rate_limit [Float] Requests per second
28
+ # @return [Hash] The API response
29
+ def create_inbound_shipment_plan(body, rate_limit: 2.0)
30
+ path = "/fba/inbound/v0/plans"
31
+
32
+ meter(rate_limit).post(path, body:)
33
+ end
34
+
35
+ # Returns a new inbound shipment based on the specified shipmentId that was returned by the
36
+ # createInboundShipmentPlan operation.
37
+ #
38
+ # @note This operation can make a static sandbox call.
39
+ # @param body [Hash] The request schema for the InboundShipmentRequest operation.
40
+ # @param shipment_id [String] A shipment identifier originally returned by the createInboundShipmentPlan
41
+ # operation.
42
+ # @param rate_limit [Float] Requests per second
43
+ # @return [Hash] The API response
44
+ def create_inbound_shipment(body, shipment_id, rate_limit: 2.0)
45
+ path = "/fba/inbound/v0/shipments/#{shipment_id}"
46
+
47
+ meter(rate_limit).post(path, body:)
48
+ end
49
+
50
+ # Updates or removes items from the inbound shipment identified by the specified shipment identifier. Adding new
51
+ # items is not supported.
52
+ #
53
+ # @note This operation can make a static sandbox call.
54
+ # @param body [Hash] The request schema for the InboundShipmentRequest operation.
55
+ # @param shipment_id [String] A shipment identifier originally returned by the createInboundShipmentPlan
56
+ # operation.
57
+ # @param rate_limit [Float] Requests per second
58
+ # @return [Hash] The API response
59
+ def update_inbound_shipment(body, shipment_id, rate_limit: 2.0)
60
+ path = "/fba/inbound/v0/shipments/#{shipment_id}"
61
+
62
+ meter(rate_limit).put(path, body:)
63
+ end
64
+
65
+ # Returns pre-order information, including dates, that a seller needs before confirming a shipment for pre-order.
66
+ #
67
+ # @note This operation can make a static sandbox call.
68
+ # @param shipment_id [String] A shipment identifier originally returned by the createInboundShipmentPlan
69
+ # operation.
70
+ # @param marketplace_id [String] A marketplace identifier. Specifies the marketplace the shipment is tied to.
71
+ # @param rate_limit [Float] Requests per second
72
+ # @return [Hash] The API response
73
+ def get_preorder_info(shipment_id, marketplace_id, rate_limit: 2.0)
74
+ path = "/fba/inbound/v0/shipments/#{shipment_id}/preorder"
75
+ params = {
76
+ "MarketplaceId" => marketplace_id,
77
+ }.compact
78
+
79
+ meter(rate_limit).get(path, params:)
80
+ end
81
+
82
+ # Returns information needed to confirm a shipment for pre-order. Call this operation after calling the
83
+ # getPreorderInfo operation to get the NeedByDate value and other pre-order information about the shipment.
84
+ #
85
+ # @note This operation can make a static sandbox call.
86
+ # @param shipment_id [String] A shipment identifier originally returned by the createInboundShipmentPlan
87
+ # operation.
88
+ # @param need_by_date [String] Date that the shipment must arrive at the Amazon fulfillment center to avoid
89
+ # delivery promise breaks for pre-ordered items. Must be in YYYY-MM-DD format. The response to the
90
+ # getPreorderInfo operation returns this value.
91
+ # @param marketplace_id [String] A marketplace identifier. Specifies the marketplace the shipment is tied to.
92
+ # @param rate_limit [Float] Requests per second
93
+ # @return [Hash] The API response
94
+ def confirm_preorder(shipment_id, need_by_date, marketplace_id, rate_limit: 2.0)
95
+ path = "/fba/inbound/v0/shipments/#{shipment_id}/preorder/confirm"
96
+ params = {
97
+ "NeedByDate" => need_by_date,
98
+ "MarketplaceId" => marketplace_id,
99
+ }.compact
100
+
101
+ meter(rate_limit).put(path, params:)
102
+ end
103
+
104
+ # Returns labeling requirements and item preparation instructions to help prepare items for shipment to Amazon's
105
+ # fulfillment network.
106
+ #
107
+ # @note This operation can make a static sandbox call.
108
+ # @param ship_to_country_code [String] The country code of the country to which the items will be shipped. Note
109
+ # that labeling requirements and item preparation instructions can vary by country.
110
+ # @param seller_sku_list [Array<String>] A list of SellerSKU values. Used to identify items for which you want
111
+ # labeling requirements and item preparation instructions for shipment to Amazon's fulfillment network. The
112
+ # SellerSKU is qualified by the Seller ID, which is included with every call to the Seller Partner API. Note:
113
+ # Include seller SKUs that you have used to list items on Amazon's retail website. If you include a seller SKU
114
+ # that you have never used to list an item on Amazon's retail website, the seller SKU is returned in the
115
+ # InvalidSKUList property in the response.
116
+ # @param asin_list [Array<String>] A list of ASIN values. Used to identify items for which you want item
117
+ # preparation instructions to help with item sourcing decisions. Note: ASINs must be included in the product
118
+ # catalog for at least one of the marketplaces that the seller participates in. Any ASIN that is not included in
119
+ # the product catalog for at least one of the marketplaces that the seller participates in is returned in the
120
+ # InvalidASINList property in the response. You can find out which marketplaces a seller participates in by
121
+ # calling the getMarketplaceParticipations operation in the Selling Partner API for Sellers.
122
+ # @param rate_limit [Float] Requests per second
123
+ # @return [Hash] The API response
124
+ def get_prep_instructions(ship_to_country_code, seller_sku_list: nil, asin_list: nil, rate_limit: 2.0)
125
+ path = "/fba/inbound/v0/prepInstructions"
126
+ params = {
127
+ "ShipToCountryCode" => ship_to_country_code,
128
+ "SellerSKUList" => seller_sku_list,
129
+ "ASINList" => asin_list,
130
+ }.compact
131
+
132
+ meter(rate_limit).get(path, params:)
133
+ end
134
+
135
+ # Returns current transportation information about an inbound shipment.
136
+ #
137
+ # @note This operation can make a static sandbox call.
138
+ # @param shipment_id [String] A shipment identifier originally returned by the createInboundShipmentPlan
139
+ # operation.
140
+ # @param rate_limit [Float] Requests per second
141
+ # @return [Hash] The API response
142
+ def get_transport_details(shipment_id, rate_limit: 2.0)
143
+ path = "/fba/inbound/v0/shipments/#{shipment_id}/transport"
144
+
145
+ meter(rate_limit).get(path)
146
+ end
147
+
148
+ # Sends transportation information to Amazon about an inbound shipment.
149
+ #
150
+ # @note This operation can make a static sandbox call.
151
+ # @param shipment_id [String] A shipment identifier originally returned by the createInboundShipmentPlan
152
+ # operation.
153
+ # @param body [Hash] The request schema for the PutTransportDetailsRequest operation.
154
+ # @param rate_limit [Float] Requests per second
155
+ # @return [Hash] The API response
156
+ def put_transport_details(shipment_id, body, rate_limit: 2.0)
157
+ path = "/fba/inbound/v0/shipments/#{shipment_id}/transport"
158
+
159
+ meter(rate_limit).put(path, body:)
160
+ end
161
+
162
+ # Cancels a previously-confirmed request to ship an inbound shipment using an Amazon-partnered carrier. To be
163
+ # successful, you must call this operation before the VoidDeadline date that is returned by the
164
+ # getTransportDetails operation. Important: The VoidDeadline date is 24 hours after you confirm a Small Parcel
165
+ # shipment transportation request or one hour after you confirm a Less Than Truckload/Full Truckload (LTL/FTL)
166
+ # shipment transportation request. After the void deadline passes, your account will be charged for the shipping
167
+ # cost.
168
+ #
169
+ # @note This operation can make a static sandbox call.
170
+ # @param shipment_id [String] A shipment identifier originally returned by the createInboundShipmentPlan
171
+ # operation.
172
+ # @param rate_limit [Float] Requests per second
173
+ # @return [Hash] The API response
174
+ def void_transport(shipment_id, rate_limit: 2.0)
175
+ path = "/fba/inbound/v0/shipments/#{shipment_id}/transport/void"
176
+
177
+ meter(rate_limit).post(path)
178
+ end
179
+
180
+ # Initiates the process of estimating the shipping cost for an inbound shipment by an Amazon-partnered carrier.
181
+ # Prior to calling the estimateTransport operation, you must call the putTransportDetails operation to provide
182
+ # Amazon with the transportation information for the inbound shipment.
183
+ #
184
+ # @note This operation can make a static sandbox call.
185
+ # @param shipment_id [String] A shipment identifier originally returned by the createInboundShipmentPlan
186
+ # operation.
187
+ # @param rate_limit [Float] Requests per second
188
+ # @return [Hash] The API response
189
+ def estimate_transport(shipment_id, rate_limit: 2.0)
190
+ path = "/fba/inbound/v0/shipments/#{shipment_id}/transport/estimate"
191
+
192
+ meter(rate_limit).post(path)
193
+ end
194
+
195
+ # Confirms that the seller accepts the Amazon-partnered shipping estimate, agrees to allow Amazon to charge their
196
+ # account for the shipping cost, and requests that the Amazon-partnered carrier ship the inbound shipment. Prior
197
+ # to calling the confirmTransport operation, you should call the getTransportDetails operation to get the
198
+ # Amazon-partnered shipping estimate. Important: After confirming the transportation request, if the seller
199
+ # decides that they do not want the Amazon-partnered carrier to ship the inbound shipment, you can call the
200
+ # voidTransport operation to cancel the transportation request. Note that for a Small Parcel shipment, the seller
201
+ # has 24 hours after confirming a transportation request to void the transportation request. For a Less Than
202
+ # Truckload/Full Truckload (LTL/FTL) shipment, the seller has one hour after confirming a transportation request
203
+ # to void it. After the grace period has expired the seller's account will be charged for the shipping cost.
204
+ #
205
+ # @note This operation can make a static sandbox call.
206
+ # @param shipment_id [String] A shipment identifier originally returned by the createInboundShipmentPlan
207
+ # operation.
208
+ # @param rate_limit [Float] Requests per second
209
+ # @return [Hash] The API response
210
+ def confirm_transport(shipment_id, rate_limit: 2.0)
211
+ path = "/fba/inbound/v0/shipments/#{shipment_id}/transport/confirm"
212
+
213
+ meter(rate_limit).post(path)
214
+ end
215
+
216
+ # Returns package/pallet labels for faster and more accurate shipment processing at the Amazon fulfillment center.
217
+ #
218
+ # @note This operation can make a static sandbox call.
219
+ # @param shipment_id [String] A shipment identifier originally returned by the createInboundShipmentPlan
220
+ # operation.
221
+ # @param page_type [String] The page type to use to print the labels. Submitting a PageType value that is not
222
+ # supported in your marketplace returns an error.
223
+ # @param label_type [String] The type of labels requested.
224
+ # @param number_of_packages [Integer] The number of packages in the shipment.
225
+ # @param package_labels_to_print [Array<String>] A list of identifiers that specify packages for which you want
226
+ # package labels printed. Must match CartonId values previously passed using the FBA Inbound Shipment Carton
227
+ # Information Feed. If not, the operation returns the IncorrectPackageIdentifier error code.
228
+ # @param number_of_pallets [Integer] The number of pallets in the shipment. This returns four identical labels for
229
+ # each pallet.
230
+ # @param page_size [Integer] The page size for paginating through the total packages' labels. This is a required
231
+ # parameter for Non-Partnered LTL Shipments. Max value:1000.
232
+ # @param page_start_index [Integer] The page start index for paginating through the total packages' labels. This
233
+ # is a required parameter for Non-Partnered LTL Shipments.
234
+ # @param rate_limit [Float] Requests per second
235
+ # @return [Hash] The API response
236
+ def get_labels(shipment_id, page_type, label_type, number_of_packages: nil, package_labels_to_print: nil,
237
+ number_of_pallets: nil, page_size: nil, page_start_index: nil, rate_limit: 2.0)
238
+ path = "/fba/inbound/v0/shipments/#{shipment_id}/labels"
239
+ params = {
240
+ "PageType" => page_type,
241
+ "LabelType" => label_type,
242
+ "NumberOfPackages" => number_of_packages,
243
+ "PackageLabelsToPrint" => package_labels_to_print,
244
+ "NumberOfPallets" => number_of_pallets,
245
+ "PageSize" => page_size,
246
+ "PageStartIndex" => page_start_index,
247
+ }.compact
248
+
249
+ meter(rate_limit).get(path, params:)
250
+ end
251
+
252
+ # Returns a bill of lading for a Less Than Truckload/Full Truckload (LTL/FTL) shipment. The getBillOfLading
253
+ # operation returns PDF document data for printing a bill of lading for an Amazon-partnered Less Than
254
+ # Truckload/Full Truckload (LTL/FTL) inbound shipment.
255
+ #
256
+ # @note This operation can make a static sandbox call.
257
+ # @param shipment_id [String] A shipment identifier originally returned by the createInboundShipmentPlan
258
+ # operation.
259
+ # @param rate_limit [Float] Requests per second
260
+ # @return [Hash] The API response
261
+ def get_bill_of_lading(shipment_id, rate_limit: 2.0)
262
+ path = "/fba/inbound/v0/shipments/#{shipment_id}/billOfLading"
263
+
264
+ meter(rate_limit).get(path)
265
+ end
266
+
267
+ # Returns a list of inbound shipments based on criteria that you specify.
268
+ #
269
+ # @note This operation can make a static sandbox call.
270
+ # @param shipment_status_list [Array<String>] A list of ShipmentStatus values. Used to select shipments with a
271
+ # current status that matches the status values that you specify.
272
+ # @param shipment_id_list [Array<String>] A list of shipment IDs used to select the shipments that you want. If
273
+ # both ShipmentStatusList and ShipmentIdList are specified, only shipments that match both parameters are
274
+ # returned.
275
+ # @param last_updated_after [String] A date used for selecting inbound shipments that were last updated after (or
276
+ # at) a specified time. The selection includes updates made by Amazon and by the seller.
277
+ # @param last_updated_before [String] A date used for selecting inbound shipments that were last updated before
278
+ # (or at) a specified time. The selection includes updates made by Amazon and by the seller.
279
+ # @param query_type [String] Indicates whether shipments are returned using shipment information (by providing the
280
+ # ShipmentStatusList or ShipmentIdList parameters), using a date range (by providing the LastUpdatedAfter and
281
+ # LastUpdatedBefore parameters), or by using NextToken to continue returning items specified in a previous
282
+ # request.
283
+ # @param next_token [String] A string token returned in the response to your previous request.
284
+ # @param marketplace_id [String] A marketplace identifier. Specifies the marketplace where the product would be
285
+ # stored.
286
+ # @param rate_limit [Float] Requests per second
287
+ # @return [Hash] The API response
288
+ def get_shipments(query_type, marketplace_id, shipment_status_list: nil, shipment_id_list: nil,
289
+ last_updated_after: nil, last_updated_before: nil, next_token: nil, rate_limit: 2.0)
290
+ path = "/fba/inbound/v0/shipments"
291
+ params = {
292
+ "ShipmentStatusList" => shipment_status_list,
293
+ "ShipmentIdList" => shipment_id_list,
294
+ "LastUpdatedAfter" => last_updated_after,
295
+ "LastUpdatedBefore" => last_updated_before,
296
+ "QueryType" => query_type,
297
+ "NextToken" => next_token,
298
+ "MarketplaceId" => marketplace_id,
299
+ }.compact
300
+
301
+ meter(rate_limit).get(path, params:)
302
+ end
303
+
304
+ # Returns a list of items in a specified inbound shipment.
305
+ #
306
+ # @note This operation can make a static sandbox call.
307
+ # @param shipment_id [String] A shipment identifier used for selecting items in a specific inbound shipment.
308
+ # @param marketplace_id [String] A marketplace identifier. Specifies the marketplace where the product would be
309
+ # stored.
310
+ # @param rate_limit [Float] Requests per second
311
+ # @return [Hash] The API response
312
+ def get_shipment_items_by_shipment_id(shipment_id, marketplace_id, rate_limit: 2.0)
313
+ path = "/fba/inbound/v0/shipments/#{shipment_id}/items"
314
+ params = {
315
+ "MarketplaceId" => marketplace_id,
316
+ }.compact
317
+
318
+ meter(rate_limit).get(path, params:)
319
+ end
320
+
321
+ # Returns a list of items in a specified inbound shipment, or a list of items that were updated within a specified
322
+ # time frame.
323
+ #
324
+ # @note This operation can make a static sandbox call.
325
+ # @param last_updated_after [String] A date used for selecting inbound shipment items that were last updated after
326
+ # (or at) a specified time. The selection includes updates made by Amazon and by the seller.
327
+ # @param last_updated_before [String] A date used for selecting inbound shipment items that were last updated
328
+ # before (or at) a specified time. The selection includes updates made by Amazon and by the seller.
329
+ # @param query_type [String] Indicates whether items are returned using a date range (by providing the
330
+ # LastUpdatedAfter and LastUpdatedBefore parameters), or using NextToken, which continues returning items
331
+ # specified in a previous request.
332
+ # @param next_token [String] A string token returned in the response to your previous request.
333
+ # @param marketplace_id [String] A marketplace identifier. Specifies the marketplace where the product would be
334
+ # stored.
335
+ # @param rate_limit [Float] Requests per second
336
+ # @return [Hash] The API response
337
+ def get_shipment_items(query_type, marketplace_id, last_updated_after: nil, last_updated_before: nil,
338
+ next_token: nil, rate_limit: 2.0)
339
+ path = "/fba/inbound/v0/shipmentItems"
340
+ params = {
341
+ "LastUpdatedAfter" => last_updated_after,
342
+ "LastUpdatedBefore" => last_updated_before,
343
+ "QueryType" => query_type,
344
+ "NextToken" => next_token,
345
+ "MarketplaceId" => marketplace_id,
346
+ }.compact
347
+
348
+ meter(rate_limit).get(path, params:)
349
+ end
350
+ end
351
+ end
352
+ end
@@ -0,0 +1,259 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "peddler/api"
4
+
5
+ module Peddler
6
+ class << self
7
+ def fulfillment_outbound_2020_07_01(...)
8
+ API::FulfillmentOutbound20200701.new(...)
9
+ end
10
+ end
11
+
12
+ class API
13
+ # Selling Partner APIs for Fulfillment Outbound
14
+ #
15
+ # The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill
16
+ # Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on
17
+ # both potential and existing fulfillment orders.
18
+ class FulfillmentOutbound20200701 < API
19
+ # Returns a list of fulfillment order previews based on shipping criteria that you specify.
20
+ #
21
+ # @note This operation can make a dynamic sandbox call.
22
+ # @param body [Hash] GetFulfillmentPreviewRequest parameter
23
+ # @param rate_limit [Float] Requests per second
24
+ # @return [Hash] The API response
25
+ def get_fulfillment_preview(body, rate_limit: 2.0)
26
+ path = "/fba/outbound/2020-07-01/fulfillmentOrders/preview"
27
+
28
+ meter(rate_limit).post(path, body:)
29
+ end
30
+
31
+ # Returns delivery options that include an estimated delivery date and offer expiration, based on criteria that
32
+ # you specify.
33
+ #
34
+ # @note This operation can make a dynamic sandbox call.
35
+ # @param body [Hash] GetDeliveryOffersRequest parameter
36
+ # @param rate_limit [Float] Requests per second
37
+ # @return [Hash] The API response
38
+ def delivery_offers(body, rate_limit: 5.0)
39
+ path = "/fba/outbound/2020-07-01/deliveryOffers"
40
+
41
+ meter(rate_limit).post(path, body:)
42
+ end
43
+
44
+ # Returns a list of fulfillment orders fulfilled after (or at) a specified date-time, or indicated by the next
45
+ # token parameter.
46
+ #
47
+ # @note This operation can make a dynamic sandbox call.
48
+ # @param query_start_date [String] A date used to select fulfillment orders that were last updated after (or at) a
49
+ # specified time. An update is defined as any change in fulfillment order status, including the creation of a
50
+ # new fulfillment order.
51
+ # @param next_token [String] A string token returned in the response to your previous request.
52
+ # @param rate_limit [Float] Requests per second
53
+ # @return [Hash] The API response
54
+ def list_all_fulfillment_orders(query_start_date: nil, next_token: nil, rate_limit: 2.0)
55
+ path = "/fba/outbound/2020-07-01/fulfillmentOrders"
56
+ params = {
57
+ "queryStartDate" => query_start_date,
58
+ "nextToken" => next_token,
59
+ }.compact
60
+
61
+ meter(rate_limit).get(path, params:)
62
+ end
63
+
64
+ # Requests that Amazon ship items from the seller's inventory in Amazon's fulfillment network to a destination
65
+ # address.
66
+ #
67
+ # @note This operation can make a dynamic sandbox call.
68
+ # @param body [Hash] CreateFulfillmentOrderRequest parameter
69
+ # @param rate_limit [Float] Requests per second
70
+ # @return [Hash] The API response
71
+ def create_fulfillment_order(body, rate_limit: 2.0)
72
+ path = "/fba/outbound/2020-07-01/fulfillmentOrders"
73
+
74
+ meter(rate_limit).post(path, body:)
75
+ end
76
+
77
+ # Returns delivery tracking information for a package in an outbound shipment for a Multi-Channel Fulfillment
78
+ # order.
79
+ #
80
+ # @note This operation can make a dynamic sandbox call.
81
+ # @param package_number [Integer] The unencrypted package identifier returned by the `getFulfillmentOrder`
82
+ # operation.
83
+ # @param rate_limit [Float] Requests per second
84
+ # @return [Hash] The API response
85
+ def get_package_tracking_details(package_number, rate_limit: 2.0)
86
+ path = "/fba/outbound/2020-07-01/tracking"
87
+ params = {
88
+ "packageNumber" => package_number,
89
+ }.compact
90
+
91
+ meter(rate_limit).get(path, params:)
92
+ end
93
+
94
+ # Returns a list of return reason codes for a seller SKU in a given marketplace. The parameters for this operation
95
+ # may contain special characters that require URL encoding. To avoid errors with SKUs when encoding URLs, refer to
96
+ # [URL Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding).
97
+ #
98
+ # @note This operation can make a dynamic sandbox call.
99
+ # @param seller_sku [String] The seller SKU for which return reason codes are required.
100
+ # @param marketplace_id [String] The marketplace for which the seller wants return reason codes.
101
+ # @param seller_fulfillment_order_id [String] The identifier assigned to the item by the seller when the
102
+ # fulfillment order was created. The service uses this value to determine the marketplace for which the seller
103
+ # wants return reason codes.
104
+ # @param language [String] The language that the `TranslatedDescription` property of the `ReasonCodeDetails`
105
+ # response object should be translated into.
106
+ # @param rate_limit [Float] Requests per second
107
+ # @return [Hash] The API response
108
+ def list_return_reason_codes(seller_sku, marketplace_id: nil, seller_fulfillment_order_id: nil, language: nil,
109
+ rate_limit: 2.0)
110
+ path = "/fba/outbound/2020-07-01/returnReasonCodes"
111
+ params = {
112
+ "sellerSku" => seller_sku,
113
+ "marketplaceId" => marketplace_id,
114
+ "sellerFulfillmentOrderId" => seller_fulfillment_order_id,
115
+ "language" => language,
116
+ }.compact
117
+
118
+ meter(rate_limit).get(path, params:)
119
+ end
120
+
121
+ # Creates a fulfillment return.
122
+ #
123
+ # @note This operation can make a dynamic sandbox call.
124
+ # @param body [Hash] CreateFulfillmentReturnRequest parameter
125
+ # @param seller_fulfillment_order_id [String] An identifier assigned by the seller to the fulfillment order at the
126
+ # time it was created. The seller uses their own records to find the correct `SellerFulfillmentOrderId` value
127
+ # based on the buyer's request to return items.
128
+ # @param rate_limit [Float] Requests per second
129
+ # @return [Hash] The API response
130
+ def create_fulfillment_return(body, seller_fulfillment_order_id, rate_limit: 2.0)
131
+ path = "/fba/outbound/2020-07-01/fulfillmentOrders/#{seller_fulfillment_order_id}/return"
132
+
133
+ meter(rate_limit).put(path, body:)
134
+ end
135
+
136
+ # Returns the fulfillment order indicated by the specified order identifier.
137
+ #
138
+ # @note This operation can make a dynamic sandbox call.
139
+ # @param seller_fulfillment_order_id [String] The identifier assigned to the item by the seller when the
140
+ # fulfillment order was created.
141
+ # @param rate_limit [Float] Requests per second
142
+ # @return [Hash] The API response
143
+ def get_fulfillment_order(seller_fulfillment_order_id, rate_limit: 2.0)
144
+ path = "/fba/outbound/2020-07-01/fulfillmentOrders/#{seller_fulfillment_order_id}"
145
+
146
+ meter(rate_limit).get(path)
147
+ end
148
+
149
+ # Updates and/or requests shipment for a fulfillment order with an order hold on it.
150
+ #
151
+ # @note This operation can make a dynamic sandbox call.
152
+ # @param body [Hash] UpdateFulfillmentOrderRequest parameter
153
+ # @param seller_fulfillment_order_id [String] The identifier assigned to the item by the seller when the
154
+ # fulfillment order was created.
155
+ # @param rate_limit [Float] Requests per second
156
+ # @return [Hash] The API response
157
+ def update_fulfillment_order(body, seller_fulfillment_order_id, rate_limit: 2.0)
158
+ path = "/fba/outbound/2020-07-01/fulfillmentOrders/#{seller_fulfillment_order_id}"
159
+
160
+ meter(rate_limit).put(path, body:)
161
+ end
162
+
163
+ # Requests that Amazon stop attempting to fulfill the fulfillment order indicated by the specified order
164
+ # identifier.
165
+ #
166
+ # @note This operation can make a dynamic sandbox call.
167
+ # @param seller_fulfillment_order_id [String] The identifier assigned to the item by the seller when the
168
+ # fulfillment order was created.
169
+ # @param rate_limit [Float] Requests per second
170
+ # @return [Hash] The API response
171
+ def cancel_fulfillment_order(seller_fulfillment_order_id, rate_limit: 2.0)
172
+ path = "/fba/outbound/2020-07-01/fulfillmentOrders/#{seller_fulfillment_order_id}/cancel"
173
+
174
+ meter(rate_limit).put(path)
175
+ end
176
+
177
+ # Requests that Amazon update the status of an order in the sandbox testing environment. This is a sandbox-only
178
+ # operation and must be directed to a sandbox endpoint. Refer to [Fulfillment Outbound Dynamic Sandbox
179
+ # Guide](https://developer-docs.amazon.com/sp-api/docs/fulfillment-outbound-dynamic-sandbox-guide) and [Selling
180
+ # Partner API sandbox](https://developer-docs.amazon.com/sp-api/docs/the-selling-partner-api-sandbox) for more
181
+ # information.
182
+ #
183
+ # @note This operation can make a dynamic sandbox call.
184
+ # @param seller_fulfillment_order_id [String] The identifier assigned to the item by the seller when the
185
+ # fulfillment order was created.
186
+ # @param body [Hash] The identifier assigned to the item by the seller when the fulfillment order was created.
187
+ # @param rate_limit [Float] Requests per second
188
+ # @return [Hash] The API response
189
+ def submit_fulfillment_order_status_update(seller_fulfillment_order_id, body, rate_limit: nil)
190
+ must_sandbox!
191
+
192
+ path = "/fba/outbound/2020-07-01/fulfillmentOrders/#{seller_fulfillment_order_id}/status"
193
+
194
+ put(path, body:)
195
+ end
196
+
197
+ # Returns a list of features available for Multi-Channel Fulfillment orders in the marketplace you specify, and
198
+ # whether the seller for which you made the call is enrolled for each feature.
199
+ #
200
+ # @note This operation can make a dynamic sandbox call.
201
+ # @param marketplace_id [String] The marketplace for which to return the list of features.
202
+ # @param rate_limit [Float] Requests per second
203
+ # @return [Hash] The API response
204
+ def get_features(marketplace_id, rate_limit: 2.0)
205
+ path = "/fba/outbound/2020-07-01/features"
206
+ params = {
207
+ "marketplaceId" => marketplace_id,
208
+ }.compact
209
+
210
+ meter(rate_limit).get(path, params:)
211
+ end
212
+
213
+ # Returns a list of inventory items that are eligible for the fulfillment feature you specify.
214
+ #
215
+ # @note This operation can make a dynamic sandbox call.
216
+ # @param marketplace_id [String] The marketplace for which to return a list of the inventory that is eligible for
217
+ # the specified feature.
218
+ # @param feature_name [String] The name of the feature for which to return a list of eligible inventory.
219
+ # @param next_token [String] A string token returned in the response to your previous request that is used to
220
+ # return the next response page. A value of null will return the first page.
221
+ # @param query_start_date [String] A date that you can use to select inventory that has been updated since a
222
+ # specified date. An update is defined as any change in feature-enabled inventory availability. The date must be
223
+ # in the format yyyy-MM-ddTHH:mm:ss.sssZ
224
+ # @param rate_limit [Float] Requests per second
225
+ # @return [Hash] The API response
226
+ def get_feature_inventory(marketplace_id, feature_name, next_token: nil, query_start_date: nil, rate_limit: 2.0)
227
+ path = "/fba/outbound/2020-07-01/features/inventory/#{feature_name}"
228
+ params = {
229
+ "marketplaceId" => marketplace_id,
230
+ "nextToken" => next_token,
231
+ "queryStartDate" => query_start_date,
232
+ }.compact
233
+
234
+ meter(rate_limit).get(path, params:)
235
+ end
236
+
237
+ # Returns the number of items with the sellerSKU you specify that can have orders fulfilled using the specified
238
+ # feature. Note that if the sellerSKU isn't eligible, the response will contain an empty skuInfo object. The
239
+ # parameters for this operation may contain special characters that require URL encoding. To avoid errors with
240
+ # SKUs when encoding URLs, refer to [URL Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding).
241
+ #
242
+ # @note This operation can make a dynamic sandbox call.
243
+ # @param marketplace_id [String] The marketplace for which to return the count.
244
+ # @param feature_name [String] The name of the feature.
245
+ # @param seller_sku [String] Used to identify an item in the given marketplace. `SellerSKU` is qualified by the
246
+ # seller's `SellerId`, which is included with every operation that you submit.
247
+ # @param rate_limit [Float] Requests per second
248
+ # @return [Hash] The API response
249
+ def get_feature_sku(marketplace_id, feature_name, seller_sku, rate_limit: 2.0)
250
+ path = "/fba/outbound/2020-07-01/features/inventory/#{feature_name}/#{seller_sku}"
251
+ params = {
252
+ "marketplaceId" => marketplace_id,
253
+ }.compact
254
+
255
+ meter(rate_limit).get(path, params:)
256
+ end
257
+ end
258
+ end
259
+ end