peddler 4.0.1 → 4.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +15 -4
  3. data/lib/peddler/api.rb +13 -4
  4. data/lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09.rb +119 -2
  5. data/lib/peddler/apis/aplus_content_2020_11_01.rb +59 -49
  6. data/lib/peddler/apis/catalog_items_2022_04_01.rb +34 -33
  7. data/lib/peddler/apis/catalog_items_v0.rb +2 -4
  8. data/lib/peddler/apis/easy_ship_2022_03_23.rb +19 -18
  9. data/lib/peddler/apis/fba_inventory_v1.rb +3 -6
  10. data/lib/peddler/apis/feeds_2021_06_30.rb +1 -1
  11. data/lib/peddler/apis/finances_2024_06_01.rb +53 -0
  12. data/lib/peddler/apis/finances_2024_06_19.rb +14 -17
  13. data/lib/peddler/apis/fulfillment_inbound_2024_03_20.rb +10 -5
  14. data/lib/peddler/apis/fulfillment_inbound_v0.rb +2 -170
  15. data/lib/peddler/apis/fulfillment_outbound_2020_07_01.rb +1 -2
  16. data/lib/peddler/apis/listings_items_2021_08_01.rb +77 -5
  17. data/lib/peddler/apis/messaging_v1.rb +51 -51
  18. data/lib/peddler/apis/orders_v0.rb +1 -1
  19. data/lib/peddler/apis/product_pricing_v0.rb +3 -2
  20. data/lib/peddler/apis/reports_2021_06_30.rb +1 -1
  21. data/lib/peddler/apis/sellers_v1.rb +1 -1
  22. data/lib/peddler/apis/shipping_v1.rb +12 -12
  23. data/lib/peddler/apis/shipping_v2.rb +46 -20
  24. data/lib/peddler/apis/supply_sources_2020_07_01.rb +6 -12
  25. data/lib/peddler/apis/uploads_2020_11_01.rb +9 -8
  26. data/lib/peddler/apis/vehicles_2024_11_01.rb +40 -0
  27. data/lib/peddler/apis/vendor_direct_fulfillment_sandbox_test_data_2021_10_28.rb +2 -4
  28. data/lib/peddler/apis/vendor_direct_fulfillment_shipping_2021_12_28.rb +40 -27
  29. data/lib/peddler/apis/vendor_invoices_v1.rb +1 -1
  30. data/lib/peddler/apis/vendor_shipments_v1.rb +40 -1
  31. data/lib/peddler/error.rb +11 -1
  32. data/lib/peddler/token.rb +12 -12
  33. data/lib/peddler/version.rb +1 -1
  34. data/lib/peddler.rb +2 -0
  35. metadata +5 -8
  36. data/lib/peddler/json_feed_document.rb +0 -31
@@ -68,9 +68,8 @@ module Peddler
68
68
  #
69
69
  # @note This operation can make a dynamic sandbox call.
70
70
  # @param create_inventory_item_request_body [Hash] CreateInventoryItem Request Body Parameter.
71
- # @param rate_limit [Float] Requests per second
72
71
  # @return [Peddler::Response] The API response
73
- def create_inventory_item(create_inventory_item_request_body, rate_limit: nil)
72
+ def create_inventory_item(create_inventory_item_request_body)
74
73
  must_sandbox!
75
74
 
76
75
  path = "/fba/inventory/v1/items"
@@ -86,9 +85,8 @@ module Peddler
86
85
  # @note This operation can make a dynamic sandbox call.
87
86
  # @param seller_sku [String] A single seller SKU used for querying the specified seller SKU inventory summaries.
88
87
  # @param marketplace_id [String] The marketplace ID for the marketplace for which the sellerSku is to be deleted.
89
- # @param rate_limit [Float] Requests per second
90
88
  # @return [Peddler::Response] The API response
91
- def delete_inventory_item(seller_sku, marketplace_id, rate_limit: nil)
89
+ def delete_inventory_item(seller_sku, marketplace_id)
92
90
  must_sandbox!
93
91
 
94
92
  path = "/fba/inventory/v1/items/#{seller_sku}"
@@ -107,9 +105,8 @@ module Peddler
107
105
  # @note This operation can make a dynamic sandbox call.
108
106
  # @param x_amzn_idempotency_token [String] A unique token/requestId provided with each call to ensure idempotency.
