peddler 3.0.0 → 4.0.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 (67) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +14 -6
  3. data/lib/peddler/api.rb +28 -13
  4. data/lib/peddler/{api → apis}/amazon_warehousing_and_distribution_2024_05_09.rb +5 -5
  5. data/lib/peddler/{api → apis}/aplus_content_2020_11_01.rb +12 -12
  6. data/lib/peddler/{api → apis}/application_integrations_2024_04_01.rb +5 -5
  7. data/lib/peddler/{api → apis}/application_management_2023_11_30.rb +3 -3
  8. data/lib/peddler/{api → apis}/catalog_items_2020_12_01.rb +4 -4
  9. data/lib/peddler/{api → apis}/catalog_items_2022_04_01.rb +5 -5
  10. data/lib/peddler/{api → apis}/catalog_items_v0.rb +5 -5
  11. data/lib/peddler/{api → apis}/data_kiosk_2023_11_15.rb +7 -7
  12. data/lib/peddler/{api → apis}/easy_ship_2022_03_23.rb +20 -21
  13. data/lib/peddler/{api → apis}/fba_inbound_eligibility_v1.rb +3 -3
  14. data/lib/peddler/{api → apis}/fba_inventory_v1.rb +6 -6
  15. data/lib/peddler/{api → apis}/feeds_2021_06_30.rb +12 -9
  16. data/lib/peddler/{api → apis}/finances_2024_06_19.rb +3 -3
  17. data/lib/peddler/apis/finances_v0.rb +135 -0
  18. data/lib/peddler/{api → apis}/fulfillment_inbound_2024_03_20.rb +84 -54
  19. data/lib/peddler/{api → apis}/fulfillment_inbound_v0.rb +27 -20
  20. data/lib/peddler/{api → apis}/fulfillment_outbound_2020_07_01.rb +16 -16
  21. data/lib/peddler/{api → apis}/invoices_2024_06_19.rb +9 -9
  22. data/lib/peddler/{api → apis}/listings_items_2020_09_01.rb +5 -5
  23. data/lib/peddler/{api → apis}/listings_items_2021_08_01.rb +7 -41
  24. data/lib/peddler/{api → apis}/listings_restrictions_2021_08_01.rb +3 -3
  25. data/lib/peddler/{api → apis}/merchant_fulfillment_v0.rb +14 -14
  26. data/lib/peddler/{api → apis}/messaging_v1.rb +15 -15
  27. data/lib/peddler/{api → apis}/notifications_v1.rb +10 -10
  28. data/lib/peddler/{api → apis}/orders_v0.rb +13 -13
  29. data/lib/peddler/{api → apis}/product_fees_v0.rb +5 -5
  30. data/lib/peddler/{api → apis}/product_pricing_2022_05_01.rb +8 -8
  31. data/lib/peddler/{api → apis}/product_pricing_v0.rb +8 -8
  32. data/lib/peddler/{api → apis}/product_type_definitions_2020_09_01.rb +4 -4
  33. data/lib/peddler/{api → apis}/replenishment_2022_11_07.rb +5 -5
  34. data/lib/peddler/{api → apis}/reports_2021_06_30.rb +12 -12
  35. data/lib/peddler/{api → apis}/sales_v1.rb +3 -3
  36. data/lib/peddler/{api → apis}/sellers_v1.rb +4 -4
  37. data/lib/peddler/{api → apis}/services_v1.rb +19 -19
  38. data/lib/peddler/{api → apis}/shipment_invoicing_v0.rb +5 -5
  39. data/lib/peddler/{api → apis}/shipping_v1.rb +11 -11
  40. data/lib/peddler/{api → apis}/shipping_v2.rb +19 -19
  41. data/lib/peddler/{api → apis}/solicitations_v1.rb +4 -4
  42. data/lib/peddler/{api → apis}/supply_sources_2020_07_01.rb +8 -8
  43. data/lib/peddler/{api → apis}/tokens_2021_03_01.rb +3 -3
  44. data/lib/peddler/{api → apis}/uploads_2020_11_01.rb +3 -3
  45. data/lib/peddler/{api → apis}/vendor_direct_fulfillment_inventory_v1.rb +4 -4
  46. data/lib/peddler/{api → apis}/vendor_direct_fulfillment_orders_2021_12_28.rb +5 -5
  47. data/lib/peddler/{api → apis}/vendor_direct_fulfillment_orders_v1.rb +6 -6
  48. data/lib/peddler/{api → apis}/vendor_direct_fulfillment_payments_v1.rb +4 -4
  49. data/lib/peddler/{api → apis}/vendor_direct_fulfillment_sandbox_test_data_2021_10_28.rb +9 -9
  50. data/lib/peddler/{api → apis}/vendor_direct_fulfillment_shipping_2021_12_28.rb +17 -17
  51. data/lib/peddler/{api → apis}/vendor_direct_fulfillment_shipping_v1.rb +30 -30
  52. data/lib/peddler/{api → apis}/vendor_direct_fulfillment_transactions_2021_12_28.rb +4 -4
  53. data/lib/peddler/{api → apis}/vendor_direct_fulfillment_transactions_v1.rb +4 -4
  54. data/lib/peddler/{api → apis}/vendor_invoices_v1.rb +4 -4
  55. data/lib/peddler/{api → apis}/vendor_orders_v1.rb +7 -7
  56. data/lib/peddler/{api → apis}/vendor_shipments_v1.rb +6 -6
  57. data/lib/peddler/{api → apis}/vendor_transaction_status_v1.rb +3 -3
  58. data/lib/peddler/endpoint.rb +2 -2
  59. data/lib/peddler/error.rb +21 -12
  60. data/lib/peddler/helpers/feeds_2021_06_30.rb +26 -0
  61. data/lib/peddler/json_feed_document.rb +31 -0
  62. data/lib/peddler/marketplace.rb +46 -2
  63. data/lib/peddler/response.rb +46 -0
  64. data/lib/peddler/version.rb +1 -1
  65. data/lib/peddler.rb +54 -55
  66. metadata +59 -56
  67. data/lib/peddler/api/finances_v0.rb +0 -148
