peddler 2.4.5 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +402 -140
  3. data/lib/peddler/api/amazon_warehousing_and_distribution_2024_05_09.rb +92 -0
  4. data/lib/peddler/api/aplus_content_2020_11_01.rb +246 -0
  5. data/lib/peddler/api/application_integrations_2024_04_01.rb +56 -0
  6. data/lib/peddler/api/application_management_2023_11_30.rb +35 -0
  7. data/lib/peddler/api/catalog_items_2020_12_01.rb +81 -0
  8. data/lib/peddler/api/catalog_items_2022_04_01.rb +93 -0
  9. data/lib/peddler/api/catalog_items_v0.rb +103 -0
  10. data/lib/peddler/api/data_kiosk_2023_11_15.rb +108 -0
  11. data/lib/peddler/api/easy_ship_2022_03_23.rb +127 -0
  12. data/lib/peddler/api/fba_inbound_eligibility_v1.rb +44 -0
  13. data/lib/peddler/api/fba_inventory_v1.rb +122 -0
  14. data/lib/peddler/api/feeds_2021_06_30.rb +122 -0
  15. data/lib/peddler/api/finances_2024_06_19.rb +50 -0
  16. data/lib/peddler/api/finances_v0.rb +148 -0
  17. data/lib/peddler/api/fulfillment_inbound_2024_03_20.rb +759 -0
  18. data/lib/peddler/api/fulfillment_inbound_v0.rb +352 -0
  19. data/lib/peddler/api/fulfillment_outbound_2020_07_01.rb +259 -0
  20. data/lib/peddler/api/invoices_2024_06_19.rb +180 -0
  21. data/lib/peddler/api/listings_items_2020_09_01.rb +95 -0
  22. data/lib/peddler/api/listings_items_2021_08_01.rb +170 -0
  23. data/lib/peddler/api/listings_restrictions_2021_08_01.rb +47 -0
  24. data/lib/peddler/api/merchant_fulfillment_v0.rb +80 -0
  25. data/lib/peddler/api/messaging_v1.rb +273 -0
  26. data/lib/peddler/api/notifications_v1.rb +145 -0
  27. data/lib/peddler/api/orders_v0.rb +279 -0
  28. data/lib/peddler/api/product_fees_v0.rb +77 -0
  29. data/lib/peddler/api/product_pricing_2022_05_01.rb +54 -0
  30. data/lib/peddler/api/product_pricing_v0.rb +162 -0
  31. data/lib/peddler/api/product_type_definitions_2020_09_01.rb +86 -0
  32. data/lib/peddler/api/replenishment_2022_11_07.rb +57 -0
  33. data/lib/peddler/api/reports_2021_06_30.rb +163 -0
  34. data/lib/peddler/api/sales_v1.rb +77 -0
  35. data/lib/peddler/api/sellers_v1.rb +45 -0
  36. data/lib/peddler/api/services_v1.rb +348 -0
  37. data/lib/peddler/api/shipment_invoicing_v0.rb +59 -0
  38. data/lib/peddler/api/shipping_v1.rb +132 -0
  39. data/lib/peddler/api/shipping_v2.rb +319 -0
  40. data/lib/peddler/api/solicitations_v1.rb +63 -0
  41. data/lib/peddler/api/supply_sources_2020_07_01.rb +100 -0
  42. data/lib/peddler/api/tokens_2021_03_01.rb +38 -0
  43. data/lib/peddler/api/uploads_2020_11_01.rb +50 -0
  44. data/lib/peddler/api/vendor_direct_fulfillment_inventory_v1.rb +32 -0
  45. data/lib/peddler/api/vendor_direct_fulfillment_orders_2021_12_28.rb +84 -0
  46. data/lib/peddler/api/vendor_direct_fulfillment_orders_v1.rb +84 -0
  47. data/lib/peddler/api/vendor_direct_fulfillment_payments_v1.rb +31 -0
  48. data/lib/peddler/api/vendor_direct_fulfillment_sandbox_test_data_2021_10_28.rb +45 -0
  49. data/lib/peddler/api/vendor_direct_fulfillment_shipping_2021_12_28.rb +203 -0
  50. data/lib/peddler/api/vendor_direct_fulfillment_shipping_v1.rb +189 -0
  51. data/lib/peddler/api/vendor_direct_fulfillment_transactions_2021_12_28.rb +32 -0
  52. data/lib/peddler/api/vendor_direct_fulfillment_transactions_v1.rb +32 -0
  53. data/lib/peddler/api/vendor_invoices_v1.rb +30 -0
  54. data/lib/peddler/api/vendor_orders_v1.rb +159 -0
  55. data/lib/peddler/api/vendor_shipments_v1.rb +132 -0
  56. data/lib/peddler/api/vendor_transaction_status_v1.rb +33 -0
  57. data/lib/peddler/api.rb +138 -0
  58. data/lib/peddler/endpoint.rb +51 -0
  59. data/lib/peddler/error.rb +31 -0
  60. data/lib/peddler/marketplace.rb +38 -68
  61. data/lib/peddler/token.rb +70 -0
  62. data/lib/peddler/version.rb +1 -1
  63. data/lib/peddler.rb +56 -1
  64. metadata +74 -80
  65. data/lib/mws/easy_ship/client.rb +0 -93
  66. data/lib/mws/easy_ship.rb +0 -3
  67. data/lib/mws/feeds/client.rb +0 -122
  68. data/lib/mws/feeds.rb +0 -3
  69. data/lib/mws/finances/client.rb +0 -82
  70. data/lib/mws/finances.rb +0 -3
  71. data/lib/mws/fulfillment_inbound_shipment/client.rb +0 -388
  72. data/lib/mws/fulfillment_inbound_shipment.rb +0 -3
  73. data/lib/mws/fulfillment_inventory/client.rb +0 -57
  74. data/lib/mws/fulfillment_inventory.rb +0 -3
  75. data/lib/mws/fulfillment_outbound_shipment/client.rb +0 -211
  76. data/lib/mws/fulfillment_outbound_shipment.rb +0 -3
  77. data/lib/mws/merchant_fulfillment/client.rb +0 -87
  78. data/lib/mws/merchant_fulfillment.rb +0 -3
  79. data/lib/mws/off_amazon_payments.rb +0 -3
  80. data/lib/mws/orders/client.rb +0 -120
  81. data/lib/mws/orders.rb +0 -3
  82. data/lib/mws/products/client.rb +0 -268
  83. data/lib/mws/products.rb +0 -3
  84. data/lib/mws/recommendations/client.rb +0 -72
  85. data/lib/mws/recommendations.rb +0 -3
  86. data/lib/mws/reports/client.rb +0 -236
  87. data/lib/mws/reports.rb +0 -3
  88. data/lib/mws/sellers/client.rb +0 -44
  89. data/lib/mws/sellers.rb +0 -3
  90. data/lib/mws/shipment_invoicing/client.rb +0 -74
  91. data/lib/mws/shipment_invoicing.rb +0 -3
  92. data/lib/mws/subscriptions/client.rb +0 -179
  93. data/lib/mws/subscriptions.rb +0 -3
  94. data/lib/mws.rb +0 -29
  95. data/lib/peddler/client.rb +0 -159
  96. data/lib/peddler/errors/builder.rb +0 -64
  97. data/lib/peddler/errors/class_generator.rb +0 -40
  98. data/lib/peddler/errors/error.rb +0 -45
  99. data/lib/peddler/errors/parser.rb +0 -28
  100. data/lib/peddler/flat_file_parser.rb +0 -56
  101. data/lib/peddler/headers.rb +0 -102
  102. data/lib/peddler/operation.rb +0 -78
  103. data/lib/peddler/parser.rb +0 -33
  104. data/lib/peddler/structured_list.rb +0 -23
  105. data/lib/peddler/vcr_matcher.rb +0 -97
  106. data/lib/peddler/xml_parser.rb +0 -38
  107. data/lib/peddler/xml_response_parser.rb +0 -25