109
107
  # @param add_inventory_request_body [Hash] List of items to add to Sandbox inventory.
110
- # @param rate_limit [Float] Requests per second
111
108
  # @return [Peddler::Response] The API response
112
- def add_inventory(x_amzn_idempotency_token, add_inventory_request_body, rate_limit: nil)
109
+ def add_inventory(x_amzn_idempotency_token, add_inventory_request_body)
113
110
  must_sandbox!
114
111
 
115
112
  path = "/fba/inventory/v1/items/inventory"
@@ -11,7 +11,7 @@ module Peddler
11
11
  end
12
12
 
13
13
  module APIs
14
- # Feeds v2021-06-30
14
+ # Selling Partner API for Feeds
15
15
  #
16
16
  # The Selling Partner API for Feeds lets you upload data to Amazon on behalf of a selling partner.
17
17
  class Feeds20210630 < API
@@ -0,0 +1,53 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "peddler/api"
4
+
5
+ module Peddler
6
+ class << self
7
+ def finances_2024_06_01(...)
8
+ APIs::Finances20240601.new(...)
9
+ end
10
+ end
11
+
12
+ module APIs
13
+ # The Selling Partner API for Transfers.
14
+ #
15
+ # The Selling Partner API for Transfers enables selling partners to retrieve payment methods and initiate payouts
16
+ # for their seller accounts. This API supports the following marketplaces: DE, FR, IT, ES, SE, NL, PL, and BE.
17
+ class Finances20240601 < API
18
+ # Initiates an on-demand payout to the seller's default deposit method in Seller Central for the given
19
+ # `marketplaceId` and `accountType`, if eligible. You can only initiate one on-demand payout for each marketplace
20
+ # and account type within a 24-hour period.
21
+ #
22
+ # @note This operation can make a static sandbox call.
23
+ # @param body [Hash] The request body for the `initiatePayout` operation.
24
+ # @param rate_limit [Float] Requests per second
25
+ # @return [Peddler::Response] The API response
26
+ def initiate_payout(body, rate_limit: 0.017)
27
+ path = "/finances/transfers/2024-06-01/payouts"
28
+
29
+ meter(rate_limit).post(path, body:)
30
+ end
31
+
32
+ # Returns the list of payment methods for the seller, which can be filtered by method type.
33
+ #
34
+ # @note This operation can make a static sandbox call.
35
+ # @param marketplace_id [String] The identifier of the marketplace from which you want to retrieve payment
36
+ # methods. For the list of possible marketplace identifiers, refer to [Marketplace
37
+ # IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids).
38
+ # @param payment_method_types [Array<String>] A comma-separated list of the payment method types you want to
39
+ # include in the response.
40
+ # @param rate_limit [Float] Requests per second
41
+ # @return [Peddler::Response] The API response
42
+ def get_payment_methods(marketplace_id, payment_method_types: nil, rate_limit: 0.5)
43
+ path = "/finances/transfers/2024-06-01/paymentMethods"
44
+ params = {
45
+ "marketplaceId" => marketplace_id,
46
+ "paymentMethodTypes" => payment_method_types,
47
+ }.compact
48
+
49
+ meter(rate_limit).get(path, params:)
50
+ end
51
+ end
52
+ end
53
+ end
@@ -12,26 +12,23 @@ module Peddler
12
12
  module APIs
13
13
  # The Selling Partner API for Finances
14
14
  #
15
- # The Selling Partner API for Finances provides financial information relevant to a seller's business. You can
16
- # obtain financial events for a given order or date range without having to wait until a statement period closes.
15
+ # The Selling Partner API for Finances helps you obtain financial information relevant to a seller's business. You
16
+ # can obtain financial events for a given order or date range without having to wait until a statement period
17
+ # closes.
17
18
  class Finances20240619 < API
18
- # Returns transactions for the given parameters. Orders from the last 48 hours might not be included in financial
19
- # events.
19
+ # Returns transactions for the given parameters. It may take up to 48 hours for transactions to appear in your
20
+ # transaction events.
20
21
  #
21
22
  # @note This operation can make a static sandbox call.