@@ -5,11 +5,11 @@ require "peddler/api"
5
5
  module Peddler
6
6
  class << self
7
7
  def fulfillment_outbound_2020_07_01(...)
8
- API::FulfillmentOutbound20200701.new(...)
8
+ APIs::FulfillmentOutbound20200701.new(...)
9
9
  end
10
10
  end
11
11
 
12
- class API
12
+ module APIs
13
13
  # Selling Partner APIs for Fulfillment Outbound
14
14
  #
15
15
  # The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill
@@ -21,7 +21,7 @@ module Peddler
21
21
  # @note This operation can make a dynamic sandbox call.
22
22
  # @param body [Hash] GetFulfillmentPreviewRequest parameter
23
23
  # @param rate_limit [Float] Requests per second
24
- # @return [Hash] The API response
24
+ # @return [Peddler::Response] The API response
25
25
  def get_fulfillment_preview(body, rate_limit: 2.0)
26
26
  path = "/fba/outbound/2020-07-01/fulfillmentOrders/preview"
27
27
 
@@ -34,7 +34,7 @@ module Peddler
34
34
  # @note This operation can make a dynamic sandbox call.
35
35
  # @param body [Hash] GetDeliveryOffersRequest parameter
36
36
  # @param rate_limit [Float] Requests per second
37
- # @return [Hash] The API response
37
+ # @return [Peddler::Response] The API response
38
38
  def delivery_offers(body, rate_limit: 5.0)
39
39
  path = "/fba/outbound/2020-07-01/deliveryOffers"
40
40
 
@@ -50,7 +50,7 @@ module Peddler
50
50
  # new fulfillment order.
51
51
  # @param next_token [String] A string token returned in the response to your previous request.
52
52
  # @param rate_limit [Float] Requests per second
53
- # @return [Hash] The API response
53
+ # @return [Peddler::Response] The API response
54
54
  def list_all_fulfillment_orders(query_start_date: nil, next_token: nil, rate_limit: 2.0)
55
55
  path = "/fba/outbound/2020-07-01/fulfillmentOrders"
