peddler 3.0.0 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
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,12 +5,12 @@ require "peddler/api"
5
5
  module Peddler
6
6
  class << self
7
7
  def orders_v0(...)
8
- API::OrdersV0.new(...)
8
+ APIs::OrdersV0.new(...)
9
9
  end
10
10
  end
11
11
 
12
- class API
13
- # Selling Partner API for Orders
12
+ module APIs
13
+ # Orders v0
14
14
  #
15
15
  # Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop
16
16
  # fast, flexible, and custom applications to manage order synchronization, perform order research, and create
@@ -110,7 +110,7 @@ module Peddler
110
110
  # at) a specified time. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601)
111
111
  # format.
112
112
  # @param rate_limit [Float] Requests per second
113
- # @return [Hash] The API response
113
+ # @return [Peddler::Response] The API response
114
114
  def get_orders(marketplace_ids, created_after: nil, created_before: nil, last_updated_after: nil,
115
115
  last_updated_before: nil, order_statuses: nil, fulfillment_channels: nil, payment_methods: nil,
116
116
  buyer_email: nil, seller_order_id: nil, max_results_per_page: nil, easy_ship_shipment_statuses: nil,
@@ -152,7 +152,7 @@ module Peddler
152
152
  # @note This operation can make a static sandbox call.
153
153
  # @param order_id [String] An Amazon-defined order identifier, in 3-7-7 format.
154
154
  # @param rate_limit [Float] Requests per second
155
- # @return [Hash] The API response
155
+ # @return [Peddler::Response] The API response
156
156
  def get_order(order_id, rate_limit: 0.5)
157
157
  path = "/orders/v0/orders/#{order_id}"
158
158
 
@@ -164,7 +164,7 @@ module Peddler
164
164
  # @note This operation can make a static sandbox call.
165
165
  # @param order_id [String] An `orderId` is an Amazon-defined order identifier, in 3-7-7 format.
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 get_order_buyer_info(order_id, rate_limit: 0.5)
169
169
  path = "/orders/v0/orders/#{order_id}/buyerInfo"
170
170
 
@@ -176,7 +176,7 @@ module Peddler
176
176
  # @note This operation can make a static sandbox call.
177
177
  # @param order_id [String] An `orderId` is an Amazon-defined order identifier, in 3-7-7 format.
178
178
  # @param rate_limit [Float] Requests per second
179
- # @return [Hash] The API response
179
+ # @return [Peddler::Response] The API response
180
180
  def get_order_address(order_id, rate_limit: 0.5)
181
181
  path = "/orders/v0/orders/#{order_id}/address"
182
182
 
@@ -195,7 +195,7 @@ module Peddler
195
195
  # @param order_id [String] An Amazon-defined order identifier, in 3-7-7 format.
196
196
  # @param next_token [String] A string token returned in the response of your previous request.
197
197
  # @param rate_limit [Float] Requests per second
198
- # @return [Hash] The API response
198
+ # @return [Peddler::Response] The API response
199
199
  def get_order_items(order_id, next_token: nil, rate_limit: 0.5)
200
200
  path = "/orders/v0/orders/#{order_id}/orderItems"
201
201
  params = {
@@ -211,7 +211,7 @@ module Peddler
211
211
  # @param order_id [String] An Amazon-defined order identifier, in 3-7-7 format.
212
212
  # @param next_token [String] A string token returned in the response of your previous request.
213
213
  # @param rate_limit [Float] Requests per second
214
- # @return [Hash] The API response
214
+ # @return [Peddler::Response] The API response
215
215
  def get_order_items_buyer_info(order_id, next_token: nil, rate_limit: 0.5)
216
216
  path = "/orders/v0/orders/#{order_id}/orderItems/buyerInfo"
217
217
  params = {
@@ -227,7 +227,7 @@ module Peddler
227
227
  # @param order_id [String] An Amazon-defined order identifier, in 3-7-7 format.
228
228
  # @param payload [Hash] The request body for the `updateShipmentStatus` operation.
229
229
  # @param rate_limit [Float] Requests per second
230
- # @return [Hash] The API response
230
+ # @return [Peddler::Response] The API response
231
231
  def update_shipment_status(order_id, payload, rate_limit: 5.0)
232
232
  path = "/orders/v0/orders/#{order_id}/shipment"
233
233
  body = payload
@@ -240,7 +240,7 @@ module Peddler
240
240
  # @note This operation can make a static sandbox call.
241
241
  # @param order_id [String] An Amazon-defined order identifier, in 3-7-7 format.
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 get_order_regulated_info(order_id, rate_limit: 0.5)
245
245
  path = "/orders/v0/orders/#{order_id}/regulatedInfo"
246
246
 
@@ -253,7 +253,7 @@ module Peddler
253
253
  # @param order_id [String] An Amazon-defined order identifier, in 3-7-7 format.
254
254
  # @param payload [Hash] The request body for the `updateVerificationStatus` operation.
255
255
  # @param rate_limit [Float] Requests per second
256
- # @return [Hash] The API response
256
+ # @return [Peddler::Response] The API response
257
257
  def update_verification_status(order_id, payload, rate_limit: 0.5)
258
258
  path = "/orders/v0/orders/#{order_id}/regulatedInfo"
259
259
  body = payload
@@ -267,7 +267,7 @@ module Peddler
267
267
  # @param order_id [String] An Amazon-defined order identifier, in 3-7-7 format.
268
268
  # @param payload [Hash] Request body of `confirmShipment`.
269
269
  # @param rate_limit [Float] Requests per second
270
- # @return [Hash] The API response
270
+ # @return [Peddler::Response] The API response
271
271
  def confirm_shipment(order_id, payload, rate_limit: 2.0)
272
272
  path = "/orders/v0/orders/#{order_id}/shipmentConfirmation"
273
273
  body = payload
@@ -5,11 +5,11 @@ require "peddler/api"
5
5
  module Peddler
6
6
  class << self
7
7
  def product_fees_v0(...)
8
- API::ProductFeesV0.new(...)
8
+ APIs::ProductFeesV0.new(...)
9
9
  end
10
10
  end
11
11
 
12
- class API
12
+ module APIs
13
13
  # Selling Partner API for Product Fees
14
14
  #
15
15
  # The Selling Partner API for Product Fees lets you programmatically retrieve estimated fees for a product. You can
@@ -33,7 +33,7 @@ module Peddler
33
33
  # @param seller_sku [String] Used to identify an item in the given marketplace. SellerSKU is qualified by the
34
34
  # seller's SellerId, which is included with every operation that you submit.
35
35
  # @param rate_limit [Float] Requests per second
36
- # @return [Hash] The API response
36
+ # @return [Peddler::Response] The API response
37
37
  def get_my_fees_estimate_for_sku(body, seller_sku, rate_limit: 1.0)
38
38
  path = "/products/fees/v0/listings/#{seller_sku}/feesEstimate"
39
39
 
@@ -54,7 +54,7 @@ module Peddler
54
54
  # @param body [Hash]
55
55
  # @param asin [String] The Amazon Standard Identification Number (ASIN) of the item.
56
56
  # @param rate_limit [Float] Requests per second
57
- # @return [Hash] The API response
57
+ # @return [Peddler::Response] The API response
58
58
  def get_my_fees_estimate_for_asin(body, asin, rate_limit: 1.0)
59
59
  path = "/products/fees/v0/items/#{asin}/feesEstimate"
60
60
 
@@ -66,7 +66,7 @@ module Peddler
66
66
  # @note This operation can make a static sandbox call.
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 get_my_fees_estimates(body, rate_limit: 0.5)
71
71
  path = "/products/fees/v0/feesEstimate"
72
72
 
@@ -5,11 +5,11 @@ require "peddler/api"
5
5
  module Peddler
6
6
  class << self
7
7
  def product_pricing_2022_05_01(...)
8
- API::ProductPricing20220501.new(...)
8
+ APIs::ProductPricing20220501.new(...)
9
9
  end
10
10
  end
11
11
 
12
- class API
12
+ module APIs
13
13
  # Selling Partner API for Pricing
14
14
  #
15
15
  # The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer pricing
@@ -19,15 +19,15 @@ module Peddler
19
19
  # Returns the set of responses that correspond to the batched list of up to 40 requests defined in the request
20
20
  # body. The response for each successful (HTTP status code 200) request in the set includes the computed listing
21
21
  # price at or below which a seller can expect to become the featured offer (before applicable promotions). This is
22
- # called the featured offer expected price (FOEP). Featured offer is not guaranteed, because competing offers may
23
- # change, and different offers may be featured based on other factors, including fulfillment capabilities to a
24
- # specific customer. The response to an unsuccessful request includes the available error text.
22
+ # called the featured offer expected price (FOEP). Featured offer is not guaranteed because competing offers might
23
+ # change. Other offers might be featured based on factors such as fulfillment capabilities to a specific customer.
24
+ # The response to an unsuccessful request includes the available error text.
25
25
  #
26
26
  # @note This operation can make a static sandbox call.
27
27
  # @param get_featured_offer_expected_price_batch_request_body [Hash] The batch of `getFeaturedOfferExpectedPrice`
28
28
  # requests.
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_featured_offer_expected_price_batch(get_featured_offer_expected_price_batch_request_body,
32
32
  rate_limit: 0.033)
33
33
  path = "/batches/products/pricing/2022-05-01/offer/featuredOfferExpectedPrice"
@@ -36,13 +36,13 @@ module Peddler
36
36
  meter(rate_limit).post(path, body:)
37
37
  end
38
38
 
39
- # Returns the competitive summary response including featured buying options for the ASIN and `marketplaceId`
39
+ # Returns the competitive summary response, including featured buying options for the ASIN and `marketplaceId`
40
40
  # combination.
41
41
  #
42
42
  # @note This operation can make a static sandbox call.
43
43
  # @param requests [Hash] The batch of `getCompetitiveSummary` requests.
44
44
  # @param rate_limit [Float] Requests per second
45
- # @return [Hash] The API response
45
+ # @return [Peddler::Response] The API response
46
46
  def get_competitive_summary(requests, rate_limit: 0.033)
47
47
  path = "/batches/products/pricing/2022-05-01/items/competitiveSummary"
48
48
  body = requests
@@ -5,11 +5,11 @@ require "peddler/api"
5
5
  module Peddler
6
6
  class << self
7
7
  def product_pricing_v0(...)
8
- API::ProductPricingV0.new(...)
8
+ APIs::ProductPricingV0.new(...)
9
9
  end
10
10
  end
11
11
 
12
- class API
12
+ module APIs
13
13
  # Selling Partner API for Pricing
14
14
  #
15
15
  # The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for
@@ -36,7 +36,7 @@ module Peddler
36
36
  # @param offer_type [String] Indicates whether to request pricing information for the seller's B2C or B2B offers.
37
37
  # Default is B2C.
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_pricing(marketplace_id, item_type, asins: nil, skus: nil, item_condition: nil, offer_type: nil,
41
41
  rate_limit: 0.5)
42
42
  path = "/products/pricing/v0/price"
@@ -71,7 +71,7 @@ module Peddler
71
71
  # @param customer_type [String] Indicates whether to request pricing information from the point of view of
72
72
  # Consumer or Business buyers. Default is Consumer.
73
73
  # @param rate_limit [Float] Requests per second
74
- # @return [Hash] The API response
74
+ # @return [Peddler::Response] The API response
75
75
  def get_competitive_pricing(marketplace_id, item_type, asins: nil, skus: nil, customer_type: nil, rate_limit: 0.5)
76
76
  path = "/products/pricing/v0/competitivePrice"
77
77
  params = {
@@ -98,7 +98,7 @@ module Peddler
98
98
  # SellerId, which is included with every operation that you submit.
99
99
  # @param customer_type [String] Indicates whether to request Consumer or Business offers. Default is Consumer.
100
100
  # @param rate_limit [Float] Requests per second
101
- # @return [Hash] The API response
101
+ # @return [Peddler::Response] The API response
102
102
  def get_listing_offers(marketplace_id, item_condition, seller_sku, customer_type: nil, rate_limit: 1.0)
103
103
  path = "/products/pricing/v0/listings/#{seller_sku}/offers"
104
104
  params = {
@@ -120,7 +120,7 @@ module Peddler
120
120
  # @param asin [String] The Amazon Standard Identification Number (ASIN) of the item.
121
121
  # @param customer_type [String] Indicates whether to request Consumer or Business offers. Default is Consumer.
122
122
  # @param rate_limit [Float] Requests per second
123
- # @return [Hash] The API response
123
+ # @return [Peddler::Response] The API response
124
124
  def get_item_offers(marketplace_id, item_condition, asin, customer_type: nil, rate_limit: 0.5)
125
125
  path = "/products/pricing/v0/items/#{asin}/offers"
126
126
  params = {
@@ -137,7 +137,7 @@ module Peddler
137
137
  # @note This operation can make a static sandbox call.
138
138
  # @param get_item_offers_batch_request_body [Hash]
139
139
  # @param rate_limit [Float] Requests per second
140
- # @return [Hash] The API response
140
+ # @return [Peddler::Response] The API response
141
141
  def get_item_offers_batch(get_item_offers_batch_request_body, rate_limit: 0.1)
142
142
  path = "/batches/products/pricing/v0/itemOffers"
143
143
  body = get_item_offers_batch_request_body
@@ -150,7 +150,7 @@ module Peddler
150
150
  # @note This operation can make a static sandbox call.
151
151
  # @param get_listing_offers_batch_request_body [Hash]
152
152
  # @param rate_limit [Float] Requests per second
153
- # @return [Hash] The API response
153
+ # @return [Peddler::Response] The API response
154
154
  def get_listing_offers_batch(get_listing_offers_batch_request_body, rate_limit: 0.5)
155
155
  path = "/batches/products/pricing/v0/listingOffers"
156
156
  body = get_listing_offers_batch_request_body
@@ -5,11 +5,11 @@ require "peddler/api"
5
5
  module Peddler
6
6
  class << self
7
7
  def product_type_definitions_2020_09_01(...)
8
- API::ProductTypeDefinitions20200901.new(...)
8
+ APIs::ProductTypeDefinitions20200901.new(...)
9
9
  end
10
10
  end
11
11
 
12
- class API
12
+ module APIs
13
13
  # Selling Partner API for Product Type Definitions
14
14
  #
15
15
  # The Selling Partner API for Product Type Definitions provides programmatic access to attribute and data
@@ -32,7 +32,7 @@ module Peddler
32
32
  # @param search_locale [String] The locale used for the `keywords` and `itemName` parameters. Defaults to the
33
33
  # primary locale of the marketplace.
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 search_definitions_product_types(marketplace_ids, keywords: nil, item_name: nil, locale: nil,
37
37
  search_locale: nil, rate_limit: 5.0)
38
38
  path = "/definitions/2020-09-01/productTypes"
@@ -66,7 +66,7 @@ module Peddler
66
66
  # @param locale [String] Locale for retrieving display labels and other presentation details. Defaults to the
67
67
  # default language of the first marketplace in the request.
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 get_definitions_product_type(product_type, marketplace_ids, seller_id: nil, product_type_version: "LATEST",
71
71
  requirements: "LISTING", requirements_enforced: "ENFORCED", locale: "DEFAULT", rate_limit: 5.0)
72
72
  path = "/definitions/2020-09-01/productTypes/#{product_type}"
@@ -5,11 +5,11 @@ require "peddler/api"
5
5
  module Peddler
6
6
  class << self
7
7
  def replenishment_2022_11_07(...)
8
- API::Replenishment20221107.new(...)
8
+ APIs::Replenishment20221107.new(...)
9
9
  end
10
10
  end
11
11
 
12
- class API
12
+ module APIs
13
13
  # Selling Partner API for Replenishment
14
14
  #
15
15
  # The Selling Partner API for Replenishment (Replenishment API) provides programmatic access to replenishment
@@ -22,7 +22,7 @@ module Peddler
22
22
  # @note This operation can make a static sandbox call.
23
23
  # @param body [Hash] The request body for the `getSellingPartnerMetrics` operation.
24
24
  # @param rate_limit [Float] Requests per second
25
- # @return [Hash] The API response
25
+ # @return [Peddler::Response] The API response
26
26
  def get_selling_partner_metrics(body: nil, rate_limit: 1.0)
27
27
  path = "/replenishment/2022-11-07/sellingPartners/metrics/search"
28
28
 
@@ -34,7 +34,7 @@ module Peddler
34
34
  # @note This operation can make a static sandbox call.
35
35
  # @param body [Hash] The request body for the `listOfferMetrics` operation.
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 list_offer_metrics(body: nil, rate_limit: 1.0)
39
39
  path = "/replenishment/2022-11-07/offers/metrics/search"
40
40
 
@@ -46,7 +46,7 @@ module Peddler
46
46
  # @note This operation can make a static sandbox call.
47
47
  # @param body [Hash] The request body for the `listOffers` operation.
48
48
  # @param rate_limit [Float] Requests per second
49
- # @return [Hash] The API response
49
+ # @return [Peddler::Response] The API response
50
50
  def list_offers(body: nil, rate_limit: 1.0)
51
51
  path = "/replenishment/2022-11-07/offers/search"
52
52
 
@@ -5,12 +5,12 @@ require "peddler/api"
5
5
  module Peddler
6
6
  class << self
7
7
  def reports_2021_06_30(...)
8
- API::Reports20210630.new(...)
8
+ APIs::Reports20210630.new(...)
9
9
  end
10
10
  end
11
11
 
12
- class API
13
- # Selling Partner API for Reports
12
+ module APIs
13
+ # Report v2021-06-30
14
14
  #
15
15
  # The Selling Partner API for Reports lets you retrieve and manage a variety of reports that can help selling
16
16
  # partners manage their businesses.
@@ -36,7 +36,7 @@ module Peddler
36
36
  # call the `getReports` operation and include this token as the only parameter. Specifying `nextToken` with any
37
37
  # other parameters will cause the request to fail.
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_reports(report_types: nil, processing_statuses: nil, marketplace_ids: nil, page_size: 10,
41
41
  created_since: nil, created_until: nil, next_token: nil, rate_limit: 0.0222)
42
42
  path = "/reports/2021-06-30/reports"
@@ -58,7 +58,7 @@ module Peddler
58
58
  # @note This operation can make a static sandbox call.
59
59
  # @param body [Hash] Information required to create the report.
60
60
  # @param rate_limit [Float] Requests per second
61
- # @return [Hash] The API response
61
+ # @return [Peddler::Response] The API response
62
62
  def create_report(body, rate_limit: 0.0167)
63
63
  path = "/reports/2021-06-30/reports"
64
64
 
@@ -72,7 +72,7 @@ module Peddler
72
72
  # @param report_id [String] The identifier for the report. This identifier is unique only in combination with a
73
73
  # seller ID.
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 cancel_report(report_id, rate_limit: 0.0222)
77
77
  path = "/reports/2021-06-30/reports/#{report_id}"
78
78
 
@@ -85,7 +85,7 @@ module Peddler
85
85
  # @param report_id [String] The identifier for the report. This identifier is unique only in combination with a
86
86
  # seller ID.
87
87
  # @param rate_limit [Float] Requests per second
88
- # @return [Hash] The API response
88
+ # @return [Peddler::Response] The API response
89
89
  def get_report(report_id, rate_limit: 2.0)
90
90
  path = "/reports/2021-06-30/reports/#{report_id}"
91
91
 
@@ -98,7 +98,7 @@ module Peddler
98
98
  # @param report_types [Array<String>] A list of report types used to filter report schedules. Refer to [Report
99
99
  # Type Values](https://developer-docs.amazon.com/sp-api/docs/report-type-values) for more information.
100
100
  # @param rate_limit [Float] Requests per second
101
- # @return [Hash] The API response
101
+ # @return [Peddler::Response] The API response
102
102
  def get_report_schedules(report_types, rate_limit: 0.0222)
103
103
  path = "/reports/2021-06-30/schedules"
104
104
  params = {
@@ -114,7 +114,7 @@ module Peddler
114
114
  # @note This operation can make a static sandbox call.
115
115
  # @param body [Hash] Information required to create the report schedule.
116
116
  # @param rate_limit [Float] Requests per second
117
- # @return [Hash] The API response
117
+ # @return [Peddler::Response] The API response
118
118
  def create_report_schedule(body, rate_limit: 0.0222)
119
119
  path = "/reports/2021-06-30/schedules"
120
120
 
@@ -127,7 +127,7 @@ module Peddler
127
127
  # @param report_schedule_id [String] The identifier for the report schedule. This identifier is unique only in
128
128
  # combination with a seller ID.
129
129
  # @param rate_limit [Float] Requests per second
130
- # @return [Hash] The API response
130
+ # @return [Peddler::Response] The API response
131
131
  def cancel_report_schedule(report_schedule_id, rate_limit: 0.0222)
132
132
  path = "/reports/2021-06-30/schedules/#{report_schedule_id}"
133
133
 
@@ -140,7 +140,7 @@ module Peddler
140
140
  # @param report_schedule_id [String] The identifier for the report schedule. This identifier is unique only in
141
141
  # combination with a seller ID.
142
142
  # @param rate_limit [Float] Requests per second
143
- # @return [Hash] The API response
143
+ # @return [Peddler::Response] The API response
144
144
  def get_report_schedule(report_schedule_id, rate_limit: 0.0222)
145
145
  path = "/reports/2021-06-30/schedules/#{report_schedule_id}"
146
146
 
@@ -152,7 +152,7 @@ module Peddler
152
152
  # @note This operation can make a static sandbox call.
153
153
  # @param report_document_id [String] The identifier for the report document.
154
154
  # @param rate_limit [Float] Requests per second
155
- # @return [Hash] The API response
155
+ # @return [Peddler::Response] The API response
156
156
  def get_report_document(report_document_id, rate_limit: 0.0167)
157
157
  path = "/reports/2021-06-30/documents/#{report_document_id}"
158
158
 
@@ -5,11 +5,11 @@ require "peddler/api"
5
5
  module Peddler
6
6
  class << self
7
7
  def sales_v1(...)
8
- API::SalesV1.new(...)
8
+ APIs::SalesV1.new(...)
9
9
  end
10
10
  end
11
11
 
12
- class API
12
+ module APIs
13
13
  # Selling Partner API for Sales
14
14
  #
15
15
  # The Selling Partner API for Sales provides APIs related to sales performance.
@@ -54,7 +54,7 @@ module Peddler
54
54
  # error. Do not include this filter if you want the response to include order metrics for all SKUs. Example:
55
55
  # TestSKU, if you want the response to include order metrics for only SKU TestSKU.
56
56
  # @param rate_limit [Float] Requests per second
57
- # @return [Hash] The API response
57
+ # @return [Peddler::Response] The API response
58
58
  def get_order_metrics(marketplace_ids, interval, granularity, granularity_time_zone: nil, buyer_type: "All",
59
59
  fulfillment_network: nil, first_day_of_week: "Monday", asin: nil, sku: nil, rate_limit: 0.5)
60
60
  path = "/sales/v1/orderMetrics"
@@ -5,11 +5,11 @@ require "peddler/api"
5
5
  module Peddler
6
6
  class << self
7
7
  def sellers_v1(...)
8
- API::SellersV1.new(...)
8
+ APIs::SellersV1.new(...)
9
9
  end
10
10
  end
11
11
 
12
- class API
12
+ module APIs
13
13
  # Selling Partner API for Sellers
14
14
  #
15
15
  # The [Selling Partner API for Sellers](https://developer-docs.amazon.com/sp-api/docs/sellers-api-v1-reference)
@@ -23,7 +23,7 @@ module Peddler
23
23
  #
24
24
  # @note This operation can make a static sandbox call.
25
25
  # @param rate_limit [Float] Requests per second
26
- # @return [Hash] The API response
26
+ # @return [Peddler::Response] The API response
27
27
  def get_marketplace_participations(rate_limit: 0.016)
28
28
  path = "/sellers/v1/marketplaceParticipations"
29
29
 
@@ -34,7 +34,7 @@ module Peddler
34
34
  #
35
35
  # @note This operation can make a static sandbox call.
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 get_account(rate_limit: 0.016)
39
39
  path = "/sellers/v1/account"
40
40
 
@@ -5,11 +5,11 @@ require "peddler/api"
5
5
  module Peddler
6
6
  class << self
7
7
  def services_v1(...)
8
- API::ServicesV1.new(...)
8
+ APIs::ServicesV1.new(...)
9
9
  end
10
10
  end
11
11
 
12
- class API
12
+ module APIs
13
13
  # Selling Partner API for Services
14
14
  #
15
15
  # With the Services API, you can build applications that help service providers get and modify their service orders
@@ -20,7 +20,7 @@ module Peddler
20
20
  # @note This operation can make a static sandbox call.
21
21
  # @param service_job_id [String] A service job 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_service_job_by_service_job_id(service_job_id, rate_limit: 20.0)
25
25
  path = "/service/v1/serviceJobs/#{service_job_id}"
26
26
 
@@ -34,7 +34,7 @@ module Peddler
34
34
  # @param cancellation_reason_code [String] A cancel reason code that specifies the reason for cancelling a service
35
35
  # job.
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 cancel_service_job_by_service_job_id(service_job_id, cancellation_reason_code, rate_limit: 5.0)
39
39
  path = "/service/v1/serviceJobs/#{service_job_id}/cancellations"
40
40
  params = {
@@ -49,7 +49,7 @@ module Peddler
49
49
  # @note This operation can make a static sandbox call.
50
50
  # @param service_job_id [String] An Amazon defined service job identifier.
51
51
  # @param rate_limit [Float] Requests per second
52
- # @return [Hash] The API response
52
+ # @return [Peddler::Response] The API response
53
53
  def complete_service_job_by_service_job_id(service_job_id, rate_limit: 5.0)
54
54
  path = "/service/v1/serviceJobs/#{service_job_id}/completions"
55
55
 
@@ -90,7 +90,7 @@ module Peddler
90
90
  # @param store_ids [Array<String>] List of Amazon-defined identifiers for the region scope. Max values supported
91
91
  # is 50.
92
92
  # @param rate_limit [Float] Requests per second
93
- # @return [Hash] The API response
93
+ # @return [Peddler::Response] The API response
94
94
  def get_service_jobs(marketplace_ids, service_order_ids: nil, service_job_status: nil, page_token: nil,
95
95
  page_size: 20, sort_field: nil, sort_order: nil, created_after: nil, created_before: nil,
96
96
  last_updated_after: nil, last_updated_before: nil, schedule_start_date: nil, schedule_end_date: nil, asins: nil,
@@ -124,7 +124,7 @@ module Peddler
124
124
  # @param service_job_id [String] An Amazon defined service job identifier.
125
125
  # @param body [Hash] Add appointment operation input details.
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 add_appointment_for_service_job_by_service_job_id(service_job_id, body, rate_limit: 5.0)
129
129
  path = "/service/v1/serviceJobs/#{service_job_id}/appointments"
130
130
 
@@ -138,7 +138,7 @@ module Peddler
138
138
  # @param appointment_id [String] An existing appointment identifier for the Service Job.
139
139
  # @param body [Hash] Reschedule appointment operation input details.
140
140
  # @param rate_limit [Float] Requests per second
141
- # @return [Hash] The API response
141
+ # @return [Peddler::Response] The API response
142
142
  def reschedule_appointment_for_service_job_by_service_job_id(service_job_id, appointment_id, body,
143
143
  rate_limit: 5.0)
144
144
  path = "/service/v1/serviceJobs/#{service_job_id}/appointments/#{appointment_id}"
@@ -154,7 +154,7 @@ module Peddler
154
154
  # @param appointment_id [String] An Amazon-defined identifier of active service job appointment.
155
155
  # @param body [Hash]
156
156
  # @param rate_limit [Float] Requests per second
157
- # @return [Hash] The API response
157
+ # @return [Peddler::Response] The API response
158
158
  def assign_appointment_resources(service_job_id, appointment_id, body, rate_limit: 1.0)
159
159
  path = "/service/v1/serviceJobs/#{service_job_id}/appointments/#{appointment_id}/resources"
160
160
 
@@ -169,7 +169,7 @@ module Peddler
169
169
  # @param appointment_id [String] An Amazon-defined identifier of active service job appointment.
170
170
  # @param body [Hash] Appointment fulfillment data collection details.
171
171
  # @param rate_limit [Float] Requests per second
172
- # @return [Hash] The API response
172
+ # @return [Peddler::Response] The API response
173
173
  def set_appointment_fulfillment_data(service_job_id, appointment_id, body, rate_limit: 5.0)
174
174
  path = "/service/v1/serviceJobs/#{service_job_id}/appointments/#{appointment_id}/fulfillment"
175
175
 
@@ -184,7 +184,7 @@ module Peddler
184
184
  # @param marketplace_ids [Array<String>] An identifier for the marketplace in which the resource operates.
185
185
  # @param next_page_token [String] Next page token returned in the response of your previous request.
186
186
  # @param rate_limit [Float] Requests per second
187
- # @return [Hash] The API response
187
+ # @return [Peddler::Response] The API response
188
188
  def get_range_slot_capacity(resource_id, body, marketplace_ids, next_page_token: nil, rate_limit: 5.0)
189
189
  path = "/service/v1/serviceResources/#{resource_id}/capacity/range"
190
190
  params = {
@@ -203,7 +203,7 @@ module Peddler
203
203
  # @param marketplace_ids [Array<String>] An identifier for the marketplace in which the resource operates.
204
204
  # @param next_page_token [String] Next page token returned in the response of your previous request.
205
205
  # @param rate_limit [Float] Requests per second
206
- # @return [Hash] The API response
206
+ # @return [Peddler::Response] The API response
207
207
  def get_fixed_slot_capacity(resource_id, body, marketplace_ids, next_page_token: nil, rate_limit: 5.0)
208
208
  path = "/service/v1/serviceResources/#{resource_id}/capacity/fixed"
209
209
  params = {
@@ -221,7 +221,7 @@ module Peddler
221
221
  # @param body [Hash] Schedule details
222
222
  # @param marketplace_ids [Array<String>] An identifier for the marketplace in which the resource operates.
223
223
  # @param rate_limit [Float] Requests per second
224
- # @return [Hash] The API response
224
+ # @return [Peddler::Response] The API response
225
225
  def update_schedule(resource_id, body, marketplace_ids, rate_limit: 5.0)
226
226
  path = "/service/v1/serviceResources/#{resource_id}/schedules"
227
227
  params = {
@@ -237,7 +237,7 @@ module Peddler
237
237
  # @param body [Hash] Reservation details
238
238
  # @param marketplace_ids [Array<String>] An identifier for the marketplace in which the resource operates.
239
239
  # @param rate_limit [Float] Requests per second
240
- # @return [Hash] The API response
240
+ # @return [Peddler::Response] The API response
241
241
  def create_reservation(body, marketplace_ids, rate_limit: 5.0)
242
242
  path = "/service/v1/reservation"
243
243
  params = {
@@ -254,7 +254,7 @@ module Peddler
254
254
  # @param body [Hash] Reservation details
255
255
  # @param marketplace_ids [Array<String>] An identifier for the marketplace in which the resource operates.
256
256
  # @param rate_limit [Float] Requests per second
257
- # @return [Hash] The API response
257
+ # @return [Peddler::Response] The API response
258
258
  def update_reservation(reservation_id, body, marketplace_ids, rate_limit: 5.0)
259
259
  path = "/service/v1/reservation/#{reservation_id}"
260
260
  params = {
@@ -270,7 +270,7 @@ module Peddler
270
270
  # @param reservation_id [String] Reservation Identifier
271
271
  # @param marketplace_ids [Array<String>] An identifier for the marketplace in which the resource operates.
272
272
  # @param rate_limit [Float] Requests per second
273
- # @return [Hash] The API response
273
+ # @return [Peddler::Response] The API response
274
274
  def cancel_reservation(reservation_id, marketplace_ids, rate_limit: 5.0)
275
275
  path = "/service/v1/reservation/#{reservation_id}"
276
276
  params = {
@@ -292,7 +292,7 @@ module Peddler
292
292
  # in ISO 8601 format. If `endTime` is provided, `startTime` should also be provided. Default value is as per
293
293
  # business configuration. Maximum range of appointment slots can be 90 days.
294
294
  # @param rate_limit [Float] Requests per second
295
- # @return [Hash] The API response
295
+ # @return [Peddler::Response] The API response
296
296
  def get_appointmment_slots_by_job_id(service_job_id, marketplace_ids, start_time: nil, end_time: nil,
297
297
  rate_limit: 5.0)
298
298
  path = "/service/v1/serviceJobs/#{service_job_id}/appointmentSlots"
@@ -318,7 +318,7 @@ module Peddler
318
318
  # in ISO 8601 format. If `endTime` is provided, `startTime` should also be provided. Default value is as per
319
319
  # business configuration. Maximum range of appointment slots can be 90 days.
320
320
  # @param rate_limit [Float] Requests per second
321
- # @return [Hash] The API response
321
+ # @return [Peddler::Response] The API response
322
322
  def get_appointment_slots(asin, store_id, marketplace_ids, start_time: nil, end_time: nil, rate_limit: 20.0)
323
323
  path = "/service/v1/appointmentSlots"
324
324
  params = {
@@ -337,7 +337,7 @@ module Peddler
337
337
  # @note This operation can make a static sandbox call.
338
338
  # @param body [Hash] Upload document operation input details.
339
339
  # @param rate_limit [Float] Requests per second
340
- # @return [Hash] The API response
340
+ # @return [Peddler::Response] The API response
341
341
  def create_service_document_upload_destination(body, rate_limit: 5.0)
342
342
  path = "/service/v1/documents"
343
343