22
- # @param posted_after [String] The response includes financial events posted after (or on) this date. This date
23
- # must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. The date-time
24
- # must be more than two minutes before the time of the request.
25
- # @param posted_before [String] The response includes financial events posted before (but not on) this date. This
26
- # date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. The
27
- # date-time must be later than `PostedAfter` and more than two minutes before the request was submitted. If
28
- # `PostedAfter` and `PostedBefore` are more than 180 days apart, the response is empty. **Default:** Two minutes
29
- # before the time of the request.
30
- # @param marketplace_id [String] The ID of the marketplace from which you want to retrieve transactions.
31
- # @param next_token [String] The response includes `nextToken` when the number of results exceeds the specified
32
- # `pageSize` value. To get the next page of results, call the operation with this token and include the same
33
- # arguments as the call that produced the token. To get a complete list, call this operation until `nextToken`
34
- # is null. Note that this operation can return empty pages.
23
+ # @param posted_after [String] A date used for selecting transactions posted after (or at) a specified time. The
24
+ # date-time must be no later than two minutes before the request was submitted, in ISO 8601 date time format.
25
+ # @param posted_before [String] A date used for selecting transactions posted before (but not at) a specified
26
+ # time. The date-time must be later than PostedAfter and no later than two minutes before the request was
27
+ # submitted, in ISO 8601 date time format. If PostedAfter and PostedBefore are more than 180 days apart, no
28
+ # transactions are returned. You must specify the PostedAfter parameter if you specify the PostedBefore
29
+ # parameter. Default: Now minus two minutes.
30
+ # @param marketplace_id [String] A string token used to select Marketplace ID.
31
+ # @param next_token [String] A string token returned in the response of your previous request.
35
32
  # @param rate_limit [Float] Requests per second
36
33
  # @return [Peddler::Response] The API response
37
34
  def list_transactions(posted_after, posted_before: nil, marketplace_id: nil, next_token: nil, rate_limit: 0.5)
@@ -10,7 +10,7 @@ module Peddler
10
10
  end
11
11
 
12
12
  module APIs
13
- # Fulfillment Inbound v2024-03-20
13
+ # The Selling Partner API for FBA inbound operations.
14
14
  #
15
15
  # The Selling Partner API for Fulfillment By Amazon (FBA) Inbound. The FBA Inbound API enables building inbound
16
16
  # workflows to create, manage, and send shipments into Amazon's fulfillment network. The API has interoperability
@@ -542,7 +542,8 @@ module Peddler
542
542
  meter(rate_limit).get(path, params:)
543
543
  end
544
544
 
545
- # Cancels a self-ship appointment slot against a shipment.
545
+ # Cancels a self-ship appointment slot against a shipment. Only available in the following
546
+ # [marketplaces](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids): MX, BR, EG, SA, AE, IN.
546
547
  #
547
548
  # @note This operation can make a static sandbox call.
548
549
  # @param inbound_plan_id [String] Identifier of an inbound plan.
@@ -556,7 +557,9 @@ module Peddler
556
557
  meter(rate_limit).put(path, body:)
557
558
  end
558
559
 
559
- # Retrieves a list of available self-ship appointment slots used to drop off a shipment at a warehouse.
560
+ # Retrieves a list of available self-ship appointment slots used to drop off a shipment at a warehouse. Only
561
+ # available in the following [marketplaces](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids): MX,
562
+ # BR, EG, SA, AE, IN.
560
563
  #
561
564
  # @note This operation can make a static sandbox call.
562
565
  # @param inbound_plan_id [String] Identifier of an inbound plan.
@@ -579,7 +582,8 @@ module Peddler
579
582
  meter(rate_limit).get(path, params:)
580
583
  end
581
584
 
582
- # Initiates the process of generating the appointment slots list.
585
+ # Initiates the process of generating the appointment slots list. Only available in the following
586
+ # [marketplaces](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids): MX, BR, EG, SA, AE, IN.
583
587
  #
584
588
  # @note This operation can make a static sandbox call.
585
589
  # @param inbound_plan_id [String] Identifier of an inbound plan.
@@ -593,7 +597,8 @@ module Peddler
593
597
  meter(rate_limit).post(path, body:)
594
598
  end
595
599
 
596
- # Confirms or reschedules a self-ship appointment slot against a shipment.
600
+ # Confirms or reschedules a self-ship appointment slot against a shipment. Only available in the following
601
+ # [marketplaces](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids): MX, BR, EG, SA, AE, IN.
597
602
  #
598
603
  # @note This operation can make a static sandbox call.
599
604
  # @param inbound_plan_id [String] Identifier of an inbound plan.