56
56
  params = {
@@ -67,7 +67,7 @@ module Peddler
67
67
  # @note This operation can make a dynamic sandbox call.
68
68
  # @param body [Hash] CreateFulfillmentOrderRequest parameter
69
69
  # @param rate_limit [Float] Requests per second
70
- # @return [Hash] The API response
70
+ # @return [Peddler::Response] The API response
71
71
  def create_fulfillment_order(body, rate_limit: 2.0)
72
72
  path = "/fba/outbound/2020-07-01/fulfillmentOrders"
73
73
 
@@ -81,7 +81,7 @@ module Peddler
81
81
  # @param package_number [Integer] The unencrypted package identifier returned by the `getFulfillmentOrder`
82
82
  # operation.
83
83
  # @param rate_limit [Float] Requests per second
84
- # @return [Hash] The API response
84
+ # @return [Peddler::Response] The API response
85
85
  def get_package_tracking_details(package_number, rate_limit: 2.0)
86
86
  path = "/fba/outbound/2020-07-01/tracking"
87
87
  params = {
@@ -104,7 +104,7 @@ module Peddler
104
104
  # @param language [String] The language that the `TranslatedDescription` property of the `ReasonCodeDetails`
105
105
  # response object should be translated into.
106
106
  # @param rate_limit [Float] Requests per second
107
- # @return [Hash] The API response
107
+ # @return [Peddler::Response] The API response
108
108
  def list_return_reason_codes(seller_sku, marketplace_id: nil, seller_fulfillment_order_id: nil, language: nil,
109
109
  rate_limit: 2.0)
110
110
  path = "/fba/outbound/2020-07-01/returnReasonCodes"
@@ -126,7 +126,7 @@ module Peddler
126
126
  # time it was created. The seller uses their own records to find the correct `SellerFulfillmentOrderId` value
127
127
  # based on the buyer's request to return items.
128
128
  # @param rate_limit [Float] Requests per second
129
- # @return [Hash] The API response
129
+ # @return [Peddler::Response] The API response
130
130
  def create_fulfillment_return(body, seller_fulfillment_order_id, rate_limit: 2.0)
131
131
  path = "/fba/outbound/2020-07-01/fulfillmentOrders/#{seller_fulfillment_order_id}/return"
132
132
 
@@ -139,7 +139,7 @@ module Peddler
139
139
  # @param seller_fulfillment_order_id [String] The identifier assigned to the item by the seller when the
140
140
  # fulfillment order was created.
141
141
  # @param rate_limit [Float] Requests per second
142
- # @return [Hash] The API response
142
+ # @return [Peddler::Response] The API response
143
143
  def get_fulfillment_order(seller_fulfillment_order_id, rate_limit: 2.0)
144
144
  path = "/fba/outbound/2020-07-01/fulfillmentOrders/#{seller_fulfillment_order_id}"
145
145
 
@@ -153,7 +153,7 @@ module Peddler
153
153
  # @param seller_fulfillment_order_id [String] The identifier assigned to the item by the seller when the
154
154
  # fulfillment order was created.
155
155
  # @param rate_limit [Float] Requests per second
156
- # @return [Hash] The API response
156
+ # @return [Peddler::Response] The API response
157
157
  def update_fulfillment_order(body, seller_fulfillment_order_id, rate_limit: 2.0)
158
158
  path = "/fba/outbound/2020-07-01/fulfillmentOrders/#{seller_fulfillment_order_id}"
159
159
 
@@ -167,7 +167,7 @@ module Peddler
167
167
  # @param seller_fulfillment_order_id [String] The identifier assigned to the item by the seller when the
168
168
  # fulfillment order was created.
169
169
  # @param rate_limit [Float] Requests per second
170
- # @return [Hash] The API response
170
+ # @return [Peddler::Response] The API response
171
171
  def cancel_fulfillment_order(seller_fulfillment_order_id, rate_limit: 2.0)
172
172
  path = "/fba/outbound/2020-07-01/fulfillmentOrders/#{seller_fulfillment_order_id}/cancel"
173
173
 
@@ -185,7 +185,7 @@ module Peddler
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
187
  # @param rate_limit [Float] Requests per second
188
- # @return [Hash] The API response
188
+ # @return [Peddler::Response] The API response
189
189
  def submit_fulfillment_order_status_update(seller_fulfillment_order_id, body, rate_limit: nil)
190
190
  must_sandbox!
191
191
 
@@ -200,7 +200,7 @@ module Peddler
200
200
  # @note This operation can make a dynamic sandbox call.
201
201
  # @param marketplace_id [String] The marketplace for which to return the list of features.
202
202
  # @param rate_limit [Float] Requests per second
203
- # @return [Hash] The API response
203
+ # @return [Peddler::Response] The API response
204
204
  def get_features(marketplace_id, rate_limit: 2.0)
205
205
  path = "/fba/outbound/2020-07-01/features"
206
206
  params = {
@@ -222,7 +222,7 @@ module Peddler
222
222
  # specified date. An update is defined as any change in feature-enabled inventory availability. The date must be
223
223
  # in the format yyyy-MM-ddTHH:mm:ss.sssZ
224
224
  # @param rate_limit [Float] Requests per second
225
- # @return [Hash] The API response
225
+ # @return [Peddler::Response] The API response
226
226
  def get_feature_inventory(marketplace_id, feature_name, next_token: nil, query_start_date: nil, rate_limit: 2.0)
227
227
  path = "/fba/outbound/2020-07-01/features/inventory/#{feature_name}"
228
228
  params = {
@@ -245,7 +245,7 @@ module Peddler
245
245
  # @param seller_sku [String] Used to identify an item in the given marketplace. `SellerSKU` is qualified by the
246
246
  # seller's `SellerId`, which is included with every operation that you submit.
247
247
  # @param rate_limit [Float] Requests per second
248
- # @return [Hash] The API response
248
+ # @return [Peddler::Response] The API response
249
249
  def get_feature_sku(marketplace_id, feature_name, seller_sku, rate_limit: 2.0)
250
250
  path = "/fba/outbound/2020-07-01/features/inventory/#{feature_name}/#{seller_sku}"
251
251
  params = {
@@ -5,11 +5,11 @@ require "peddler/api"
5
5
  module Peddler
6
6
  class << self
7
7
  def invoices_2024_06_19(...)
8
- API::Invoices20240619.new(...)
8
+ APIs::Invoices20240619.new(...)
9
9
  end
10
10
  end
11
11
 
12
- class API
12
+ module APIs
13
13
  # The Selling Partner API for Invoices.
14
14
  #
15
15
  # Use the Selling Partner API for Invoices to retrieve and manage invoice-related operations, which can help selling
@@ -20,7 +20,7 @@ module Peddler
20
20
  # @note This operation can make a static sandbox call.
21
21
  # @param marketplace_id [String] The marketplace identifier.
22
22
  # @param rate_limit [Float] Requests per second
23
- # @return [Hash] The API response
23
+ # @return [Peddler::Response] The API response
24
24
  def get_invoices_attributes(marketplace_id, rate_limit: 1.0)
25
25
  path = "/tax/invoices/2024-06-19/attributes"
26
26
  params = {
@@ -36,7 +36,7 @@ module Peddler
36
36
  # @note This operation can make a static sandbox call.
37
37
  # @param invoices_document_id [String] The export document identifier.
38
38
  # @param rate_limit [Float] Requests per second
39
- # @return [Hash] The API response
39
+ # @return [Peddler::Response] The API response
40
40
  def get_invoices_document(invoices_document_id, rate_limit: 0.0167)
41
41
  path = "/tax/invoices/2024-06-19/documents/#{invoices_document_id}"
42
42
 
@@ -48,7 +48,7 @@ module Peddler
48
48
  # @note This operation can make a static sandbox call.
49
49
  # @param body [Hash] Information required to create the export request.
50
50
  # @param rate_limit [Float] Requests per second
51
- # @return [Hash] The API response
51
+ # @return [Peddler::Response] The API response
52
52
  def create_invoices_export(body, rate_limit: 0.167)
53
53
  path = "/tax/invoices/2024-06-19/exports"
54
54
 
@@ -72,7 +72,7 @@ module Peddler
72
72
  # The default value is the time of the request.
73
73
  # @param status [String] Return exports matching the status specified.
74
74
  # @param rate_limit [Float] Requests per second
75
- # @return [Hash] The API response
75
+ # @return [Peddler::Response] The API response
76
76
  def get_invoices_exports(marketplace_id, date_start: nil, next_token: nil, page_size: nil, date_end: nil,
77
77
  status: nil, rate_limit: 0.1)
78
78
  path = "/tax/invoices/2024-06-19/exports"
@@ -93,7 +93,7 @@ module Peddler
93
93
  # @note This operation can make a static sandbox call.
94
94
  # @param export_id [String] The unique identifier for the export.
95
95
  # @param rate_limit [Float] Requests per second
96
- # @return [Hash] The API response
96
+ # @return [Peddler::Response] The API response
97
97
  def get_invoices_export(export_id, rate_limit: 2.0)
98
98
  path = "/tax/invoices/2024-06-19/exports/#{export_id}"
99
99
 
@@ -133,7 +133,7 @@ module Peddler
133
133
  # Government Invoice ID.
134
134
  # @param sort_by [String] The attribute by which you want to sort the invoices in the response.
135
135
  # @param rate_limit [Float] Requests per second
136
- # @return [Hash] The API response
136
+ # @return [Peddler::Response] The API response
137
137
  def get_invoices(marketplace_id, transaction_identifier_name: nil, page_size: nil, date_end: nil,
138
138
  transaction_type: nil, transaction_identifier_id: nil, date_start: nil, series: nil, next_token: nil,
139
139
  sort_order: nil, invoice_type: nil, statuses: nil, external_invoice_id: nil, sort_by: nil, rate_limit: 0.1)
@@ -166,7 +166,7 @@ module Peddler
166
166
  # @param marketplace_id [String] The marketplace from which you want the invoice.
167
167
  # @param invoice_id [String] The invoice identifier.
168
168
  # @param rate_limit [Float] Requests per second
169
- # @return [Hash] The API response
169
+ # @return [Peddler::Response] The API response
170
170
  def get_invoice(marketplace_id, invoice_id, rate_limit: 2.0)
171
171
  path = "/tax/invoices/2024-06-19/invoices/#{invoice_id}"
172
172
  params = {
@@ -5,11 +5,11 @@ require "peddler/api"
5
5
  module Peddler
6
6
  class << self
7
7
  def listings_items_2020_09_01(...)
8
- API::ListingsItems20200901.new(...)
8
+ APIs::ListingsItems20200901.new(...)
9
9
  end
10
10
  end
11
11
 
12
- class API
12
+ module APIs
13
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
@@ -30,7 +30,7 @@ module Peddler
30
30
  # of the first marketplace is used. Examples: "en_US", "fr_CA", "fr_FR". Localized messages default to "en_US"
31
31
  # when a localization is not available in the specified locale.
32
32
  # @param rate_limit [Float] Requests per second
33
- # @return [Hash] The API response
33
+ # @return [Peddler::Response] The API response
34
34
  def delete_listings_item(seller_id, sku, marketplace_ids, issue_locale: nil, rate_limit: 5.0)
35
35
  path = "/listings/2020-09-01/items/#{seller_id}/#{sku}"
36
36
  params = {
@@ -55,7 +55,7 @@ module Peddler
55
55
  # when a localization is not available in the specified locale.
56
56
  # @param body [Hash] The request body schema for the patchListingsItem operation.
57
57
  # @param rate_limit [Float] Requests per second
58
- # @return [Hash] The API response
58
+ # @return [Peddler::Response] The API response
59
59
  def patch_listings_item(seller_id, sku, marketplace_ids, body, issue_locale: nil, rate_limit: 5.0)
60
60
  path = "/listings/2020-09-01/items/#{seller_id}/#{sku}"
61
61
  params = {
@@ -80,7 +80,7 @@ module Peddler
80
80
  # when a localization is not available in the specified locale.
81
81
  # @param body [Hash] The request body schema for the putListingsItem operation.
82
82
  # @param rate_limit [Float] Requests per second
83
- # @return [Hash] The API response
83
+ # @return [Peddler::Response] The API response
84
84
  def put_listings_item(seller_id, sku, marketplace_ids, body, issue_locale: nil, rate_limit: 5.0)
85
85
  path = "/listings/2020-09-01/items/#{seller_id}/#{sku}"
86
86
  params = {
@@ -5,12 +5,12 @@ require "peddler/api"
5
5
  module Peddler
6
6
  class << self
7
7
  def listings_items_2021_08_01(...)
8
- API::ListingsItems20210801.new(...)
8
+ APIs::ListingsItems20210801.new(...)
9
9
  end
10
10
  end
11
11
 
12
- class API
13
- # Selling Partner API for Listings Items
12
+ module APIs
13
+ # Listings Items v2021-08-01
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
@@ -30,7 +30,7 @@ module Peddler
30
30
  # of the first marketplace is used. Examples: `en_US`, `fr_CA`, `fr_FR`. Localized messages default to `en_US`
31
31
  # when a localization is not available in the specified locale.
32
32
  # @param rate_limit [Float] Requests per second
33
- # @return [Hash] The API response
33
+ # @return [Peddler::Response] The API response
34
34
  def delete_listings_item(seller_id, sku, marketplace_ids, issue_locale: nil, rate_limit: 5.0)
35
35
  path = "/listings/2021-08-01/items/#{seller_id}/#{sku}"
36
36
  params = {
@@ -55,7 +55,7 @@ module Peddler
55
55
  # @param included_data [Array<String>] A comma-delimited list of data sets to include in the response. Default:
56
56
  # `summaries`.
57
57
  # @param rate_limit [Float] Requests per second
58
- # @return [Hash] The API response
58
+ # @return [Peddler::Response] The API response
59
59
  def get_listings_item(seller_id, sku, marketplace_ids, issue_locale: nil, included_data: ["summaries"],
60
60
  rate_limit: 5.0)
61
61
  path = "/listings/2021-08-01/items/#{seller_id}/#{sku}"
@@ -86,7 +86,7 @@ module Peddler
86
86
  # when a localization is not available in the specified locale.
87
87
  # @param body [Hash] The request body schema for the `patchListingsItem` operation.
88
88
  # @param rate_limit [Float] Requests per second
89
- # @return [Hash] The API response
89
+ # @return [Peddler::Response] The API response
90
90
  def patch_listings_item(seller_id, sku, marketplace_ids, body, included_data: ["issues"], mode: nil,
91
91
  issue_locale: nil, rate_limit: 5.0)
92
92
  path = "/listings/2021-08-01/items/#{seller_id}/#{sku}"
@@ -118,7 +118,7 @@ module Peddler
118
118
  # when a localization is not available in the specified locale.
119
119
  # @param body [Hash] The request body schema for the `putListingsItem` operation.
120
120
  # @param rate_limit [Float] Requests per second
121
- # @return [Hash] The API response
121
+ # @return [Peddler::Response] The API response
122
122
  def put_listings_item(seller_id, sku, marketplace_ids, body, included_data: ["issues"], mode: nil,
123
123
  issue_locale: nil, rate_limit: 5.0)
124
124
  path = "/listings/2021-08-01/items/#{seller_id}/#{sku}"
@@ -131,40 +131,6 @@ module Peddler
131
131
 
132
132
  meter(rate_limit).put(path, body:, params:)
133
133
  end
134
-
135
- # Search for and return list of listings items and respective details for a selling partner.
136
- #
137
- # @note This operation can make a static sandbox call.
138
- # @param seller_id [String] A selling partner identifier, such as a merchant account or vendor code.
139
- # @param marketplace_ids [Array<String>] A comma-delimited list of Amazon marketplace identifiers for the request.
140
- # @param identifiers [Array<String>] A comma-delimited list of product identifiers to search for listings items
141
- # by. **Note**: 1. Required when `identifiersType` is provided.
142
- # @param identifiers_type [String] Type of product identifiers to search for listings items by. **Note**: 1.
143
- # Required when `identifiers` is provided.
144
- # @param page_size [Integer] Number of results to be returned per page.
145
- # @param page_token [String] A token to fetch a certain page when there are multiple pages worth of results.
146
- # @param included_data [Array<String>] A comma-delimited list of data sets to include in the response. Default:
147
- # summaries.
148
- # @param issue_locale [String] A locale for localization of issues. When not provided, the default language code
149
- # of the first marketplace is used. Examples: "en_US", "fr_CA", "fr_FR". Localized messages default to "en_US"
150
- # when a localization is not available in the specified locale.
151
- # @param rate_limit [Float] Requests per second
152
- # @return [Hash] The API response
153
- def search_listings_items(seller_id, marketplace_ids, identifiers: nil, identifiers_type: nil, page_size: 10,
154
- page_token: nil, included_data: ["summaries"], issue_locale: nil, rate_limit: 5.0)
155
- path = "/listings/2021-08-01/items/#{seller_id}"
156
- params = {
157
- "marketplaceIds" => marketplace_ids,
158
- "identifiers" => identifiers,
159
- "identifiersType" => identifiers_type,
160
- "pageSize" => page_size,
161
- "pageToken" => page_token,
162
- "includedData" => included_data,
163
- "issueLocale" => issue_locale,
164
- }.compact
165
-
166
- meter(rate_limit).get(path, params:)
167
- end
168
134
  end
169
135
  end
170
136
  end
@@ -5,11 +5,11 @@ require "peddler/api"
5
5
  module Peddler
6
6
  class << self
7
7
  def listings_restrictions_2021_08_01(...)
8
- API::ListingsRestrictions20210801.new(...)
8
+ APIs::ListingsRestrictions20210801.new(...)
9
9
  end
10
10
  end
11
11
 
12
- class API
12
+ module APIs
13
13
  # Selling Partner API for Listings Restrictions
14
14
  #
15
15
  # The Selling Partner API for Listings Restrictions provides programmatic access to restrictions on Amazon catalog
@@ -28,7 +28,7 @@ module Peddler
28
28
  # code of the first marketplace is used. Examples: "en_US", "fr_CA", "fr_FR". Localized messages default to
29
29
  # "en_US" when a localization is not available in the specified locale.
30
30
  # @param rate_limit [Float] Requests per second
31
- # @return [Hash] The API response
31
+ # @return [Peddler::Response] The API response
32
32
  def get_listings_restrictions(asin, seller_id, marketplace_ids, condition_type: nil, reason_locale: nil,
33
33
  rate_limit: 5.0)
34
34
  path = "/listings/2021-08-01/restrictions"
@@ -5,23 +5,23 @@ require "peddler/api"
5
5
  module Peddler
6
6
  class << self
7
7
  def merchant_fulfillment_v0(...)
8
- API::MerchantFulfillmentV0.new(...)
8
+ APIs::MerchantFulfillmentV0.new(...)
9
9
  end
10
10
  end
11
11
 
12
- class API
12
+ module APIs
13
13
  # Selling Partner API for Merchant Fulfillment
14
14
  #
15
- # The Selling Partner API for Merchant Fulfillment helps you build applications that let sellers purchase shipping
16
- # for non-Prime and Prime orders using Amazons Buy Shipping Services.
15
+ # With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase
16
+ # shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services.
17
17
  class MerchantFulfillmentV0 < API
18
18
  # Returns a list of shipping service offers that satisfy the specified shipment request details.
19
19
  #
20
20
  # @note This operation can make a static sandbox call.
21
- # @param body [Hash] Request schema for GetEligibleShipmentServices operation.
21
+ # @param body [Hash] The request schema for the `GetEligibleShipmentServices` operation.
22
22
  # @param rate_limit [Float] Requests per second
23
- # @return [Hash] The API response
24
- def get_eligible_shipment_services(body, rate_limit: 5.0)
23
+ # @return [Peddler::Response] The API response
24
+ def get_eligible_shipment_services(body, rate_limit: 6.0)
25
25
  path = "/mfn/v0/eligibleShippingServices"
26
26
 
27
27
  meter(rate_limit).post(path, body:)
@@ -32,7 +32,7 @@ module Peddler
32
32
  # @note This operation can make a static sandbox call.
33
33
  # @param shipment_id [String] The Amazon-defined shipment identifier for the shipment.
34
34
  # @param rate_limit [Float] Requests per second
35
- # @return [Hash] The API response
35
+ # @return [Peddler::Response] The API response
36
36
  def get_shipment(shipment_id, rate_limit: 1.0)
37
37
  path = "/mfn/v0/shipments/#{shipment_id}"
38
38
 
@@ -44,7 +44,7 @@ module Peddler
44
44
  # @note This operation can make a static sandbox call.
45
45
  # @param shipment_id [String] The Amazon-defined shipment identifier for the shipment to cancel.
46
46
  # @param rate_limit [Float] Requests per second
47
- # @return [Hash] The API response
47
+ # @return [Peddler::Response] The API response
48
48
  def cancel_shipment(shipment_id, rate_limit: 1.0)
49
49
  path = "/mfn/v0/shipments/#{shipment_id}"
50
50
 
@@ -54,10 +54,10 @@ module Peddler
54
54
  # Create a shipment with the information provided.
55
55
  #
56
56
  # @note This operation can make a static sandbox call.
57
- # @param body [Hash] Request schema for CreateShipment operation.
57
+ # @param body [Hash] The request schema for the `CreateShipment` operation.
58
58
  # @param rate_limit [Float] Requests per second
59
- # @return [Hash] The API response
60
- def create_shipment(body, rate_limit: 1.0)
59
+ # @return [Peddler::Response] The API response
60
+ def create_shipment(body, rate_limit: 2.0)
61
61
  path = "/mfn/v0/shipments"
62
62
 
63
63
  meter(rate_limit).post(path, body:)
@@ -67,9 +67,9 @@ module Peddler
67
67
  # shipping.
68
68
  #
69
69
  # @note This operation can make a static sandbox call.
70
- # @param body [Hash] Request schema for GetAdditionalSellerInputs operation.
70
+ # @param body [Hash] The request schema for the `GetAdditionalSellerInputs` operation.
71
71
  # @param rate_limit [Float] Requests per second
72
- # @return [Hash] The API response
72
+ # @return [Peddler::Response] The API response
73
73
  def get_additional_seller_inputs(body, rate_limit: 1.0)
74
74
  path = "/mfn/v0/additionalSellerInputs"
75
75
 
@@ -5,11 +5,11 @@ require "peddler/api"
5
5
  module Peddler
6
6
  class << self
7
7
  def messaging_v1(...)
8
- API::MessagingV1.new(...)
8
+ APIs::MessagingV1.new(...)
9
9
  end
10
10
  end
11
11
 
12
- class API
12
+ module APIs
13
13
  # Selling Partner API for Messaging
14
14
  #
15
15
  # With the Messaging API you can build applications that send messages to buyers. You can get a list of message
@@ -27,7 +27,7 @@ module Peddler
27
27
  # @param marketplace_ids [Array<String>] A marketplace identifier. This specifies the marketplace in which the
28
28
  # order was placed. Only one marketplace can be specified.
29
29
  # @param rate_limit [Float] Requests per second
30
- # @return [Hash] The API response
30
+ # @return [Peddler::Response] The API response
31
31
  def get_messaging_actions_for_order(amazon_order_id, marketplace_ids, rate_limit: 1.0)
32
32
  path = "/messaging/v1/orders/#{amazon_order_id}"
33
33
  params = {
@@ -47,7 +47,7 @@ module Peddler
47
47
  # order was placed. Only one marketplace can be specified.
48
48
  # @param body [Hash]
49
49
  # @param rate_limit [Float] Requests per second
50
- # @return [Hash] The API response
50
+ # @return [Peddler::Response] The API response
51
51
  def confirm_customization_details(amazon_order_id, marketplace_ids, body, rate_limit: 1.0)
52
52
  path = "/messaging/v1/orders/#{amazon_order_id}/messages/confirmCustomizationDetails"
53
53
  params = {
@@ -66,7 +66,7 @@ module Peddler
66
66
  # order was placed. Only one marketplace can be specified.
67
67
  # @param body [Hash]
68
68
  # @param rate_limit [Float] Requests per second
69
- # @return [Hash] The API response
69
+ # @return [Peddler::Response] The API response
70
70
  def create_confirm_delivery_details(amazon_order_id, marketplace_ids, body, rate_limit: 1.0)
71
71
  path = "/messaging/v1/orders/#{amazon_order_id}/messages/confirmDeliveryDetails"
72
72
  params = {
@@ -86,7 +86,7 @@ module Peddler
86
86
  # order was placed. Only one marketplace can be specified.
87
87
  # @param body [Hash]
88
88
  # @param rate_limit [Float] Requests per second
89
- # @return [Hash] The API response
89
+ # @return [Peddler::Response] The API response
90
90
  def create_legal_disclosure(amazon_order_id, marketplace_ids, body, rate_limit: 1.0)
91
91
  path = "/messaging/v1/orders/#{amazon_order_id}/messages/legalDisclosure"
92
92
  params = {
@@ -105,7 +105,7 @@ module Peddler
105
105
  # @param marketplace_ids [Array<String>] A marketplace identifier. This specifies the marketplace in which the
106
106
  # order was placed. Only one marketplace can be specified.
107
107
  # @param rate_limit [Float] Requests per second
108
- # @return [Hash] The API response
108
+ # @return [Peddler::Response] The API response
109
109
  def create_negative_feedback_removal(amazon_order_id, marketplace_ids, rate_limit: 1.0)
110
110
  path = "/messaging/v1/orders/#{amazon_order_id}/messages/negativeFeedbackRemoval"
111
111
  params = {
@@ -124,7 +124,7 @@ module Peddler
124
124
  # order was placed. Only one marketplace can be specified.
125
125
  # @param body [Hash]
126
126
  # @param rate_limit [Float] Requests per second
127
- # @return [Hash] The API response
127
+ # @return [Peddler::Response] The API response
128
128
  def create_confirm_order_details(amazon_order_id, marketplace_ids, body, rate_limit: 1.0)
129
129
  path = "/messaging/v1/orders/#{amazon_order_id}/messages/confirmOrderDetails"
130
130
  params = {
@@ -144,7 +144,7 @@ module Peddler
144
144
  # order was placed. Only one marketplace can be specified.
145
145
  # @param body [Hash]
146
146
  # @param rate_limit [Float] Requests per second
147
- # @return [Hash] The API response
147
+ # @return [Peddler::Response] The API response
148
148
  def create_confirm_service_details(amazon_order_id, marketplace_ids, body, rate_limit: 1.0)
149
149
  path = "/messaging/v1/orders/#{amazon_order_id}/messages/confirmServiceDetails"
150
150
  params = {
@@ -164,7 +164,7 @@ module Peddler
164
164
  # order was placed. Only one marketplace can be specified.
165
165
  # @param body [Hash]
166
166
  # @param rate_limit [Float] Requests per second
167
- # @return [Hash] The API response
167
+ # @return [Peddler::Response] The API response
168
168
  def create_amazon_motors(amazon_order_id, marketplace_ids, body, rate_limit: 1.0)
169
169
  path = "/messaging/v1/orders/#{amazon_order_id}/messages/amazonMotors"
170
170
  params = {
@@ -183,7 +183,7 @@ module Peddler
183
183
  # order was placed. Only one marketplace can be specified.
184
184
  # @param body [Hash]
185
185
  # @param rate_limit [Float] Requests per second
186
- # @return [Hash] The API response
186
+ # @return [Peddler::Response] The API response
187
187
  def create_warranty(amazon_order_id, marketplace_ids, body, rate_limit: 1.0)
188
188
  path = "/messaging/v1/orders/#{amazon_order_id}/messages/warranty"
189
189
  params = {
@@ -201,7 +201,7 @@ module Peddler
201
201
  # @param marketplace_ids [Array<String>] A marketplace identifier. This specifies the marketplace in which the
202
202
  # order was placed. Only one marketplace can be specified.
203
203
  # @param rate_limit [Float] Requests per second
204
- # @return [Hash] The API response
204
+ # @return [Peddler::Response] The API response
205
205
  def get_attributes(amazon_order_id, marketplace_ids, rate_limit: 1.0)
206
206
  path = "/messaging/v1/orders/#{amazon_order_id}/attributes"
207
207
  params = {
@@ -220,7 +220,7 @@ module Peddler
220
220
  # order was placed. Only one marketplace can be specified.
221
221
  # @param body [Hash]
222
222
  # @param rate_limit [Float] Requests per second
223
- # @return [Hash] The API response
223
+ # @return [Peddler::Response] The API response
224
224
  def create_digital_access_key(amazon_order_id, marketplace_ids, body, rate_limit: 1.0)
225
225
  path = "/messaging/v1/orders/#{amazon_order_id}/messages/digitalAccessKey"
226
226
  params = {
@@ -240,7 +240,7 @@ module Peddler
240
240
  # order was placed. Only one marketplace can be specified.
241
241
  # @param body [Hash]
242
242
  # @param rate_limit [Float] Requests per second
243
- # @return [Hash] The API response
243
+ # @return [Peddler::Response] The API response
244
244
  def create_unexpected_problem(amazon_order_id, marketplace_ids, body, rate_limit: 1.0)
245
245
  path = "/messaging/v1/orders/#{amazon_order_id}/messages/unexpectedProblem"
246
246
  params = {
@@ -259,7 +259,7 @@ module Peddler
259
259
  # order was placed. Only one marketplace can be specified.
260
260
  # @param body [Hash]
261
261
  # @param rate_limit [Float] Requests per second
262
- # @return [Hash] The API response
262
+ # @return [Peddler::Response] The API response
263
263
  def send_invoice(amazon_order_id, marketplace_ids, body, rate_limit: nil)
264
264
  path = "/messaging/v1/orders/#{amazon_order_id}/messages/invoice"
265
265
  params = {
@@ -5,11 +5,11 @@ require "peddler/api"
5
5
  module Peddler
6
6
  class << self
7
7
  def notifications_v1(...)
8
- API::NotificationsV1.new(...)
8
+ APIs::NotificationsV1.new(...)
9
9
  end
10
10
  end
11
11
 
12
- class API
12
+ module APIs
13
13
  # Selling Partner API for Notifications
14
14
  #
15
15
  # The Selling Partner API for Notifications lets you subscribe to notifications that are relevant to a selling
@@ -27,7 +27,7 @@ module Peddler
27
27
  # @param rate_limit [Float] Requests per second
28
28
  # @param notification_type [String] The type of notification. For more information about notification types, refer
29
29
  # to [Notification Type Values](https://developer-docs.amazon.com/sp-api/docs/notification-type-values).
30
- # @return [Hash] The API response
30
+ # @return [Peddler::Response] The API response
31
31
  def get_subscription(notification_type, payload_version: nil, rate_limit: 1.0)
32
32
  path = "/notifications/v1/subscriptions/#{notification_type}"
33
33
  params = {
@@ -47,7 +47,7 @@ module Peddler
47
47
  # @param rate_limit [Float] Requests per second
48
48
  # @param notification_type [String] The type of notification. For more information about notification types, refer
49
49
  # to [Notification Type Values](https://developer-docs.amazon.com/sp-api/docs/notification-type-values).
50
- # @return [Hash] The API response
50
+ # @return [Peddler::Response] The API response
51
51
  def create_subscription(body, notification_type, rate_limit: 1.0)
52
52
  path = "/notifications/v1/subscriptions/#{notification_type}"
53
53
 
@@ -63,7 +63,7 @@ module Peddler
63
63
  # @param rate_limit [Float] Requests per second
64
64
  # @param notification_type [String] The type of notification. For more information about notification types, refer
65
65
  # to [Notification Type Values](https://developer-docs.amazon.com/sp-api/docs/notification-type-values).
66
- # @return [Hash] The API response
66
+ # @return [Peddler::Response] The API response
67
67
  def get_subscription_by_id(subscription_id, notification_type, rate_limit: 1.0)
68
68
  path = "/notifications/v1/subscriptions/#{notification_type}/#{subscription_id}"
69
69
 
@@ -81,7 +81,7 @@ module Peddler
81
81
  # @param rate_limit [Float] Requests per second
82
82
  # @param notification_type [String] The type of notification. For more information about notification types, refer
83
83
  # to [Notification Type Values](https://developer-docs.amazon.com/sp-api/docs/notification-type-values).
84
- # @return [Hash] The API response
84
+ # @return [Peddler::Response] The API response
85
85
  def delete_subscription_by_id(subscription_id, notification_type, rate_limit: 1.0)
86
86
  path = "/notifications/v1/subscriptions/#{notification_type}/#{subscription_id}"
87
87
 
@@ -93,7 +93,7 @@ module Peddler
93
93
  #
94
94
  # @note This operation can make a static sandbox call.
95
95
  # @param rate_limit [Float] Requests per second
96
- # @return [Hash] The API response
96
+ # @return [Peddler::Response] The API response
97
97
  def get_destinations(rate_limit: 1.0)
98
98
  path = "/notifications/v1/destinations"
99
99
 
@@ -107,7 +107,7 @@ module Peddler
107
107
  # @note This operation can make a static sandbox call.
108
108
  # @param body [Hash]
109
109
  # @param rate_limit [Float] Requests per second
110
- # @return [Hash] The API response
110
+ # @return [Peddler::Response] The API response
111
111
  def create_destination(body, rate_limit: 1.0)
112
112
  path = "/notifications/v1/destinations"
113
113
 
@@ -121,7 +121,7 @@ module Peddler
121
121
  # @note This operation can make a static sandbox call.
122
122
  # @param destination_id [String] The identifier generated when you created the destination.
123
123
  # @param rate_limit [Float] Requests per second
124
- # @return [Hash] The API response
124
+ # @return [Peddler::Response] The API response
125
125
  def get_destination(destination_id, rate_limit: 1.0)
126
126
  path = "/notifications/v1/destinations/#{destination_id}"
127
127
 
@@ -134,7 +134,7 @@ module Peddler
134
134
  # @note This operation can make a static sandbox call.
135
135
  # @param destination_id [String] The identifier for the destination that you want to delete.
136
136
  # @param rate_limit [Float] Requests per second
137
- # @return [Hash] The API response
137
+ # @return [Peddler::Response] The API response
138
138
  def delete_destination(destination_id, rate_limit: 1.0)
139
139
  path = "/notifications/v1/destinations/#{destination_id}"
140
140