@@ -0,0 +1,92 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "peddler/api"
4
+
5
+ module Peddler
6
+ class << self
7
+ def amazon_warehousing_and_distribution_2024_05_09(...)
8
+ API::AmazonWarehousingAndDistribution20240509.new(...)
9
+ end
10
+ end
11
+
12
+ class API
13
+ # The Selling Partner API for Amazon Warehousing and Distribution
14
+ #
15
+ # The Selling Partner API for Amazon Warehousing and Distribution (AWD) provides programmatic access to information
16
+ # about AWD shipments and inventory.
17
+ class AmazonWarehousingAndDistribution20240509 < API
18
+ # Retrieves an AWD inbound shipment.
19
+ #
20
+ # @note This operation can make a static sandbox call.
21
+ # @param shipment_id [String] ID for the shipment. A shipment contains the cases being inbounded.
22
+ # @param sku_quantities [String] If equal to `SHOW`, the response includes the shipment SKU quantity details.
23
+ # Defaults to `HIDE`, in which case the response does not contain SKU quantities
24
+ # @param rate_limit [Float] Requests per second
25
+ # @return [Hash] The API response
26
+ def get_inbound_shipment(shipment_id, sku_quantities: nil, rate_limit: 2.0)
27
+ path = "/awd/2024-05-09/inboundShipments/#{shipment_id}"
28
+ params = {
29
+ "skuQuantities" => sku_quantities,
30
+ }.compact
31
+
32
+ meter(rate_limit).get(path, params:)
33
+ end
34
+
35
+ # Retrieves a summary of all the inbound AWD shipments associated with a merchant, with the ability to apply
36
+ # optional filters.
37
+ #
38
+ # @note This operation can make a static sandbox call.
39
+ # @param sort_by [String] Field to sort results by. By default, the response will be sorted by UPDATED_AT.
40
+ # @param sort_order [String] Sort the response in ASCENDING or DESCENDING order. By default, the response will be
41
+ # sorted in DESCENDING order.
42
+ # @param shipment_status [String] Filter by inbound shipment status.
43
+ # @param updated_after [String] List the inbound shipments that were updated after a certain time (inclusive). The
44
+ # date must be in {https://developer-docs.amazon.com/sp-api/docs/iso-8601 ISO 8601} format.
45
+ # @param updated_before [String] List the inbound shipments that were updated before a certain time (inclusive).
46
+ # The date must be in {https://developer-docs.amazon.com/sp-api/docs/iso-8601 ISO 8601} format.
47
+ # @param max_results [Integer] Maximum number of results to return.
48
+ # @param next_token [String] Token to retrieve the next set of paginated results.
49
+ # @param rate_limit [Float] Requests per second
50
+ # @return [Hash] The API response
51
+ def list_inbound_shipments(sort_by: nil, sort_order: nil, shipment_status: nil, updated_after: nil,
52
+ updated_before: nil, max_results: 25, next_token: nil, rate_limit: 1.0)
53
+ path = "/awd/2024-05-09/inboundShipments"
54
+ params = {
55
+ "sortBy" => sort_by,
56
+ "sortOrder" => sort_order,
57
+ "shipmentStatus" => shipment_status,
58
+ "updatedAfter" => updated_after,
59
+ "updatedBefore" => updated_before,
60
+ "maxResults" => max_results,
61
+ "nextToken" => next_token,
62
+ }.compact
63
+
64
+ meter(rate_limit).get(path, params:)
65
+ end
66
+
67
+ # Lists AWD inventory associated with a merchant with the ability to apply optional filters.
68
+ #
69
+ # @note This operation can make a static sandbox call.
70
+ # @param sku [String] Filter by seller or merchant SKU for the item.
71
+ # @param sort_order [String] Sort the response in `ASCENDING` or `DESCENDING` order.
72
+ # @param details [String] Set to `SHOW` to return summaries with additional inventory details. Defaults to `HIDE,`
73
+ # which returns only inventory summary totals.
74
+ # @param next_token [String] Token to retrieve the next set of paginated results.
75
+ # @param max_results [Integer] Maximum number of results to return.
76
+ # @param rate_limit [Float] Requests per second
77
+ # @return [Hash] The API response
78
+ def list_inventory(sku: nil, sort_order: nil, details: nil, next_token: nil, max_results: 25, rate_limit: 2.0)
79
+ path = "/awd/2024-05-09/inventory"
80
+ params = {
81
+ "sku" => sku,
82
+ "sortOrder" => sort_order,
83
+ "details" => details,
84
+ "nextToken" => next_token,
85
+ "maxResults" => max_results,
86
+ }.compact
87
+
88
+ meter(rate_limit).get(path, params:)
89
+ end
90
+ end
91
+ end
92
+ end
@@ -0,0 +1,246 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "peddler/api"
4
+
5
+ module Peddler
6
+ class << self
7
+ def aplus_content_2020_11_01(...)
8
+ API::AplusContent20201101.new(...)
9
+ end
10
+ end
11
+
12
+ class API
13
+ # Selling Partner API for A+ Content Management
14
+ #
15
+ # With the A+ Content API, you can build applications that help selling partners add rich marketing content to their
16
+ # Amazon product detail pages. A+ content helps selling partners share their brand and product story, which helps
17
+ # buyers make informed purchasing decisions. Selling partners assemble content by choosing from content modules and
18
+ # adding images and text.
19
+ class AplusContent20201101 < API
20
+ # Returns a list of all A+ Content documents assigned to a selling partner. This operation returns only the
21
+ # metadata of the A+ Content documents. Call the getContentDocument operation to get the actual contents of the A+
22
+ # Content documents.
23
+ #
24
+ # @param marketplace_id [String] The identifier for the marketplace where the A+ Content is published.
25
+ # @param page_token [String] A page token from the nextPageToken response element returned by your previous call
26
+ # to this operation. nextPageToken is returned when the results of a call exceed the page size. To get the next
27
+ # page of results, call the operation and include pageToken as the only parameter. Specifying pageToken with any
28
+ # other parameter will cause the request to fail. When no nextPageToken value is returned there are no more
29
+ # pages to return. A pageToken value is not usable across different operations.
30
+ # @param rate_limit [Float] Requests per second
31
+ # @return [Hash] The API response
32
+ def search_content_documents(marketplace_id, page_token: nil, rate_limit: 10.0)
33
+ cannot_sandbox!
34
+
35
+ path = "/aplus/2020-11-01/contentDocuments"
36
+ params = {
37
+ "marketplaceId" => marketplace_id,
38
+ "pageToken" => page_token,
39
+ }.compact
40
+
41
+ meter(rate_limit).get(path, params:)
42
+ end
43
+
44
+ # Creates a new A+ Content document.
45
+ #
46
+ # @param marketplace_id [String] The identifier for the marketplace where the A+ Content is published.
47
+ # @param post_content_document_request [Hash] The content document request details.
48
+ # @param rate_limit [Float] Requests per second
49
+ # @return [Hash] The API response
50
+ def create_content_document(marketplace_id, post_content_document_request, rate_limit: 10.0)
51
+ cannot_sandbox!
52
+
53
+ path = "/aplus/2020-11-01/contentDocuments"
54
+ body = post_content_document_request
55
+ params = {
56
+ "marketplaceId" => marketplace_id,
57
+ }.compact
58
+
59
+ meter(rate_limit).post(path, body:, params:)
60
+ end
61
+
62
+ # Returns an A+ Content document, if available.
63
+ #
64
+ # @param content_reference_key [String] The unique reference key for the A+ Content document. A content reference
65
+ # key cannot form a permalink and may change in the future. A content reference key is not guaranteed to match
66
+ # any A+ Content identifier.
67
+ # @param marketplace_id [String] The identifier for the marketplace where the A+ Content is published.
68
+ # @param included_data_set [Array<String>] The set of A+ Content data types to include in the response.
69
+ # @param rate_limit [Float] Requests per second
70
+ # @return [Hash] The API response
71
+ def get_content_document(content_reference_key, marketplace_id, included_data_set, rate_limit: 10.0)
72
+ cannot_sandbox!
73
+
74
+ path = "/aplus/2020-11-01/contentDocuments/#{content_reference_key}"
75
+ params = {
76
+ "marketplaceId" => marketplace_id,
77
+ "includedDataSet" => included_data_set,
78
+ }.compact
79
+
80
+ meter(rate_limit).get(path, params:)
81
+ end
82
+
83
+ # Updates an existing A+ Content document.
84
+ #
85
+ # @param content_reference_key [String] The unique reference key for the A+ Content document. A content reference
86
+ # key cannot form a permalink and may change in the future. A content reference key is not guaranteed to match
87
+ # any A+ Content identifier.
88
+ # @param marketplace_id [String] The identifier for the marketplace where the A+ Content is published.
89
+ # @param post_content_document_request [Hash] The content document request details.
90
+ # @param rate_limit [Float] Requests per second
91
+ # @return [Hash] The API response
92
+ def update_content_document(content_reference_key, marketplace_id, post_content_document_request,
93
+ rate_limit: 10.0)
94
+ cannot_sandbox!
95
+
96
+ path = "/aplus/2020-11-01/contentDocuments/#{content_reference_key}"
97
+ body = post_content_document_request
98
+ params = {
99
+ "marketplaceId" => marketplace_id,
100
+ }.compact
101
+
102
+ meter(rate_limit).post(path, body:, params:)
103
+ end
104
+
105
+ # Returns a list of ASINs related to the specified A+ Content document, if available. If you do not include the
106
+ # asinSet parameter, the operation returns all ASINs related to the content document.
107
+ #
108
+ # @param content_reference_key [String] The unique reference key for the A+ Content document. A content reference
109
+ # key cannot form a permalink and may change in the future. A content reference key is not guaranteed to match
110
+ # any A+ Content identifier.
111
+ # @param marketplace_id [String] The identifier for the marketplace where the A+ Content is published.
112
+ # @param included_data_set [Array<String>] The set of A+ Content data types to include in the response. If you do
113
+ # not include this parameter, the operation returns the related ASINs without metadata.
114
+ # @param asin_set [Array<String>] The set of ASINs.
115
+ # @param page_token [String] A page token from the nextPageToken response element returned by your previous call
116
+ # to this operation. nextPageToken is returned when the results of a call exceed the page size. To get the next
117
+ # page of results, call the operation and include pageToken as the only parameter. Specifying pageToken with any
118
+ # other parameter will cause the request to fail. When no nextPageToken value is returned there are no more
119
+ # pages to return. A pageToken value is not usable across different operations.
120
+ # @param rate_limit [Float] Requests per second
121
+ # @return [Hash] The API response
122
+ def list_content_document_asin_relations(content_reference_key, marketplace_id, included_data_set: nil,
123
+ asin_set: nil, page_token: nil, rate_limit: 10.0)
124
+ cannot_sandbox!
125
+
126
+ path = "/aplus/2020-11-01/contentDocuments/#{content_reference_key}/asins"
127
+ params = {
128
+ "marketplaceId" => marketplace_id,
129
+ "includedDataSet" => included_data_set,
130
+ "asinSet" => asin_set,
131
+ "pageToken" => page_token,
132
+ }.compact
133
+
134
+ meter(rate_limit).get(path, params:)
135
+ end
136
+
137
+ # Replaces all ASINs related to the specified A+ Content document, if available. This may add or remove ASINs,
138
+ # depending on the current set of related ASINs. Removing an ASIN has the side effect of suspending the content
139
+ # document from that ASIN.
140
+ #
141
+ # @param content_reference_key [String] The unique reference key for the A+ Content document. A content reference
142
+ # key cannot form a permalink and may change in the future. A content reference key is not guaranteed to match
143
+ # any A+ content identifier.
144
+ # @param marketplace_id [String] The identifier for the marketplace where the A+ Content is published.
145
+ # @param post_content_document_asin_relations_request [Hash] The content document ASIN relations request details.
146
+ # @param rate_limit [Float] Requests per second
147
+ # @return [Hash] The API response
148
+ def post_content_document_asin_relations(content_reference_key, marketplace_id,
149
+ post_content_document_asin_relations_request, rate_limit: 10.0)
150
+ cannot_sandbox!
151
+
152
+ path = "/aplus/2020-11-01/contentDocuments/#{content_reference_key}/asins"
153
+ body = post_content_document_asin_relations_request
154
+ params = {
155
+ "marketplaceId" => marketplace_id,
156
+ }.compact
157
+
158
+ meter(rate_limit).post(path, body:, params:)
159
+ end
160
+
161
+ # Checks if the A+ Content document is valid for use on a set of ASINs.
162
+ #
163
+ # @param marketplace_id [String] The identifier for the marketplace where the A+ Content is published.
164
+ # @param asin_set [Array<String>] The set of ASINs.
165
+ # @param post_content_document_request [Hash] The content document request details.
166
+ # @param rate_limit [Float] Requests per second
167
+ # @return [Hash] The API response
168
+ def validate_content_document_asin_relations(marketplace_id, post_content_document_request, asin_set: nil,
169
+ rate_limit: 10.0)
170
+ cannot_sandbox!
171
+
172
+ path = "/aplus/2020-11-01/contentAsinValidations"
173
+ body = post_content_document_request
174
+ params = {
175
+ "marketplaceId" => marketplace_id,
176
+ "asinSet" => asin_set,
177
+ }.compact
178
+
179
+ meter(rate_limit).post(path, body:, params:)
180
+ end
181
+
182
+ # Searches for A+ Content publishing records, if available.
183
+ #
184
+ # @param marketplace_id [String] The identifier for the marketplace where the A+ Content is published.
185
+ # @param asin [String] The Amazon Standard Identification Number (ASIN).
186
+ # @param page_token [String] A page token from the nextPageToken response element returned by your previous call
187
+ # to this operation. nextPageToken is returned when the results of a call exceed the page size. To get the next
188
+ # page of results, call the operation and include pageToken as the only parameter. Specifying pageToken with any
189
+ # other parameter will cause the request to fail. When no nextPageToken value is returned there are no more
190
+ # pages to return. A pageToken value is not usable across different operations.
191
+ # @param rate_limit [Float] Requests per second
192
+ # @return [Hash] The API response
193
+ def search_content_publish_records(marketplace_id, asin, page_token: nil, rate_limit: 10.0)
194
+ cannot_sandbox!
195
+
196
+ path = "/aplus/2020-11-01/contentPublishRecords"
197
+ params = {
198
+ "marketplaceId" => marketplace_id,
199
+ "asin" => asin,
200
+ "pageToken" => page_token,
201
+ }.compact
202
+
203
+ meter(rate_limit).get(path, params:)
204
+ end
205
+
206
+ # Submits an A+ Content document for review, approval, and publishing.
207
+ #
208
+ # @param content_reference_key [String] The unique reference key for the A+ Content document. A content reference
209
+ # key cannot form a permalink and may change in the future. A content reference key is not guaranteed to match
210
+ # any A+ content identifier.
211
+ # @param marketplace_id [String] The identifier for the marketplace where the A+ Content is published.
212
+ # @param rate_limit [Float] Requests per second
213
+ # @return [Hash] The API response
214
+ def post_content_document_approval_submission(content_reference_key, marketplace_id, rate_limit: 10.0)
215
+ cannot_sandbox!
216
+
217
+ path = "/aplus/2020-11-01/contentDocuments/#{content_reference_key}/approvalSubmissions"
218
+ params = {
219
+ "marketplaceId" => marketplace_id,
220
+ }.compact
221
+
222
+ meter(rate_limit).post(path, params:)
223
+ end
224
+
225
+ # Submits a request to suspend visible A+ Content. This neither deletes the content document nor the ASIN
226
+ # relations.
227
+ #
228
+ # @param content_reference_key [String] The unique reference key for the A+ Content document. A content reference
229
+ # key cannot form a permalink and may change in the future. A content reference key is not guaranteed to match
230
+ # any A+ content identifier.
231
+ # @param marketplace_id [String] The identifier for the marketplace where the A+ Content is published.
232
+ # @param rate_limit [Float] Requests per second
233
+ # @return [Hash] The API response
234
+ def post_content_document_suspend_submission(content_reference_key, marketplace_id, rate_limit: 10.0)
235
+ cannot_sandbox!
236
+
237
+ path = "/aplus/2020-11-01/contentDocuments/#{content_reference_key}/suspendSubmissions"
238
+ params = {
239
+ "marketplaceId" => marketplace_id,
240
+ }.compact
241
+
242
+ meter(rate_limit).post(path, params:)
243
+ end
244
+ end
245
+ end
246
+ end
@@ -0,0 +1,56 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "peddler/api"
4
+
5
+ module Peddler
6
+ class << self
7
+ def application_integrations_2024_04_01(...)
8
+ API::ApplicationIntegrations20240401.new(...)
9
+ end
10
+ end
11
+
12
+ class API
13
+ # The Selling Partner API for third party application integrations.
14
+ #
15
+ # With the AppIntegrations API v2024-04-01, you can send notifications to Amazon Selling Partners and display the
16
+ # notifications in Seller Central.
17
+ class ApplicationIntegrations20240401 < API
18
+ # Create a notification for sellers in Seller Central.
19
+ #
20
+ # @note This operation can make a static sandbox call.
21
+ # @param body [Hash] The request body for the `createNotification` operation.
22
+ # @param rate_limit [Float] Requests per second
23
+ # @return [Hash] The API response
24
+ def create_notification(body, rate_limit: 1.0)
25
+ path = "/appIntegrations/2024-04-01/notifications"
26
+
27
+ meter(rate_limit).post(path, body:)
28
+ end
29
+
30
+ # Remove your application's notifications from the Appstore notifications dashboard.
31
+ #
32
+ # @note This operation can make a static sandbox call.
33
+ # @param body [Hash] The request body for the `deleteNotifications` operation.
34
+ # @param rate_limit [Float] Requests per second
35
+ # @return [Hash] The API response
36
+ def delete_notifications(body, rate_limit: 1.0)
37
+ path = "/appIntegrations/2024-04-01/notifications/deletion"
38
+
39
+ meter(rate_limit).post(path, body:)
40
+ end
41
+
42
+ # Records the seller's response to a notification.
43
+ #
44
+ # @note This operation can make a static sandbox call.
45
+ # @param notification_id [String] A `notificationId` uniquely identifies a notification.
46
+ # @param body [Hash] The request body for the `recordActionFeedback` operation.
47
+ # @param rate_limit [Float] Requests per second
48
+ # @return [Hash] The API response
49
+ def record_action_feedback(notification_id, body, rate_limit: 1.0)
50
+ path = "/appIntegrations/2024-04-01/notifications/#{notification_id}/feedback"
51
+
52
+ meter(rate_limit).post(path, body:)
53
+ end
54
+ end
55
+ end
56
+ end
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "peddler/api"
4
+
5
+ module Peddler
6
+ class << self
7
+ def application_management_2023_11_30(...)
8
+ API::ApplicationManagement20231130.new(...)
9
+ end
10
+ end
11
+
12
+ class API
13
+ # Selling Partner API for Application Management
14
+ #
15
+ # The Selling Partner API for Application Management lets you programmatically update the client secret on
16
+ # registered applications.
17
+ class ApplicationManagement20231130 < API
18
+ # Rotates application client secrets for a developer application. Developers must register a destination queue in
19
+ # the developer console before calling this operation. When this operation is called a new client secret is
20
+ # generated and sent to the developer-registered queue. For more information, refer to [Rotate your application
21
+ # client
22
+ # secret](https://developer-docs.amazon.com/sp-api/v0/docs/application-management-api-v2023-11-30-use-case-guide#tutorial-rotate-your-applications-client-secret).
23
+ #
24
+ # @param rate_limit [Float] Requests per second
25
+ # @return [Hash] The API response
26
+ def rotate_application_client_secret(rate_limit: 0.0167)
27
+ cannot_sandbox!
28
+
29
+ path = "/applications/2023-11-30/clientSecret"
30
+
31
+ meter(rate_limit).post(path)
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,81 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "peddler/api"
4
+
5
+ module Peddler
6
+ class << self
7
+ def catalog_items_2020_12_01(...)
8
+ API::CatalogItems20201201.new(...)
9
+ end
10
+ end
11
+
12
+ class API
13
+ # Selling Partner API for Catalog Items
14
+ #
15
+ # The Selling Partner API for Catalog Items provides programmatic access to information about items in the Amazon
16
+ # catalog. For more information, see the
17
+ # {https://developer-docs.amazon.com/sp-api/docs/catalog-items-api-v2020-12-01-use-case-guide Catalog Items API Use
18
+ # Case Guide}.
19
+ class CatalogItems20201201 < API
20
+ # Search for and return a list of Amazon catalog items and associated information.
21
+ #
22
+ # @note This operation can make a static sandbox call.
23
+ # @param keywords [Array<String>] A comma-delimited list of words or item identifiers to search the Amazon catalog
24
+ # for.
25
+ # @param marketplace_ids [Array<String>] A comma-delimited list of Amazon marketplace identifiers for the request.
26
+ # @param included_data [Array<String>] A comma-delimited list of data sets to include in the response. Default:
27
+ # summaries.
28
+ # @param brand_names [Array<String>] A comma-delimited list of brand names to limit the search to.
29
+ # @param classification_ids [Array<String>] A comma-delimited list of classification identifiers to limit the
30
+ # search to.
31
+ # @param page_size [Integer] Number of results to be returned per page.
32
+ # @param page_token [String] A token to fetch a certain page when there are multiple pages worth of results.
33
+ # @param keywords_locale [String] The language the keywords are provided in. Defaults to the primary locale of the
34
+ # marketplace.
35
+ # @param locale [String] Locale for retrieving localized summaries. Defaults to the primary locale of the
36
+ # marketplace.
37
+ # @param rate_limit [Float] Requests per second
38
+ # @return [Hash] The API response
39
+ def search_catalog_items(keywords, marketplace_ids, included_data: "summaries", brand_names: nil,
40
+ classification_ids: nil, page_size: 10, page_token: nil, keywords_locale: nil, locale: nil, rate_limit: 2.0)
41
+ path = "/catalog/2020-12-01/items"
42
+ params = {
43
+ "keywords" => keywords,
44
+ "marketplaceIds" => marketplace_ids,
45
+ "includedData" => included_data,
46
+ "brandNames" => brand_names,
47
+ "classificationIds" => classification_ids,
48
+ "pageSize" => page_size,
49
+ "pageToken" => page_token,
50
+ "keywordsLocale" => keywords_locale,
51
+ "locale" => locale,
52
+ }.compact
53
+
54
+ meter(rate_limit).get(path, params:)
55
+ end
56
+
57
+ # Retrieves details for an item in the Amazon catalog.
58
+ #
59
+ # @note This operation can make a static sandbox call.
60
+ # @param asin [String] The Amazon Standard Identification Number (ASIN) of the item.
61
+ # @param marketplace_ids [Array<String>] A comma-delimited list of Amazon marketplace identifiers. Data sets in
62
+ # the response contain data only for the specified marketplaces.
63
+ # @param included_data [Array<String>] A comma-delimited list of data sets to include in the response. Default:
64
+ # summaries.
65
+ # @param locale [String] Locale for retrieving localized summaries. Defaults to the primary locale of the
66
+ # marketplace.
67
+ # @param rate_limit [Float] Requests per second
68
+ # @return [Hash] The API response
69
+ def get_catalog_item(asin, marketplace_ids, included_data: "summaries", locale: nil, rate_limit: 2.0)
70
+ path = "/catalog/2020-12-01/items/#{asin}"
71
+ params = {
72
+ "marketplaceIds" => marketplace_ids,
73
+ "includedData" => included_data,
74
+ "locale" => locale,
75
+ }.compact
76
+
77
+ meter(rate_limit).get(path, params:)
78
+ end
79
+ end
80
+ end
81
+ end
@@ -0,0 +1,93 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "peddler/api"
4
+
5
+ module Peddler
6
+ class << self
7
+ def catalog_items_2022_04_01(...)
8
+ API::CatalogItems20220401.new(...)
9
+ end
10
+ end
11
+
12
+ class API
13
+ # Selling Partner API for Catalog Items
14
+ #
15
+ # The Selling Partner API for Catalog Items provides programmatic access to information about items in the Amazon
16
+ # catalog. For more information, refer to the
17
+ # {https://developer-docs.amazon.com/sp-api/docs/catalog-items-api-v2022-04-01-use-case-guide Catalog Items API Use
18
+ # Case Guide}.
19
+ class CatalogItems20220401 < API
20
+ # Search for and return a list of Amazon catalog items and associated information either by identifier or by
21
+ # keywords.
22
+ #
23
+ # @note This operation can make a static sandbox call.
24
+ # @param identifiers [Array<String>] A comma-delimited list of product identifiers to search the Amazon catalog
25
+ # for. **Note:** Cannot be used with `keywords`.
26
+ # @param identifiers_type [String] Type of product identifiers to search the Amazon catalog for. **Note:**
27
+ # Required when `identifiers` are provided.
28
+ # @param marketplace_ids [Array<String>] A comma-delimited list of Amazon marketplace identifiers for the request.
29
+ # @param included_data [Array<String>] A comma-delimited list of data sets to include in the response. Default:
30
+ # `summaries`.
31
+ # @param locale [String] Locale for retrieving localized summaries. Defaults to the primary locale of the
32
+ # marketplace.
33
+ # @param seller_id [String] A selling partner identifier, such as a seller account or vendor code. **Note:**
34
+ # Required when `identifiersType` is `SKU`.
35
+ # @param keywords [Array<String>] A comma-delimited list of words to search the Amazon catalog for. **Note:**
36
+ # Cannot be used with `identifiers`.
37
+ # @param brand_names [Array<String>] A comma-delimited list of brand names to limit the search for
38
+ # `keywords`-based queries. **Note:** Cannot be used with `identifiers`.
39
+ # @param classification_ids [Array<String>] A comma-delimited list of classification identifiers to limit the
40
+ # search for `keywords`-based queries. **Note:** Cannot be used with `identifiers`.
41
+ # @param page_size [Integer] Number of results to be returned per page.
42
+ # @param page_token [String] A token to fetch a certain page when there are multiple pages worth of results.
43
+ # @param keywords_locale [String] The language of the keywords provided for `keywords`-based queries. Defaults to
44
+ # the primary locale of the marketplace. **Note:** Cannot be used with `identifiers`.
45
+ # @param rate_limit [Float] Requests per second
46
+ # @return [Hash] The API response
47
+ def search_catalog_items(marketplace_ids, identifiers: nil, identifiers_type: nil, included_data: ["summaries"],
48
+ locale: nil, seller_id: nil, keywords: nil, brand_names: nil, classification_ids: nil, page_size: 10,
49
+ page_token: nil, keywords_locale: nil, rate_limit: 2.0)
50
+ path = "/catalog/2022-04-01/items"
51
+ params = {
52
+ "identifiers" => identifiers,
53
+ "identifiersType" => identifiers_type,
54
+ "marketplaceIds" => marketplace_ids,
55
+ "includedData" => included_data,
56
+ "locale" => locale,
57
+ "sellerId" => seller_id,
58
+ "keywords" => keywords,
59
+ "brandNames" => brand_names,
60
+ "classificationIds" => classification_ids,
61
+ "pageSize" => page_size,
62
+ "pageToken" => page_token,
63
+ "keywordsLocale" => keywords_locale,
64
+ }.compact
65
+
66
+ meter(rate_limit).get(path, params:)
67
+ end
68
+
69
+ # Retrieves details for an item in the Amazon catalog.
70
+ #
71
+ # @note This operation can make a static sandbox call.
72
+ # @param asin [String] The Amazon Standard Identification Number (ASIN) of the item.
73
+ # @param marketplace_ids [Array<String>] A comma-delimited list of Amazon marketplace identifiers. Data sets in
74
+ # the response contain data only for the specified marketplaces.
75
+ # @param included_data [Array<String>] A comma-delimited list of data sets to include in the response. Default:
76
+ # `summaries`.
77
+ # @param locale [String] Locale for retrieving localized summaries. Defaults to the primary locale of the
78
+ # marketplace.
79
+ # @param rate_limit [Float] Requests per second
80
+ # @return [Hash] The API response
81
+ def get_catalog_item(asin, marketplace_ids, included_data: ["summaries"], locale: nil, rate_limit: 2.0)
82
+ path = "/catalog/2022-04-01/items/#{asin}"
83
+ params = {
84
+ "marketplaceIds" => marketplace_ids,
85
+ "includedData" => included_data,
86
+ "locale" => locale,
87
+ }.compact
88
+
89
+ meter(rate_limit).get(path, params:)
90
+ end
91
+ end
92
+ end
93
+ end