@@ -15,92 +15,6 @@ module Peddler
15
15
  # The Selling Partner API for Fulfillment Inbound lets you create applications that create and update inbound
16
16
  # shipments of inventory to Amazon's fulfillment network.
17
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 [Peddler::Response] 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 [Peddler::Response] 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 [Peddler::Response] 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 [Peddler::Response] 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 [Peddler::Response] 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
18
  # Returns labeling requirements and item preparation instructions to help prepare items for shipment to Amazon's
105
19
  # fulfillment network.
106
20
  #
@@ -132,87 +46,6 @@ module Peddler
132
46
  meter(rate_limit).get(path, params:)
133
47
  end
134
48
 
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 [Peddler::Response] 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 [Peddler::Response] 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 [Peddler::Response] 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 [Peddler::Response] 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 [Peddler::Response] 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
49
  # Returns package/pallet labels for faster and more accurate shipment processing at the Amazon fulfillment center.
217
50
  #
218
51
  # @note This operation can make a static sandbox call.
@@ -312,11 +145,10 @@ module Peddler
312
145
  #
313
146
  # @note This operation can make a static sandbox call.
314
147
  # @param shipment_id [String] A shipment identifier used for selecting items in a specific inbound shipment.
315
- # @param marketplace_id [String] A marketplace identifier. Specifies the marketplace where the product would be
316
- # stored.
148
+ # @param marketplace_id [String] Deprecated. Do not use.
317
149
  # @param rate_limit [Float] Requests per second
318
150
  # @return [Peddler::Response] The API response
319
- def get_shipment_items_by_shipment_id(shipment_id, marketplace_id, rate_limit: 2.0)
151
+ def get_shipment_items_by_shipment_id(shipment_id, marketplace_id: nil, rate_limit: 2.0)
320
152
  path = "/fba/inbound/v0/shipments/#{shipment_id}/items"
