peddler 4.3.1 → 4.5.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.
- checksums.yaml +4 -4
- data/README.md +459 -109
- data/lib/peddler/api.rb +13 -11
- data/lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09.rb +7 -7
- data/lib/peddler/apis/aplus_content_2020_11_01.rb +10 -10
- data/lib/peddler/apis/application_integrations_2024_04_01.rb +1 -1
- data/lib/peddler/apis/catalog_items_2020_12_01.rb +8 -8
- data/lib/peddler/apis/catalog_items_2022_04_01.rb +9 -9
- data/lib/peddler/apis/customer_feedback_2024_06_01.rb +143 -0
- data/lib/peddler/apis/data_kiosk_2023_11_15.rb +4 -4
- data/lib/peddler/apis/fba_inbound_eligibility_v1.rb +1 -1
- data/lib/peddler/apis/fba_inventory_v1.rb +3 -3
- data/lib/peddler/apis/feeds_2021_06_30.rb +6 -6
- data/lib/peddler/apis/finances_2024_06_01.rb +1 -1
- data/lib/peddler/apis/finances_2024_06_19.rb +14 -6
- data/lib/peddler/apis/finances_v0.rb +2 -2
- data/lib/peddler/apis/fulfillment_inbound_2024_03_20.rb +40 -40
- data/lib/peddler/apis/fulfillment_inbound_v0.rb +8 -8
- data/lib/peddler/apis/fulfillment_outbound_2020_07_01.rb +7 -7
- data/lib/peddler/apis/invoices_2024_06_19.rb +4 -4
- data/lib/peddler/apis/listings_items_2020_09_01.rb +6 -6
- data/lib/peddler/apis/listings_items_2021_08_01.rb +20 -26
- data/lib/peddler/apis/listings_restrictions_2021_08_01.rb +1 -1
- data/lib/peddler/apis/merchant_fulfillment_v0.rb +2 -2
- data/lib/peddler/apis/messaging_v1.rb +26 -26
- data/lib/peddler/apis/notifications_v1.rb +6 -6
- data/lib/peddler/apis/orders_v0.rb +20 -20
- data/lib/peddler/apis/product_fees_v0.rb +2 -2
- data/lib/peddler/apis/product_pricing_v0.rb +6 -6
- data/lib/peddler/apis/product_type_definitions_2020_09_01.rb +4 -4
- data/lib/peddler/apis/reports_2021_06_30.rb +12 -9
- data/lib/peddler/apis/sales_v1.rb +7 -2
- data/lib/peddler/apis/seller_wallet_2024_03_01.rb +5 -5
- data/lib/peddler/apis/services_v1.rb +27 -27
- data/lib/peddler/apis/shipment_invoicing_v0.rb +3 -3
- data/lib/peddler/apis/shipping_v1.rb +5 -5
- data/lib/peddler/apis/shipping_v2.rb +6 -6
- data/lib/peddler/apis/solicitations_v1.rb +4 -4
- data/lib/peddler/apis/supply_sources_2020_07_01.rb +4 -4
- data/lib/peddler/apis/uploads_2020_11_01.rb +2 -2
- data/lib/peddler/apis/vendor_direct_fulfillment_inventory_v1.rb +1 -1
- data/lib/peddler/apis/vendor_direct_fulfillment_orders_2021_12_28.rb +1 -1
- data/lib/peddler/apis/vendor_direct_fulfillment_orders_v1.rb +1 -1
- data/lib/peddler/apis/vendor_direct_fulfillment_sandbox_test_data_2021_10_28.rb +1 -1
- data/lib/peddler/apis/vendor_direct_fulfillment_shipping_2021_12_28.rb +4 -4
- data/lib/peddler/apis/vendor_direct_fulfillment_shipping_v1.rb +3 -3
- data/lib/peddler/apis/vendor_direct_fulfillment_transactions_2021_12_28.rb +1 -1
- data/lib/peddler/apis/vendor_direct_fulfillment_transactions_v1.rb +1 -1
- data/lib/peddler/apis/vendor_orders_v1.rb +1 -1
- data/lib/peddler/apis/vendor_shipments_v1.rb +1 -1
- data/lib/peddler/apis/vendor_transaction_status_v1.rb +1 -1
- data/lib/peddler/config.rb +17 -0
- data/lib/peddler/error.rb +35 -8
- data/lib/peddler/helpers/feeds_2021_06_30.rb +22 -8
- data/lib/peddler/helpers/reports_2021_06_30.rb +38 -0
- data/lib/peddler/marketplace.rb +14 -0
- data/lib/peddler/response.rb +52 -5
- data/lib/peddler/token.rb +4 -15
- data/lib/peddler/version.rb +1 -1
- data/lib/peddler.rb +54 -0
- metadata +8 -13
- data/lib/peddler/parsers/openapi_parser_generator.rb +0 -550
- data/lib/peddler/parsers/smart_parser.rb +0 -199
@@ -32,18 +32,16 @@ module Peddler
|
|
32
32
|
# @param rate_limit [Float] Requests per second
|
33
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
|
-
path = "/listings/2021-08-01/items/#{seller_id}/#{sku}"
|
35
|
+
path = "/listings/2021-08-01/items/#{percent_encode(seller_id)}/#{percent_encode(sku)}"
|
36
36
|
params = {
|
37
|
-
"marketplaceIds" => marketplace_ids,
|
37
|
+
"marketplaceIds" => stringify_array(marketplace_ids),
|
38
38
|
"issueLocale" => issue_locale,
|
39
39
|
}.compact
|
40
40
|
|
41
41
|
meter(rate_limit).delete(path, params:)
|
42
42
|
end
|
43
43
|
|
44
|
-
# Returns details about a listings item for a selling partner.
|
45
|
-
# operation may contain special characters that must be encoded to successfully call the API. To avoid errors with
|
46
|
-
# SKUs when encoding URLs, refer to [URL Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding).
|
44
|
+
# Returns details about a listings item for a selling partner.
|
47
45
|
#
|
48
46
|
# @note This operation can make a static sandbox call.
|
49
47
|
# @param seller_id [String] A selling partner identifier, such as a merchant account or vendor code.
|
@@ -58,11 +56,11 @@ module Peddler
|
|
58
56
|
# @return [Peddler::Response] The API response
|
59
57
|
def get_listings_item(seller_id, sku, marketplace_ids, issue_locale: nil, included_data: ["summaries"],
|
60
58
|
rate_limit: 5.0)
|
61
|
-
path = "/listings/2021-08-01/items/#{seller_id}/#{sku}"
|
59
|
+
path = "/listings/2021-08-01/items/#{percent_encode(seller_id)}/#{percent_encode(sku)}"
|
62
60
|
params = {
|
63
|
-
"marketplaceIds" => marketplace_ids,
|
61
|
+
"marketplaceIds" => stringify_array(marketplace_ids),
|
64
62
|
"issueLocale" => issue_locale,
|
65
|
-
"includedData" => included_data,
|
63
|
+
"includedData" => stringify_array(included_data),
|
66
64
|
}.compact
|
67
65
|
|
68
66
|
meter(rate_limit).get(path, params:)
|
@@ -86,10 +84,10 @@ module Peddler
|
|
86
84
|
# @return [Peddler::Response] The API response
|
87
85
|
def patch_listings_item(seller_id, sku, marketplace_ids, body, included_data: ["issues"], mode: nil,
|
88
86
|
issue_locale: nil, rate_limit: 5.0)
|
89
|
-
path = "/listings/2021-08-01/items/#{seller_id}/#{sku}"
|
87
|
+
path = "/listings/2021-08-01/items/#{percent_encode(seller_id)}/#{percent_encode(sku)}"
|
90
88
|
params = {
|
91
|
-
"marketplaceIds" => marketplace_ids,
|
92
|
-
"includedData" => included_data,
|
89
|
+
"marketplaceIds" => stringify_array(marketplace_ids),
|
90
|
+
"includedData" => stringify_array(included_data),
|
93
91
|
"mode" => mode,
|
94
92
|
"issueLocale" => issue_locale,
|
95
93
|
}.compact
|
@@ -97,11 +95,7 @@ module Peddler
|
|
97
95
|
meter(rate_limit).patch(path, body:, params:)
|
98
96
|
end
|
99
97
|
|
100
|
-
# Creates or fully
|
101
|
-
# throttling rate of one request per second when `mode` is `VALIDATION_PREVIEW`. **Note:** The parameters
|
102
|
-
# associated with this operation may contain special characters that must be encoded to successfully call the API.
|
103
|
-
# To avoid errors with SKUs when encoding URLs, refer to [URL
|
104
|
-
# Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding).
|
98
|
+
# Creates a new or fully-updates an existing listings item for a selling partner.
|
105
99
|
#
|
106
100
|
# @note This operation can make a static sandbox call.
|
107
101
|
# @param seller_id [String] A selling partner identifier, such as a merchant account or vendor code.
|
@@ -118,10 +112,10 @@ module Peddler
|
|
118
112
|
# @return [Peddler::Response] The API response
|
119
113
|
def put_listings_item(seller_id, sku, marketplace_ids, body, included_data: ["issues"], mode: nil,
|
120
114
|
issue_locale: nil, rate_limit: 5.0)
|
121
|
-
path = "/listings/2021-08-01/items/#{seller_id}/#{sku}"
|
115
|
+
path = "/listings/2021-08-01/items/#{percent_encode(seller_id)}/#{percent_encode(sku)}"
|
122
116
|
params = {
|
123
|
-
"marketplaceIds" => marketplace_ids,
|
124
|
-
"includedData" => included_data,
|
117
|
+
"marketplaceIds" => stringify_array(marketplace_ids),
|
118
|
+
"includedData" => stringify_array(included_data),
|
125
119
|
"mode" => mode,
|
126
120
|
"issueLocale" => issue_locale,
|
127
121
|
}.compact
|
@@ -179,12 +173,12 @@ module Peddler
|
|
179
173
|
created_after: nil, created_before: nil, last_updated_after: nil, last_updated_before: nil,
|
180
174
|
with_issue_severity: nil, with_status: nil, without_status: nil, sort_by: "lastUpdatedDate", sort_order: "DESC",
|
181
175
|
page_size: 10, page_token: nil, rate_limit: 5.0)
|
182
|
-
path = "/listings/2021-08-01/items/#{seller_id}"
|
176
|
+
path = "/listings/2021-08-01/items/#{percent_encode(seller_id)}"
|
183
177
|
params = {
|
184
|
-
"marketplaceIds" => marketplace_ids,
|
178
|
+
"marketplaceIds" => stringify_array(marketplace_ids),
|
185
179
|
"issueLocale" => issue_locale,
|
186
|
-
"includedData" => included_data,
|
187
|
-
"identifiers" => identifiers,
|
180
|
+
"includedData" => stringify_array(included_data),
|
181
|
+
"identifiers" => stringify_array(identifiers),
|
188
182
|
"identifiersType" => identifiers_type,
|
189
183
|
"variationParentSku" => variation_parent_sku,
|
190
184
|
"packageHierarchySku" => package_hierarchy_sku,
|
@@ -192,9 +186,9 @@ module Peddler
|
|
192
186
|
"createdBefore" => created_before,
|
193
187
|
"lastUpdatedAfter" => last_updated_after,
|
194
188
|
"lastUpdatedBefore" => last_updated_before,
|
195
|
-
"withIssueSeverity" => with_issue_severity,
|
196
|
-
"withStatus" => with_status,
|
197
|
-
"withoutStatus" => without_status,
|
189
|
+
"withIssueSeverity" => stringify_array(with_issue_severity),
|
190
|
+
"withStatus" => stringify_array(with_status),
|
191
|
+
"withoutStatus" => stringify_array(without_status),
|
198
192
|
"sortBy" => sort_by,
|
199
193
|
"sortOrder" => sort_order,
|
200
194
|
"pageSize" => page_size,
|
@@ -34,7 +34,7 @@ module Peddler
|
|
34
34
|
# @param rate_limit [Float] Requests per second
|
35
35
|
# @return [Peddler::Response] The API response
|
36
36
|
def get_shipment(shipment_id, rate_limit: 1.0)
|
37
|
-
path = "/mfn/v0/shipments/#{shipment_id}"
|
37
|
+
path = "/mfn/v0/shipments/#{percent_encode(shipment_id)}"
|
38
38
|
|
39
39
|
meter(rate_limit).get(path)
|
40
40
|
end
|
@@ -46,7 +46,7 @@ module Peddler
|
|
46
46
|
# @param rate_limit [Float] Requests per second
|
47
47
|
# @return [Peddler::Response] The API response
|
48
48
|
def cancel_shipment(shipment_id, rate_limit: 1.0)
|
49
|
-
path = "/mfn/v0/shipments/#{shipment_id}"
|
49
|
+
path = "/mfn/v0/shipments/#{percent_encode(shipment_id)}"
|
50
50
|
|
51
51
|
meter(rate_limit).delete(path)
|
52
52
|
end
|
@@ -29,9 +29,9 @@ module Peddler
|
|
29
29
|
# @param rate_limit [Float] Requests per second
|
30
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
|
-
path = "/messaging/v1/orders/#{amazon_order_id}"
|
32
|
+
path = "/messaging/v1/orders/#{percent_encode(amazon_order_id)}"
|
33
33
|
params = {
|
34
|
-
"marketplaceIds" => marketplace_ids,
|
34
|
+
"marketplaceIds" => stringify_array(marketplace_ids),
|
35
35
|
}.compact
|
36
36
|
|
37
37
|
meter(rate_limit).get(path, params:)
|
@@ -49,9 +49,9 @@ module Peddler
|
|
49
49
|
# @param rate_limit [Float] Requests per second
|
50
50
|
# @return [Peddler::Response] The API response
|
51
51
|
def confirm_customization_details(amazon_order_id, marketplace_ids, body, rate_limit: 1.0)
|
52
|
-
path = "/messaging/v1/orders/#{amazon_order_id}/messages/confirmCustomizationDetails"
|
52
|
+
path = "/messaging/v1/orders/#{percent_encode(amazon_order_id)}/messages/confirmCustomizationDetails"
|
53
53
|
params = {
|
54
|
-
"marketplaceIds" => marketplace_ids,
|
54
|
+
"marketplaceIds" => stringify_array(marketplace_ids),
|
55
55
|
}.compact
|
56
56
|
|
57
57
|
meter(rate_limit).post(path, body:, params:)
|
@@ -68,9 +68,9 @@ module Peddler
|
|
68
68
|
# @param rate_limit [Float] Requests per second
|
69
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
|
-
path = "/messaging/v1/orders/#{amazon_order_id}/messages/confirmDeliveryDetails"
|
71
|
+
path = "/messaging/v1/orders/#{percent_encode(amazon_order_id)}/messages/confirmDeliveryDetails"
|
72
72
|
params = {
|
73
|
-
"marketplaceIds" => marketplace_ids,
|
73
|
+
"marketplaceIds" => stringify_array(marketplace_ids),
|
74
74
|
}.compact
|
75
75
|
|
76
76
|
meter(rate_limit).post(path, body:, params:)
|
@@ -88,9 +88,9 @@ module Peddler
|
|
88
88
|
# @param rate_limit [Float] Requests per second
|
89
89
|
# @return [Peddler::Response] The API response
|
90
90
|
def create_legal_disclosure(amazon_order_id, marketplace_ids, body, rate_limit: 1.0)
|
91
|
-
path = "/messaging/v1/orders/#{amazon_order_id}/messages/legalDisclosure"
|
91
|
+
path = "/messaging/v1/orders/#{percent_encode(amazon_order_id)}/messages/legalDisclosure"
|
92
92
|
params = {
|
93
|
-
"marketplaceIds" => marketplace_ids,
|
93
|
+
"marketplaceIds" => stringify_array(marketplace_ids),
|
94
94
|
}.compact
|
95
95
|
|
96
96
|
meter(rate_limit).post(path, body:, params:)
|
@@ -107,9 +107,9 @@ module Peddler
|
|
107
107
|
# @param rate_limit [Float] Requests per second
|
108
108
|
# @return [Peddler::Response] The API response
|
109
109
|
def create_negative_feedback_removal(amazon_order_id, marketplace_ids, rate_limit: 1.0)
|
110
|
-
path = "/messaging/v1/orders/#{amazon_order_id}/messages/negativeFeedbackRemoval"
|
110
|
+
path = "/messaging/v1/orders/#{percent_encode(amazon_order_id)}/messages/negativeFeedbackRemoval"
|
111
111
|
params = {
|
112
|
-
"marketplaceIds" => marketplace_ids,
|
112
|
+
"marketplaceIds" => stringify_array(marketplace_ids),
|
113
113
|
}.compact
|
114
114
|
|
115
115
|
meter(rate_limit).post(path, params:)
|
@@ -126,9 +126,9 @@ module Peddler
|
|
126
126
|
# @param rate_limit [Float] Requests per second
|
127
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
|
-
path = "/messaging/v1/orders/#{amazon_order_id}/messages/confirmOrderDetails"
|
129
|
+
path = "/messaging/v1/orders/#{percent_encode(amazon_order_id)}/messages/confirmOrderDetails"
|
130
130
|
params = {
|
131
|
-
"marketplaceIds" => marketplace_ids,
|
131
|
+
"marketplaceIds" => stringify_array(marketplace_ids),
|
132
132
|
}.compact
|
133
133
|
|
134
134
|
meter(rate_limit).post(path, body:, params:)
|
@@ -146,9 +146,9 @@ module Peddler
|
|
146
146
|
# @param rate_limit [Float] Requests per second
|
147
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
|
-
path = "/messaging/v1/orders/#{amazon_order_id}/messages/confirmServiceDetails"
|
149
|
+
path = "/messaging/v1/orders/#{percent_encode(amazon_order_id)}/messages/confirmServiceDetails"
|
150
150
|
params = {
|
151
|
-
"marketplaceIds" => marketplace_ids,
|
151
|
+
"marketplaceIds" => stringify_array(marketplace_ids),
|
152
152
|
}.compact
|
153
153
|
|
154
154
|
meter(rate_limit).post(path, body:, params:)
|
@@ -166,9 +166,9 @@ module Peddler
|
|
166
166
|
# @param rate_limit [Float] Requests per second
|
167
167
|
# @return [Peddler::Response] The API response
|
168
168
|
def create_amazon_motors(amazon_order_id, marketplace_ids, body, rate_limit: 1.0)
|
169
|
-
path = "/messaging/v1/orders/#{amazon_order_id}/messages/amazonMotors"
|
169
|
+
path = "/messaging/v1/orders/#{percent_encode(amazon_order_id)}/messages/amazonMotors"
|
170
170
|
params = {
|
171
|
-
"marketplaceIds" => marketplace_ids,
|
171
|
+
"marketplaceIds" => stringify_array(marketplace_ids),
|
172
172
|
}.compact
|
173
173
|
|
174
174
|
meter(rate_limit).post(path, body:, params:)
|
@@ -185,9 +185,9 @@ module Peddler
|
|
185
185
|
# @param rate_limit [Float] Requests per second
|
186
186
|
# @return [Peddler::Response] The API response
|
187
187
|
def create_warranty(amazon_order_id, marketplace_ids, body, rate_limit: 1.0)
|
188
|
-
path = "/messaging/v1/orders/#{amazon_order_id}/messages/warranty"
|
188
|
+
path = "/messaging/v1/orders/#{percent_encode(amazon_order_id)}/messages/warranty"
|
189
189
|
params = {
|
190
|
-
"marketplaceIds" => marketplace_ids,
|
190
|
+
"marketplaceIds" => stringify_array(marketplace_ids),
|
191
191
|
}.compact
|
192
192
|
|
193
193
|
meter(rate_limit).post(path, body:, params:)
|
@@ -203,9 +203,9 @@ module Peddler
|
|
203
203
|
# @param rate_limit [Float] Requests per second
|
204
204
|
# @return [Peddler::Response] The API response
|
205
205
|
def get_attributes(amazon_order_id, marketplace_ids, rate_limit: 1.0)
|
206
|
-
path = "/messaging/v1/orders/#{amazon_order_id}/attributes"
|
206
|
+
path = "/messaging/v1/orders/#{percent_encode(amazon_order_id)}/attributes"
|
207
207
|
params = {
|
208
|
-
"marketplaceIds" => marketplace_ids,
|
208
|
+
"marketplaceIds" => stringify_array(marketplace_ids),
|
209
209
|
}.compact
|
210
210
|
|
211
211
|
meter(rate_limit).get(path, params:)
|
@@ -223,9 +223,9 @@ module Peddler
|
|
223
223
|
# @param rate_limit [Float] Requests per second
|
224
224
|
# @return [Peddler::Response] The API response
|
225
225
|
def create_digital_access_key(amazon_order_id, marketplace_ids, body, rate_limit: 1.0)
|
226
|
-
path = "/messaging/v1/orders/#{amazon_order_id}/messages/digitalAccessKey"
|
226
|
+
path = "/messaging/v1/orders/#{percent_encode(amazon_order_id)}/messages/digitalAccessKey"
|
227
227
|
params = {
|
228
|
-
"marketplaceIds" => marketplace_ids,
|
228
|
+
"marketplaceIds" => stringify_array(marketplace_ids),
|
229
229
|
}.compact
|
230
230
|
|
231
231
|
meter(rate_limit).post(path, body:, params:)
|
@@ -243,9 +243,9 @@ module Peddler
|
|
243
243
|
# @param rate_limit [Float] Requests per second
|
244
244
|
# @return [Peddler::Response] The API response
|
245
245
|
def create_unexpected_problem(amazon_order_id, marketplace_ids, body, rate_limit: 1.0)
|
246
|
-
path = "/messaging/v1/orders/#{amazon_order_id}/messages/unexpectedProblem"
|
246
|
+
path = "/messaging/v1/orders/#{percent_encode(amazon_order_id)}/messages/unexpectedProblem"
|
247
247
|
params = {
|
248
|
-
"marketplaceIds" => marketplace_ids,
|
248
|
+
"marketplaceIds" => stringify_array(marketplace_ids),
|
249
249
|
}.compact
|
250
250
|
|
251
251
|
meter(rate_limit).post(path, body:, params:)
|
@@ -261,9 +261,9 @@ module Peddler
|
|
261
261
|
# @param body [Hash] This contains the message body for a message.
|
262
262
|
# @return [Peddler::Response] The API response
|
263
263
|
def send_invoice(amazon_order_id, marketplace_ids, body)
|
264
|
-
path = "/messaging/v1/orders/#{amazon_order_id}/messages/invoice"
|
264
|
+
path = "/messaging/v1/orders/#{percent_encode(amazon_order_id)}/messages/invoice"
|
265
265
|
params = {
|
266
|
-
"marketplaceIds" => marketplace_ids,
|
266
|
+
"marketplaceIds" => stringify_array(marketplace_ids),
|
267
267
|
}.compact
|
268
268
|
|
269
269
|
post(path, body:, params:)
|
@@ -29,7 +29,7 @@ module Peddler
|
|
29
29
|
# to [Notification Type Values](https://developer-docs.amazon.com/sp-api/docs/notification-type-values).
|
30
30
|
# @return [Peddler::Response] The API response
|
31
31
|
def get_subscription(notification_type, payload_version: nil, rate_limit: 1.0)
|
32
|
-
path = "/notifications/v1/subscriptions/#{notification_type}"
|
32
|
+
path = "/notifications/v1/subscriptions/#{percent_encode(notification_type)}"
|
33
33
|
params = {
|
34
34
|
"payloadVersion" => payload_version,
|
35
35
|
}.compact
|
@@ -49,7 +49,7 @@ module Peddler
|
|
49
49
|
# to [Notification Type Values](https://developer-docs.amazon.com/sp-api/docs/notification-type-values).
|
50
50
|
# @return [Peddler::Response] The API response
|
51
51
|
def create_subscription(body, notification_type, rate_limit: 1.0)
|
52
|
-
path = "/notifications/v1/subscriptions/#{notification_type}"
|
52
|
+
path = "/notifications/v1/subscriptions/#{percent_encode(notification_type)}"
|
53
53
|
|
54
54
|
meter(rate_limit).post(path, body:)
|
55
55
|
end
|
@@ -65,7 +65,7 @@ module Peddler
|
|
65
65
|
# to [Notification Type Values](https://developer-docs.amazon.com/sp-api/docs/notification-type-values).
|
66
66
|
# @return [Peddler::Response] The API response
|
67
67
|
def get_subscription_by_id(subscription_id, notification_type, rate_limit: 1.0)
|
68
|
-
path = "/notifications/v1/subscriptions/#{notification_type}/#{subscription_id}"
|
68
|
+
path = "/notifications/v1/subscriptions/#{percent_encode(notification_type)}/#{percent_encode(subscription_id)}"
|
69
69
|
|
70
70
|
meter(rate_limit).get(path)
|
71
71
|
end
|
@@ -83,7 +83,7 @@ module Peddler
|
|
83
83
|
# to [Notification Type Values](https://developer-docs.amazon.com/sp-api/docs/notification-type-values).
|
84
84
|
# @return [Peddler::Response] The API response
|
85
85
|
def delete_subscription_by_id(subscription_id, notification_type, rate_limit: 1.0)
|
86
|
-
path = "/notifications/v1/subscriptions/#{notification_type}/#{subscription_id}"
|
86
|
+
path = "/notifications/v1/subscriptions/#{percent_encode(notification_type)}/#{percent_encode(subscription_id)}"
|
87
87
|
|
88
88
|
meter(rate_limit).delete(path)
|
89
89
|
end
|
@@ -123,7 +123,7 @@ module Peddler
|
|
123
123
|
# @param rate_limit [Float] Requests per second
|
124
124
|
# @return [Peddler::Response] The API response
|
125
125
|
def get_destination(destination_id, rate_limit: 1.0)
|
126
|
-
path = "/notifications/v1/destinations/#{destination_id}"
|
126
|
+
path = "/notifications/v1/destinations/#{percent_encode(destination_id)}"
|
127
127
|
|
128
128
|
meter(rate_limit).get(path)
|
129
129
|
end
|
@@ -136,7 +136,7 @@ module Peddler
|
|
136
136
|
# @param rate_limit [Float] Requests per second
|
137
137
|
# @return [Peddler::Response] The API response
|
138
138
|
def delete_destination(destination_id, rate_limit: 1.0)
|
139
|
-
path = "/notifications/v1/destinations/#{destination_id}"
|
139
|
+
path = "/notifications/v1/destinations/#{percent_encode(destination_id)}"
|
140
140
|
|
141
141
|
meter(rate_limit).delete(path)
|
142
142
|
end
|
@@ -124,17 +124,17 @@ module Peddler
|
|
124
124
|
"CreatedBefore" => created_before,
|
125
125
|
"LastUpdatedAfter" => last_updated_after,
|
126
126
|
"LastUpdatedBefore" => last_updated_before,
|
127
|
-
"OrderStatuses" => order_statuses,
|
128
|
-
"MarketplaceIds" => marketplace_ids,
|
129
|
-
"FulfillmentChannels" => fulfillment_channels,
|
130
|
-
"PaymentMethods" => payment_methods,
|
127
|
+
"OrderStatuses" => stringify_array(order_statuses),
|
128
|
+
"MarketplaceIds" => stringify_array(marketplace_ids),
|
129
|
+
"FulfillmentChannels" => stringify_array(fulfillment_channels),
|
130
|
+
"PaymentMethods" => stringify_array(payment_methods),
|
131
131
|
"BuyerEmail" => buyer_email,
|
132
132
|
"SellerOrderId" => seller_order_id,
|
133
133
|
"MaxResultsPerPage" => max_results_per_page,
|
134
|
-
"EasyShipShipmentStatuses" => easy_ship_shipment_statuses,
|
135
|
-
"ElectronicInvoiceStatuses" => electronic_invoice_statuses,
|
134
|
+
"EasyShipShipmentStatuses" => stringify_array(easy_ship_shipment_statuses),
|
135
|
+
"ElectronicInvoiceStatuses" => stringify_array(electronic_invoice_statuses),
|
136
136
|
"NextToken" => next_token,
|
137
|
-
"AmazonOrderIds" => amazon_order_ids,
|
137
|
+
"AmazonOrderIds" => stringify_array(amazon_order_ids),
|
138
138
|
"ActualFulfillmentSupplySourceId" => actual_fulfillment_supply_source_id,
|
139
139
|
"IsISPU" => is_ispu,
|
140
140
|
"StoreChainStoreId" => store_chain_store_id,
|
@@ -154,7 +154,7 @@ module Peddler
|
|
154
154
|
# @param rate_limit [Float] Requests per second
|
155
155
|
# @return [Peddler::Response] The API response
|
156
156
|
def get_order(order_id, rate_limit: 0.5)
|
157
|
-
path = "/orders/v0/orders/#{order_id}"
|
157
|
+
path = "/orders/v0/orders/#{percent_encode(order_id)}"
|
158
158
|
|
159
159
|
meter(rate_limit).get(path)
|
160
160
|
end
|
@@ -162,11 +162,11 @@ module Peddler
|
|
162
162
|
# Returns buyer information for the order that you specify.
|
163
163
|
#
|
164
164
|
# @note This operation can make a static sandbox call.
|
165
|
-
# @param order_id [String]
|
165
|
+
# @param order_id [String] The Amazon order identifier in 3-7-7 format.
|
166
166
|
# @param rate_limit [Float] Requests per second
|
167
167
|
# @return [Peddler::Response] The API response
|
168
168
|
def get_order_buyer_info(order_id, rate_limit: 0.5)
|
169
|
-
path = "/orders/v0/orders/#{order_id}/buyerInfo"
|
169
|
+
path = "/orders/v0/orders/#{percent_encode(order_id)}/buyerInfo"
|
170
170
|
|
171
171
|
meter(rate_limit).get(path)
|
172
172
|
end
|
@@ -174,11 +174,11 @@ module Peddler
|
|
174
174
|
# Returns the shipping address for the order that you specify.
|
175
175
|
#
|
176
176
|
# @note This operation can make a static sandbox call.
|
177
|
-
# @param order_id [String]
|
177
|
+
# @param order_id [String] The Amazon order identifier in 3-7-7 format.
|
178
178
|
# @param rate_limit [Float] Requests per second
|
179
179
|
# @return [Peddler::Response] The API response
|
180
180
|
def get_order_address(order_id, rate_limit: 0.5)
|
181
|
-
path = "/orders/v0/orders/#{order_id}/address"
|
181
|
+
path = "/orders/v0/orders/#{percent_encode(order_id)}/address"
|
182
182
|
|
183
183
|
meter(rate_limit).get(path)
|
184
184
|
end
|
@@ -197,7 +197,7 @@ module Peddler
|
|
197
197
|
# @param rate_limit [Float] Requests per second
|
198
198
|
# @return [Peddler::Response] The API response
|
199
199
|
def get_order_items(order_id, next_token: nil, rate_limit: 0.5)
|
200
|
-
path = "/orders/v0/orders/#{order_id}/orderItems"
|
200
|
+
path = "/orders/v0/orders/#{percent_encode(order_id)}/orderItems"
|
201
201
|
params = {
|
202
202
|
"NextToken" => next_token,
|
203
203
|
}.compact
|
@@ -213,7 +213,7 @@ module Peddler
|
|
213
213
|
# @param rate_limit [Float] Requests per second
|
214
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
|
-
path = "/orders/v0/orders/#{order_id}/orderItems/buyerInfo"
|
216
|
+
path = "/orders/v0/orders/#{percent_encode(order_id)}/orderItems/buyerInfo"
|
217
217
|
params = {
|
218
218
|
"NextToken" => next_token,
|
219
219
|
}.compact
|
@@ -229,7 +229,7 @@ module Peddler
|
|
229
229
|
# @param rate_limit [Float] Requests per second
|
230
230
|
# @return [Peddler::Response] The API response
|
231
231
|
def update_shipment_status(order_id, payload, rate_limit: 5.0)
|
232
|
-
path = "/orders/v0/orders/#{order_id}/shipment"
|
232
|
+
path = "/orders/v0/orders/#{percent_encode(order_id)}/shipment"
|
233
233
|
body = payload
|
234
234
|
|
235
235
|
meter(rate_limit).post(path, body:)
|
@@ -238,11 +238,11 @@ module Peddler
|
|
238
238
|
# Returns regulated information for the order that you specify.
|
239
239
|
#
|
240
240
|
# @note This operation can make a static sandbox call.
|
241
|
-
# @param order_id [String]
|
241
|
+
# @param order_id [String] The Amazon order identifier in 3-7-7 format.
|
242
242
|
# @param rate_limit [Float] Requests per second
|
243
243
|
# @return [Peddler::Response] The API response
|
244
244
|
def get_order_regulated_info(order_id, rate_limit: 0.5)
|
245
|
-
path = "/orders/v0/orders/#{order_id}/regulatedInfo"
|
245
|
+
path = "/orders/v0/orders/#{percent_encode(order_id)}/regulatedInfo"
|
246
246
|
|
247
247
|
meter(rate_limit).get(path)
|
248
248
|
end
|
@@ -250,12 +250,12 @@ module Peddler
|
|
250
250
|
# Updates (approves or rejects) the verification status of an order containing regulated products.
|
251
251
|
#
|
252
252
|
# @note This operation can make a static sandbox call.
|
253
|
-
# @param order_id [String]
|
253
|
+
# @param order_id [String] The Amazon 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
256
|
# @return [Peddler::Response] The API response
|
257
257
|
def update_verification_status(order_id, payload, rate_limit: 0.5)
|
258
|
-
path = "/orders/v0/orders/#{order_id}/regulatedInfo"
|
258
|
+
path = "/orders/v0/orders/#{percent_encode(order_id)}/regulatedInfo"
|
259
259
|
body = payload
|
260
260
|
|
261
261
|
meter(rate_limit).patch(path, body:)
|
@@ -269,7 +269,7 @@ module Peddler
|
|
269
269
|
# @param rate_limit [Float] Requests per second
|
270
270
|
# @return [Peddler::Response] The API response
|
271
271
|
def confirm_shipment(order_id, payload, rate_limit: 2.0)
|
272
|
-
path = "/orders/v0/orders/#{order_id}/shipmentConfirmation"
|
272
|
+
path = "/orders/v0/orders/#{percent_encode(order_id)}/shipmentConfirmation"
|
273
273
|
body = payload
|
274
274
|
|
275
275
|
meter(rate_limit).post(path, body:)
|
@@ -35,7 +35,7 @@ module Peddler
|
|
35
35
|
# @param rate_limit [Float] Requests per second
|
36
36
|
# @return [Peddler::Response] The API response
|
37
37
|
def get_my_fees_estimate_for_sku(body, seller_sku, rate_limit: 1.0)
|
38
|
-
path = "/products/fees/v0/listings/#{seller_sku}/feesEstimate"
|
38
|
+
path = "/products/fees/v0/listings/#{percent_encode(seller_sku)}/feesEstimate"
|
39
39
|
|
40
40
|
meter(rate_limit).post(path, body:)
|
41
41
|
end
|
@@ -56,7 +56,7 @@ module Peddler
|
|
56
56
|
# @param rate_limit [Float] Requests per second
|
57
57
|
# @return [Peddler::Response] The API response
|
58
58
|
def get_my_fees_estimate_for_asin(body, asin, rate_limit: 1.0)
|
59
|
-
path = "/products/fees/v0/items/#{asin}/feesEstimate"
|
59
|
+
path = "/products/fees/v0/items/#{percent_encode(asin)}/feesEstimate"
|
60
60
|
|
61
61
|
meter(rate_limit).post(path, body:)
|
62
62
|
end
|
@@ -42,8 +42,8 @@ module Peddler
|
|
42
42
|
path = "/products/pricing/v0/price"
|
43
43
|
params = {
|
44
44
|
"MarketplaceId" => marketplace_id,
|
45
|
-
"Asins" => asins,
|
46
|
-
"Skus" => skus,
|
45
|
+
"Asins" => stringify_array(asins),
|
46
|
+
"Skus" => stringify_array(skus),
|
47
47
|
"ItemType" => item_type,
|
48
48
|
"ItemCondition" => item_condition,
|
49
49
|
"OfferType" => offer_type,
|
@@ -76,8 +76,8 @@ module Peddler
|
|
76
76
|
path = "/products/pricing/v0/competitivePrice"
|
77
77
|
params = {
|
78
78
|
"MarketplaceId" => marketplace_id,
|
79
|
-
"Asins" => asins,
|
80
|
-
"Skus" => skus,
|
79
|
+
"Asins" => stringify_array(asins),
|
80
|
+
"Skus" => stringify_array(skus),
|
81
81
|
"ItemType" => item_type,
|
82
82
|
"CustomerType" => customer_type,
|
83
83
|
}.compact
|
@@ -100,7 +100,7 @@ module Peddler
|
|
100
100
|
# @param rate_limit [Float] Requests per second
|
101
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
|
-
path = "/products/pricing/v0/listings/#{seller_sku}/offers"
|
103
|
+
path = "/products/pricing/v0/listings/#{percent_encode(seller_sku)}/offers"
|
104
104
|
params = {
|
105
105
|
"MarketplaceId" => marketplace_id,
|
106
106
|
"ItemCondition" => item_condition,
|
@@ -122,7 +122,7 @@ module Peddler
|
|
122
122
|
# @param rate_limit [Float] Requests per second
|
123
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
|
-
path = "/products/pricing/v0/items/#{asin}/offers"
|
125
|
+
path = "/products/pricing/v0/items/#{percent_encode(asin)}/offers"
|
126
126
|
params = {
|
127
127
|
"MarketplaceId" => marketplace_id,
|
128
128
|
"ItemCondition" => item_condition,
|
@@ -37,8 +37,8 @@ module Peddler
|
|
37
37
|
search_locale: nil, rate_limit: 5.0)
|
38
38
|
path = "/definitions/2020-09-01/productTypes"
|
39
39
|
params = {
|
40
|
-
"keywords" => keywords,
|
41
|
-
"marketplaceIds" => marketplace_ids,
|
40
|
+
"keywords" => stringify_array(keywords),
|
41
|
+
"marketplaceIds" => stringify_array(marketplace_ids),
|
42
42
|
"itemName" => item_name,
|
43
43
|
"locale" => locale,
|
44
44
|
"searchLocale" => search_locale,
|
@@ -69,10 +69,10 @@ module Peddler
|
|
69
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
|
-
path = "/definitions/2020-09-01/productTypes/#{product_type}"
|
72
|
+
path = "/definitions/2020-09-01/productTypes/#{percent_encode(product_type)}"
|
73
73
|
params = {
|
74
74
|
"sellerId" => seller_id,
|
75
|
-
"marketplaceIds" => marketplace_ids,
|
75
|
+
"marketplaceIds" => stringify_array(marketplace_ids),
|
76
76
|
"productTypeVersion" => product_type_version,
|
77
77
|
"requirements" => requirements,
|
78
78
|
"requirementsEnforced" => requirements_enforced,
|
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "peddler/api"
|
4
|
+
require "peddler/helpers/reports_2021_06_30"
|
4
5
|
|
5
6
|
module Peddler
|
6
7
|
class << self
|
@@ -15,6 +16,8 @@ module Peddler
|
|
15
16
|
# The Selling Partner API for Reports lets you retrieve and manage a variety of reports that can help selling
|
16
17
|
# partners manage their businesses.
|
17
18
|
class Reports20210630 < API
|
19
|
+
include Peddler::Helpers::Reports20210630
|
20
|
+
|
18
21
|
# Returns report details for the reports that match the filters that you specify.
|
19
22
|
#
|
20
23
|
# @note This operation can make a static sandbox call.
|
@@ -41,9 +44,9 @@ module Peddler
|
|
41
44
|
created_since: nil, created_until: nil, next_token: nil, rate_limit: 0.0222)
|
42
45
|
path = "/reports/2021-06-30/reports"
|
43
46
|
params = {
|
44
|
-
"reportTypes" => report_types,
|
45
|
-
"processingStatuses" => processing_statuses,
|
46
|
-
"marketplaceIds" => marketplace_ids,
|
47
|
+
"reportTypes" => stringify_array(report_types),
|
48
|
+
"processingStatuses" => stringify_array(processing_statuses),
|
49
|
+
"marketplaceIds" => stringify_array(marketplace_ids),
|
47
50
|
"pageSize" => page_size,
|
48
51
|
"createdSince" => created_since,
|
49
52
|
"createdUntil" => created_until,
|
@@ -74,7 +77,7 @@ module Peddler
|
|
74
77
|
# @param rate_limit [Float] Requests per second
|
75
78
|
# @return [Peddler::Response] The API response
|
76
79
|
def cancel_report(report_id, rate_limit: 0.0222)
|
77
|
-
path = "/reports/2021-06-30/reports/#{report_id}"
|
80
|
+
path = "/reports/2021-06-30/reports/#{percent_encode(report_id)}"
|
78
81
|
|
79
82
|
meter(rate_limit).delete(path)
|
80
83
|
end
|
@@ -87,7 +90,7 @@ module Peddler
|
|
87
90
|
# @param rate_limit [Float] Requests per second
|
88
91
|
# @return [Peddler::Response] The API response
|
89
92
|
def get_report(report_id, rate_limit: 2.0)
|
90
|
-
path = "/reports/2021-06-30/reports/#{report_id}"
|
93
|
+
path = "/reports/2021-06-30/reports/#{percent_encode(report_id)}"
|
91
94
|
|
92
95
|
meter(rate_limit).get(path)
|
93
96
|
end
|
@@ -102,7 +105,7 @@ module Peddler
|
|
102
105
|
def get_report_schedules(report_types, rate_limit: 0.0222)
|
103
106
|
path = "/reports/2021-06-30/schedules"
|
104
107
|
params = {
|
105
|
-
"reportTypes" => report_types,
|
108
|
+
"reportTypes" => stringify_array(report_types),
|
106
109
|
}.compact
|
107
110
|
|
108
111
|
meter(rate_limit).get(path, params:)
|
@@ -129,7 +132,7 @@ module Peddler
|
|
129
132
|
# @param rate_limit [Float] Requests per second
|
130
133
|
# @return [Peddler::Response] The API response
|
131
134
|
def cancel_report_schedule(report_schedule_id, rate_limit: 0.0222)
|
132
|
-
path = "/reports/2021-06-30/schedules/#{report_schedule_id}"
|
135
|
+
path = "/reports/2021-06-30/schedules/#{percent_encode(report_schedule_id)}"
|
133
136
|
|
134
137
|
meter(rate_limit).delete(path)
|
135
138
|
end
|
@@ -142,7 +145,7 @@ module Peddler
|
|
142
145
|
# @param rate_limit [Float] Requests per second
|
143
146
|
# @return [Peddler::Response] The API response
|
144
147
|
def get_report_schedule(report_schedule_id, rate_limit: 0.0222)
|
145
|
-
path = "/reports/2021-06-30/schedules/#{report_schedule_id}"
|
148
|
+
path = "/reports/2021-06-30/schedules/#{percent_encode(report_schedule_id)}"
|
146
149
|
|
147
150
|
meter(rate_limit).get(path)
|
148
151
|
end
|
@@ -154,7 +157,7 @@ module Peddler
|
|
154
157
|
# @param rate_limit [Float] Requests per second
|
155
158
|
# @return [Peddler::Response] The API response
|
156
159
|
def get_report_document(report_document_id, rate_limit: 0.0167)
|
157
|
-
path = "/reports/2021-06-30/documents/#{report_document_id}"
|
160
|
+
path = "/reports/2021-06-30/documents/#{percent_encode(report_document_id)}"
|
158
161
|
|
159
162
|
meter(rate_limit).get(path)
|
160
163
|
end
|