321
153
  params = {
322
154
  "MarketplaceId" => marketplace_id,
@@ -184,9 +184,8 @@ module Peddler
184
184
  # @param seller_fulfillment_order_id [String] The identifier assigned to the item by the seller when the
185
185
  # fulfillment order was created.
186
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
187
  # @return [Peddler::Response] The API response
189
- def submit_fulfillment_order_status_update(seller_fulfillment_order_id, body, rate_limit: nil)
188
+ def submit_fulfillment_order_status_update(seller_fulfillment_order_id, body)
190
189
  must_sandbox!
191
190
 
192
191
  path = "/fba/outbound/2020-07-01/fulfillmentOrders/#{seller_fulfillment_order_id}/status"
@@ -10,7 +10,7 @@ module Peddler
10
10
  end
11
11
 
12
12
  module APIs
13
- # Listings Items v2021-08-01
13
+ # Selling Partner API for Listings Items
14
14
  #
15
15
  # The Selling Partner API for Listings Items (Listings Items API) provides programmatic access to selling partner
16
16
  # listings on Amazon. Use this API in collaboration with the Selling Partner API for Product Type Definitions, which
@@ -69,10 +69,7 @@ module Peddler
69
69
  end
70
70
 
71
71
  # Partially update (patch) a listings item for a selling partner. Only top-level listings item attributes can be
72
- # patched. Patching nested attributes is not supported. **Note:** This operation has a throttling rate of one
73
- # request per second when `mode` is `VALIDATION_PREVIEW`. **Note:** The parameters associated with this operation
74
- # may contain special characters that must be encoded to successfully call the API. To avoid errors with SKUs when
75
- # encoding URLs, refer to [URL Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding).
72
+ # patched. Patching nested attributes is not supported.
76
73
  #
77
74
  # @note This operation can make a static sandbox call.
78
75
  # @param seller_id [String] A selling partner identifier, such as a merchant account or vendor code.
@@ -131,6 +128,81 @@ module Peddler
131
128
 
132
129
  meter(rate_limit).put(path, body:, params:)
133
130
  end
131
+
132
+ # Search for and return a list of selling partner listings items and their respective details.
133
+ #
134
+ # @note This operation can make a static sandbox call.
135
+ # @param seller_id [String] A selling partner identifier, such as a merchant account or vendor code.
136
+ # @param marketplace_ids [Array<String>] A comma-delimited list of Amazon marketplace identifiers for the request.
137
+ # @param issue_locale [String] A locale that is used to localize issues. When not provided, the default language
138
+ # code of the first marketplace is used. Examples: "en_US", "fr_CA", "fr_FR". When a localization is not
139
+ # available in the specified locale, localized messages default to "en_US".
140
+ # @param included_data [Array<String>] A comma-delimited list of datasets that you want to include in the
141
+ # response. Default: `summaries`.
142
+ # @param identifiers [Array<String>] A comma-delimited list of product identifiers that you can use to search for
143
+ # listings items. **Note**: 1. This is required when you specify `identifiersType`. 2. You cannot use
144
+ # 'identifiers' if you specify `variationParentSku` or `packageHierarchySku`.
145
+ # @param identifiers_type [String] A type of product identifiers that you can use to search for listings items.
146
+ # **Note**: This is required when `identifiers` is provided.
147
+ # @param variation_parent_sku [String] Filters results to include listing items that are variation children of the
148
+ # specified SKU. **Note**: You cannot use `variationParentSku` if you include `identifiers` or
149
+ # `packageHierarchySku` in your request.
150
+ # @param package_hierarchy_sku [String] Filter results to include listing items that contain or are contained by
151
+ # the specified SKU. **Note**: You cannot use `packageHierarchySku` if you include `identifiers` or
152
+ # `variationParentSku` in your request.
153
+ # @param created_after [String] A date-time that is used to filter listing items. The response includes listings
154
+ # items that were created at or after this time. Values are in [ISO
155
+ # 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format.
156
+ # @param created_before [String] A date-time that is used to filter listing items. The response includes listings
157
+ # items that were created at or before this time. Values are in [ISO
158
+ # 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format.
159
+ # @param last_updated_after [String] A date-time that is used to filter listing items. The response includes
160
+ # listings items that were last updated at or after this time. Values are in [ISO
161
+ # 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format.
162
+ # @param last_updated_before [String] A date-time that is used to filter listing items. The response includes
163
+ # listings items that were last updated at or before this time. Values are in [ISO
164
+ # 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format.
165
+ # @param with_issue_severity [Array<String>] Filter results to include only listing items that have issues that
166
+ # match one or more of the specified severity levels.
167
+ # @param with_status [Array<String>] Filter results to include only listing items that have the specified status.
168
+ # @param without_status [Array<String>] Filter results to include only listing items that don't contain the
169
+ # specified statuses.
170
+ # @param sort_by [String] An attribute by which to sort the returned listing items.
171
+ # @param sort_order [String] The order in which to sort the result items.
172
+ # @param page_size [Integer] The number of results that you want to include on each page.
173
+ # @param page_token [String] A token that you can use to fetch a specific page when there are multiple pages of
174
+ # results.
175
+ # @param rate_limit [Float] Requests per second
176
+ # @return [Peddler::Response] The API response
177
+ def search_listings_items(seller_id, marketplace_ids, issue_locale: nil, included_data: ["summaries"],
178
+ identifiers: nil, identifiers_type: nil, variation_parent_sku: nil, package_hierarchy_sku: nil,
179
+ created_after: nil, created_before: nil, last_updated_after: nil, last_updated_before: nil,
180
+ with_issue_severity: nil, with_status: nil, without_status: nil, sort_by: "lastUpdatedDate", sort_order: "DESC",
181
+ page_size: 10, page_token: nil, rate_limit: 5.0)
182
+ path = "/listings/2021-08-01/items/#{seller_id}"
183
+ params = {
184
+ "marketplaceIds" => marketplace_ids,
185
+ "issueLocale" => issue_locale,
186
+ "includedData" => included_data,
187
+ "identifiers" => identifiers,
188
+ "identifiersType" => identifiers_type,
189
+ "variationParentSku" => variation_parent_sku,
190
+ "packageHierarchySku" => package_hierarchy_sku,
191
+ "createdAfter" => created_after,
192
+ "createdBefore" => created_before,
193
+ "lastUpdatedAfter" => last_updated_after,
194
+ "lastUpdatedBefore" => last_updated_before,
195
+ "withIssueSeverity" => with_issue_severity,
196
+ "withStatus" => with_status,
197
+ "withoutStatus" => without_status,
198
+ "sortBy" => sort_by,
199
+ "sortOrder" => sort_order,
200
+ "pageSize" => page_size,
201
+ "pageToken" => page_token,
202
+ }.compact
203
+
204
+ meter(rate_limit).get(path, params:)
205
+ end
134
206
  end
135
207
  end
136
208
  end