peddler 2.4.5 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +402 -140
- data/lib/peddler/api/amazon_warehousing_and_distribution_2024_05_09.rb +92 -0
- data/lib/peddler/api/aplus_content_2020_11_01.rb +246 -0
- data/lib/peddler/api/application_integrations_2024_04_01.rb +56 -0
- data/lib/peddler/api/application_management_2023_11_30.rb +35 -0
- data/lib/peddler/api/catalog_items_2020_12_01.rb +81 -0
- data/lib/peddler/api/catalog_items_2022_04_01.rb +93 -0
- data/lib/peddler/api/catalog_items_v0.rb +103 -0
- data/lib/peddler/api/data_kiosk_2023_11_15.rb +108 -0
- data/lib/peddler/api/easy_ship_2022_03_23.rb +127 -0
- data/lib/peddler/api/fba_inbound_eligibility_v1.rb +44 -0
- data/lib/peddler/api/fba_inventory_v1.rb +122 -0
- data/lib/peddler/api/feeds_2021_06_30.rb +122 -0
- data/lib/peddler/api/finances_2024_06_19.rb +50 -0
- data/lib/peddler/api/finances_v0.rb +148 -0
- data/lib/peddler/api/fulfillment_inbound_2024_03_20.rb +759 -0
- data/lib/peddler/api/fulfillment_inbound_v0.rb +352 -0
- data/lib/peddler/api/fulfillment_outbound_2020_07_01.rb +259 -0
- data/lib/peddler/api/invoices_2024_06_19.rb +180 -0
- data/lib/peddler/api/listings_items_2020_09_01.rb +95 -0
- data/lib/peddler/api/listings_items_2021_08_01.rb +170 -0
- data/lib/peddler/api/listings_restrictions_2021_08_01.rb +47 -0
- data/lib/peddler/api/merchant_fulfillment_v0.rb +80 -0
- data/lib/peddler/api/messaging_v1.rb +273 -0
- data/lib/peddler/api/notifications_v1.rb +145 -0
- data/lib/peddler/api/orders_v0.rb +279 -0
- data/lib/peddler/api/product_fees_v0.rb +77 -0
- data/lib/peddler/api/product_pricing_2022_05_01.rb +54 -0
- data/lib/peddler/api/product_pricing_v0.rb +162 -0
- data/lib/peddler/api/product_type_definitions_2020_09_01.rb +86 -0
- data/lib/peddler/api/replenishment_2022_11_07.rb +57 -0
- data/lib/peddler/api/reports_2021_06_30.rb +163 -0
- data/lib/peddler/api/sales_v1.rb +77 -0
- data/lib/peddler/api/sellers_v1.rb +45 -0
- data/lib/peddler/api/services_v1.rb +348 -0
- data/lib/peddler/api/shipment_invoicing_v0.rb +59 -0
- data/lib/peddler/api/shipping_v1.rb +132 -0
- data/lib/peddler/api/shipping_v2.rb +319 -0
- data/lib/peddler/api/solicitations_v1.rb +63 -0
- data/lib/peddler/api/supply_sources_2020_07_01.rb +100 -0
- data/lib/peddler/api/tokens_2021_03_01.rb +38 -0
- data/lib/peddler/api/uploads_2020_11_01.rb +50 -0
- data/lib/peddler/api/vendor_direct_fulfillment_inventory_v1.rb +32 -0
- data/lib/peddler/api/vendor_direct_fulfillment_orders_2021_12_28.rb +84 -0
- data/lib/peddler/api/vendor_direct_fulfillment_orders_v1.rb +84 -0
- data/lib/peddler/api/vendor_direct_fulfillment_payments_v1.rb +31 -0
- data/lib/peddler/api/vendor_direct_fulfillment_sandbox_test_data_2021_10_28.rb +45 -0
- data/lib/peddler/api/vendor_direct_fulfillment_shipping_2021_12_28.rb +203 -0
- data/lib/peddler/api/vendor_direct_fulfillment_shipping_v1.rb +189 -0
- data/lib/peddler/api/vendor_direct_fulfillment_transactions_2021_12_28.rb +32 -0
- data/lib/peddler/api/vendor_direct_fulfillment_transactions_v1.rb +32 -0
- data/lib/peddler/api/vendor_invoices_v1.rb +30 -0
- data/lib/peddler/api/vendor_orders_v1.rb +159 -0
- data/lib/peddler/api/vendor_shipments_v1.rb +132 -0
- data/lib/peddler/api/vendor_transaction_status_v1.rb +33 -0
- data/lib/peddler/api.rb +138 -0
- data/lib/peddler/endpoint.rb +51 -0
- data/lib/peddler/error.rb +31 -0
- data/lib/peddler/marketplace.rb +38 -68
- data/lib/peddler/token.rb +70 -0
- data/lib/peddler/version.rb +1 -1
- data/lib/peddler.rb +56 -1
- metadata +74 -80
- data/lib/mws/easy_ship/client.rb +0 -93
- data/lib/mws/easy_ship.rb +0 -3
- data/lib/mws/feeds/client.rb +0 -122
- data/lib/mws/feeds.rb +0 -3
- data/lib/mws/finances/client.rb +0 -82
- data/lib/mws/finances.rb +0 -3
- data/lib/mws/fulfillment_inbound_shipment/client.rb +0 -388
- data/lib/mws/fulfillment_inbound_shipment.rb +0 -3
- data/lib/mws/fulfillment_inventory/client.rb +0 -57
- data/lib/mws/fulfillment_inventory.rb +0 -3
- data/lib/mws/fulfillment_outbound_shipment/client.rb +0 -211
- data/lib/mws/fulfillment_outbound_shipment.rb +0 -3
- data/lib/mws/merchant_fulfillment/client.rb +0 -87
- data/lib/mws/merchant_fulfillment.rb +0 -3
- data/lib/mws/off_amazon_payments.rb +0 -3
- data/lib/mws/orders/client.rb +0 -120
- data/lib/mws/orders.rb +0 -3
- data/lib/mws/products/client.rb +0 -268
- data/lib/mws/products.rb +0 -3
- data/lib/mws/recommendations/client.rb +0 -72
- data/lib/mws/recommendations.rb +0 -3
- data/lib/mws/reports/client.rb +0 -236
- data/lib/mws/reports.rb +0 -3
- data/lib/mws/sellers/client.rb +0 -44
- data/lib/mws/sellers.rb +0 -3
- data/lib/mws/shipment_invoicing/client.rb +0 -74
- data/lib/mws/shipment_invoicing.rb +0 -3
- data/lib/mws/subscriptions/client.rb +0 -179
- data/lib/mws/subscriptions.rb +0 -3
- data/lib/mws.rb +0 -29
- data/lib/peddler/client.rb +0 -159
- data/lib/peddler/errors/builder.rb +0 -64
- data/lib/peddler/errors/class_generator.rb +0 -40
- data/lib/peddler/errors/error.rb +0 -45
- data/lib/peddler/errors/parser.rb +0 -28
- data/lib/peddler/flat_file_parser.rb +0 -56
- data/lib/peddler/headers.rb +0 -102
- data/lib/peddler/operation.rb +0 -78
- data/lib/peddler/parser.rb +0 -33
- data/lib/peddler/structured_list.rb +0 -23
- data/lib/peddler/vcr_matcher.rb +0 -97
- data/lib/peddler/xml_parser.rb +0 -38
- data/lib/peddler/xml_response_parser.rb +0 -25
@@ -0,0 +1,319 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "peddler/api"
|
4
|
+
|
5
|
+
module Peddler
|
6
|
+
class << self
|
7
|
+
def shipping_v2(...)
|
8
|
+
API::ShippingV2.new(...)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
class API
|
13
|
+
# Amazon Shipping API
|
14
|
+
#
|
15
|
+
# The Amazon Shipping API is designed to support outbound shipping use cases both for orders originating on
|
16
|
+
# Amazon-owned marketplaces as well as external channels/marketplaces. With these APIs, you can request shipping
|
17
|
+
# rates, create shipments, cancel shipments, and track shipments.
|
18
|
+
class ShippingV2 < API
|
19
|
+
# Returns the available shipping service offerings.
|
20
|
+
#
|
21
|
+
# @note This operation can make a dynamic sandbox call.
|
22
|
+
# @param body [Hash]
|
23
|
+
# @param x_amzn_shipping_business_id [String] Amazon shipping business to assume for this request. The default is
|
24
|
+
# AmazonShipping_UK.
|
25
|
+
# @param rate_limit [Float] Requests per second
|
26
|
+
# @return [Hash] The API response
|
27
|
+
def get_rates(body, x_amzn_shipping_business_id: nil, rate_limit: 80.0)
|
28
|
+
path = "/shipping/v2/shipments/rates"
|
29
|
+
|
30
|
+
meter(rate_limit).post(path, body:)
|
31
|
+
end
|
32
|
+
|
33
|
+
# Purchases the shipping service for a shipment using the best fit service offering. Returns purchase related
|
34
|
+
# details and documents.
|
35
|
+
#
|
36
|
+
# @param body [Hash]
|
37
|
+
# @param x_amzn_idempotency_key [String] A unique value which the server uses to recognize subsequent retries of
|
38
|
+
# the same request.
|
39
|
+
# @param locale [String] The IETF Language Tag. Note that this only supports the primary language subtag with one
|
40
|
+
# secondary language subtag (i.e. en-US, fr-CA). The secondary language subtag is almost always a regional
|
41
|
+
# designation. This does not support additional subtags beyond the primary and secondary language subtags.
|
42
|
+
# @param x_amzn_shipping_business_id [String] Amazon shipping business to assume for this request. The default is
|
43
|
+
# AmazonShipping_UK.
|
44
|
+
# @param rate_limit [Float] Requests per second
|
45
|
+
# @return [Hash] The API response
|
46
|
+
def direct_purchase_shipment(body, x_amzn_idempotency_key: nil, locale: nil, x_amzn_shipping_business_id: nil,
|
47
|
+
rate_limit: 80.0)
|
48
|
+
cannot_sandbox!
|
49
|
+
|
50
|
+
path = "/shipping/v2/shipments/directPurchase"
|
51
|
+
|
52
|
+
meter(rate_limit).post(path, body:)
|
53
|
+
end
|
54
|
+
|
55
|
+
# Purchases a shipping service and returns purchase related details and documents. Note: You must complete the
|
56
|
+
# purchase within 10 minutes of rate creation by the shipping service provider. If you make the request after the
|
57
|
+
# 10 minutes have expired, you will receive an error response with the error code equal to "TOKEN_EXPIRED". If you
|
58
|
+
# receive this error response, you must get the rates for the shipment again.
|
59
|
+
#
|
60
|
+
# @note This operation can make a dynamic sandbox call.
|
61
|
+
# @param body [Hash]
|
62
|
+
# @param x_amzn_idempotency_key [String] A unique value which the server uses to recognize subsequent retries of
|
63
|
+
# the same request.
|
64
|
+
# @param x_amzn_shipping_business_id [String] Amazon shipping business to assume for this request. The default is
|
65
|
+
# AmazonShipping_UK.
|
66
|
+
# @param rate_limit [Float] Requests per second
|
67
|
+
# @return [Hash] The API response
|
68
|
+
def purchase_shipment(body, x_amzn_idempotency_key: nil, x_amzn_shipping_business_id: nil, rate_limit: 80.0)
|
69
|
+
path = "/shipping/v2/shipments"
|
70
|
+
|
71
|
+
meter(rate_limit).post(path, body:)
|
72
|
+
end
|
73
|
+
|
74
|
+
# Purchases a shipping service identifier and returns purchase-related details and documents.
|
75
|
+
#
|
76
|
+
# @note This operation can make a dynamic sandbox call.
|
77
|
+
# @param body [Hash]
|
78
|
+
# @param x_amzn_shipping_business_id [String] Amazon shipping business to assume for this request. The default is
|
79
|
+
# AmazonShipping_UK.
|
80
|
+
# @param rate_limit [Float] Requests per second
|
81
|
+
# @return [Hash] The API response
|
82
|
+
def one_click_shipment(body, x_amzn_shipping_business_id: nil, rate_limit: 80.0)
|
83
|
+
path = "/shipping/v2/oneClickShipment"
|
84
|
+
|
85
|
+
meter(rate_limit).post(path, body:)
|
86
|
+
end
|
87
|
+
|
88
|
+
# Returns tracking information for a purchased shipment.
|
89
|
+
#
|
90
|
+
# @note This operation can make a dynamic sandbox call.
|
91
|
+
# @param tracking_id [String] A carrier-generated tracking identifier originally returned by the purchaseShipment
|
92
|
+
# operation.
|
93
|
+
# @param carrier_id [String] A carrier identifier originally returned by the getRates operation for the selected
|
94
|
+
# rate.
|
95
|
+
# @param x_amzn_shipping_business_id [String] Amazon shipping business to assume for this request. The default is
|
96
|
+
# AmazonShipping_UK.
|
97
|
+
# @param rate_limit [Float] Requests per second
|
98
|
+
# @return [Hash] The API response
|
99
|
+
def get_tracking(tracking_id, carrier_id, x_amzn_shipping_business_id: nil, rate_limit: 80.0)
|
100
|
+
path = "/shipping/v2/tracking"
|
101
|
+
params = {
|
102
|
+
"trackingId" => tracking_id,
|
103
|
+
"carrierId" => carrier_id,
|
104
|
+
}.compact
|
105
|
+
|
106
|
+
meter(rate_limit).get(path, params:)
|
107
|
+
end
|
108
|
+
|
109
|
+
# Returns the shipping documents associated with a package in a shipment.
|
110
|
+
#
|
111
|
+
# @note This operation can make a dynamic sandbox call.
|
112
|
+
# @param shipment_id [String] The shipment identifier originally returned by the purchaseShipment operation.
|
113
|
+
# @param package_client_reference_id [String] The package client reference identifier originally provided in the
|
114
|
+
# request body parameter for the getRates operation.
|
115
|
+
# @param format [String] The file format of the document. Must be one of the supported formats returned by the
|
116
|
+
# getRates operation.
|
117
|
+
# @param dpi [Number] The resolution of the document (for example, 300 means 300 dots per inch). Must be one of
|
118
|
+
# the supported resolutions returned in the response to the getRates operation.
|
119
|
+
# @param x_amzn_shipping_business_id [String] Amazon shipping business to assume for this request. The default is
|
120
|
+
# AmazonShipping_UK.
|
121
|
+
# @param rate_limit [Float] Requests per second
|
122
|
+
# @return [Hash] The API response
|
123
|
+
def get_shipment_documents(shipment_id, package_client_reference_id, format: nil, dpi: nil,
|
124
|
+
x_amzn_shipping_business_id: nil, rate_limit: 80.0)
|
125
|
+
path = "/shipping/v2/shipments/#{shipment_id}/documents"
|
126
|
+
params = {
|
127
|
+
"packageClientReferenceId" => package_client_reference_id,
|
128
|
+
"format" => format,
|
129
|
+
"dpi" => dpi,
|
130
|
+
}.compact
|
131
|
+
|
132
|
+
meter(rate_limit).get(path, params:)
|
133
|
+
end
|
134
|
+
|
135
|
+
# Cancels a purchased shipment. Returns an empty object if the shipment is successfully cancelled.
|
136
|
+
#
|
137
|
+
# @note This operation can make a dynamic sandbox call.
|
138
|
+
# @param shipment_id [String] The shipment identifier originally returned by the purchaseShipment operation.
|
139
|
+
# @param x_amzn_shipping_business_id [String] Amazon shipping business to assume for this request. The default is
|
140
|
+
# AmazonShipping_UK.
|
141
|
+
# @param rate_limit [Float] Requests per second
|
142
|
+
# @return [Hash] The API response
|
143
|
+
def cancel_shipment(shipment_id, x_amzn_shipping_business_id: nil, rate_limit: 80.0)
|
144
|
+
path = "/shipping/v2/shipments/#{shipment_id}/cancel"
|
145
|
+
|
146
|
+
meter(rate_limit).put(path)
|
147
|
+
end
|
148
|
+
|
149
|
+
# Returns the JSON schema to use for providing additional inputs when needed to purchase a shipping offering. Call
|
150
|
+
# the getAdditionalInputs operation when the response to a previous call to the getRates operation indicates that
|
151
|
+
# additional inputs are required for the rate (shipping offering) that you want to purchase.
|
152
|
+
#
|
153
|
+
# @note This operation can make a static sandbox call.
|
154
|
+
# @param request_token [String] The request token returned in the response to the getRates operation.
|
155
|
+
# @param rate_id [String] The rate identifier for the shipping offering (rate) returned in the response to the
|
156
|
+
# getRates operation.
|
157
|
+
# @param x_amzn_shipping_business_id [String] Amazon shipping business to assume for this request. The default is
|
158
|
+
# AmazonShipping_UK.
|
159
|
+
# @param rate_limit [Float] Requests per second
|
160
|
+
# @return [Hash] The API response
|
161
|
+
def get_additional_inputs(request_token, rate_id, x_amzn_shipping_business_id: nil, rate_limit: 80.0)
|
162
|
+
path = "/shipping/v2/shipments/additionalInputs/schema"
|
163
|
+
params = {
|
164
|
+
"requestToken" => request_token,
|
165
|
+
"rateId" => rate_id,
|
166
|
+
}.compact
|
167
|
+
|
168
|
+
meter(rate_limit).get(path, params:)
|
169
|
+
end
|
170
|
+
|
171
|
+
# This API will return a list of input schema required to register a shipper account with the carrier.
|
172
|
+
#
|
173
|
+
# @param x_amzn_shipping_business_id [String] Amazon shipping business to assume for this request. The default is
|
174
|
+
# AmazonShipping_UK.
|
175
|
+
# @param rate_limit [Float] Requests per second
|
176
|
+
# @return [Hash] The API response
|
177
|
+
def get_carrier_account_form_inputs(x_amzn_shipping_business_id: nil, rate_limit: 80.0)
|
178
|
+
cannot_sandbox!
|
179
|
+
|
180
|
+
path = "/shipping/v2/carrierAccountFormInputs"
|
181
|
+
|
182
|
+
meter(rate_limit).get(path)
|
183
|
+
end
|
184
|
+
|
185
|
+
# This API will return Get all carrier accounts for a merchant.
|
186
|
+
#
|
187
|
+
# @param body [Hash]
|
188
|
+
# @param x_amzn_shipping_business_id [String] Amazon shipping business to assume for this request. The default is
|
189
|
+
# AmazonShipping_UK.
|
190
|
+
# @param rate_limit [Float] Requests per second
|
191
|
+
# @return [Hash] The API response
|
192
|
+
def get_carrier_accounts(body, x_amzn_shipping_business_id: nil, rate_limit: 80.0)
|
193
|
+
cannot_sandbox!
|
194
|
+
|
195
|
+
path = "/shipping/v2/carrierAccounts"
|
196
|
+
|
197
|
+
meter(rate_limit).put(path, body:)
|
198
|
+
end
|
199
|
+
|
200
|
+
# This API associates/links the specified carrier account with the merchant.
|
201
|
+
#
|
202
|
+
# @param carrier_id [String] The unique identifier associated with the carrier account.
|
203
|
+
# @param body [Hash]
|
204
|
+
# @param x_amzn_shipping_business_id [String] Amazon shipping business to assume for this request. The default is
|
205
|
+
# AmazonShipping_UK.
|
206
|
+
# @param rate_limit [Float] Requests per second
|
207
|
+
# @return [Hash] The API response
|
208
|
+
def link_carrier_account(carrier_id, body, x_amzn_shipping_business_id: nil, rate_limit: 80.0)
|
209
|
+
cannot_sandbox!
|
210
|
+
|
211
|
+
path = "/shipping/v2/carrierAccounts/#{carrier_id}"
|
212
|
+
|
213
|
+
meter(rate_limit).put(path, body:)
|
214
|
+
end
|
215
|
+
|
216
|
+
# This API Unlink the specified carrier account with the merchant.
|
217
|
+
#
|
218
|
+
# @param carrier_id [String] carrier Id to unlink with merchant.
|
219
|
+
# @param body [Hash]
|
220
|
+
# @param x_amzn_shipping_business_id [String] Amazon shipping business to assume for this request. The default is
|
221
|
+
# AmazonShipping_UK.
|
222
|
+
# @param rate_limit [Float] Requests per second
|
223
|
+
# @return [Hash] The API response
|
224
|
+
def unlink_carrier_account(carrier_id, body, x_amzn_shipping_business_id: nil, rate_limit: 80.0)
|
225
|
+
cannot_sandbox!
|
226
|
+
|
227
|
+
path = "/shipping/v2/carrierAccounts/#{carrier_id}/unlink"
|
228
|
+
|
229
|
+
meter(rate_limit).put(path, body:)
|
230
|
+
end
|
231
|
+
|
232
|
+
# This API Call to generate the collection form.
|
233
|
+
#
|
234
|
+
# @param body [Hash]
|
235
|
+
# @param x_amzn_idempotency_key [String] A unique value which the server uses to recognize subsequent retries of
|
236
|
+
# the same request.
|
237
|
+
# @param x_amzn_shipping_business_id [String] Amazon shipping business to assume for this request. The default is
|
238
|
+
# AmazonShipping_UK.
|
239
|
+
# @param rate_limit [Float] Requests per second
|
240
|
+
# @return [Hash] The API response
|
241
|
+
def generate_collection_form(body, x_amzn_idempotency_key: nil, x_amzn_shipping_business_id: nil,
|
242
|
+
rate_limit: 80.0)
|
243
|
+
cannot_sandbox!
|
244
|
+
|
245
|
+
path = "/shipping/v2/collectionForms"
|
246
|
+
|
247
|
+
meter(rate_limit).post(path, body:)
|
248
|
+
end
|
249
|
+
|
250
|
+
# This API Call to get the history of the previously generated collection forms.
|
251
|
+
#
|
252
|
+
# @param body [Hash]
|
253
|
+
# @param x_amzn_shipping_business_id [String] Amazon shipping business to assume for this request. The default is
|
254
|
+
# AmazonShipping_UK.
|
255
|
+
# @param rate_limit [Float] Requests per second
|
256
|
+
# @return [Hash] The API response
|
257
|
+
def get_collection_form_history(body, x_amzn_shipping_business_id: nil, rate_limit: 80.0)
|
258
|
+
cannot_sandbox!
|
259
|
+
|
260
|
+
path = "/shipping/v2/collectionForms/history"
|
261
|
+
|
262
|
+
meter(rate_limit).put(path, body:)
|
263
|
+
end
|
264
|
+
|
265
|
+
# This API Get all unmanifested carriers with shipment locations. Any locations which has unmanifested shipments
|
266
|
+
# with an eligible carrier for manifesting shall be returned.
|
267
|
+
#
|
268
|
+
# @param body [Hash]
|
269
|
+
# @param x_amzn_shipping_business_id [String] Amazon shipping business to assume for this request. The default is
|
270
|
+
# AmazonShipping_UK.
|
271
|
+
# @param rate_limit [Float] Requests per second
|
272
|
+
# @return [Hash] The API response
|
273
|
+
def get_unmanifested_shipments(body, x_amzn_shipping_business_id: nil, rate_limit: 80.0)
|
274
|
+
cannot_sandbox!
|
275
|
+
|
276
|
+
path = "/shipping/v2/unmanifestedShipments"
|
277
|
+
|
278
|
+
meter(rate_limit).put(path, body:)
|
279
|
+
end
|
280
|
+
|
281
|
+
# This API reprint a collection form.
|
282
|
+
#
|
283
|
+
# @param collection_form_id [String] collection form Id to reprint a collection.
|
284
|
+
# @param x_amzn_shipping_business_id [String] Amazon shipping business to assume for this request. The default is
|
285
|
+
# AmazonShipping_UK.
|
286
|
+
# @param rate_limit [Float] Requests per second
|
287
|
+
# @return [Hash] The API response
|
288
|
+
def get_collection_form(collection_form_id, x_amzn_shipping_business_id: nil, rate_limit: 80.0)
|
289
|
+
cannot_sandbox!
|
290
|
+
|
291
|
+
path = "/shipping/v2/collectionForms/#{collection_form_id}"
|
292
|
+
|
293
|
+
meter(rate_limit).get(path)
|
294
|
+
end
|
295
|
+
|
296
|
+
# Returns a list of access points in proximity of input postal code.
|
297
|
+
#
|
298
|
+
# @note This operation can make a dynamic sandbox call.
|
299
|
+
# @param access_point_types [Array<String>]
|
300
|
+
# @param country_code [String]
|
301
|
+
# @param postal_code [String]
|
302
|
+
# @param x_amzn_shipping_business_id [String] Amazon shipping business to assume for this request. The default is
|
303
|
+
# AmazonShipping_UK.
|
304
|
+
# @param rate_limit [Float] Requests per second
|
305
|
+
# @return [Hash] The API response
|
306
|
+
def get_access_points(access_point_types, country_code, postal_code, x_amzn_shipping_business_id: nil,
|
307
|
+
rate_limit: 80.0)
|
308
|
+
path = "/shipping/v2/accessPoints"
|
309
|
+
params = {
|
310
|
+
"accessPointTypes" => access_point_types,
|
311
|
+
"countryCode" => country_code,
|
312
|
+
"postalCode" => postal_code,
|
313
|
+
}.compact
|
314
|
+
|
315
|
+
meter(rate_limit).get(path, params:)
|
316
|
+
end
|
317
|
+
end
|
318
|
+
end
|
319
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "peddler/api"
|
4
|
+
|
5
|
+
module Peddler
|
6
|
+
class << self
|
7
|
+
def solicitations_v1(...)
|
8
|
+
API::SolicitationsV1.new(...)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
class API
|
13
|
+
# Selling Partner API for Solicitations
|
14
|
+
#
|
15
|
+
# With the Solicitations API you can build applications that send non-critical solicitations to buyers. You can get
|
16
|
+
# a list of solicitation types that are available for an order that you specify, then call an operation that sends a
|
17
|
+
# solicitation to the buyer for that order. Buyers cannot respond to solicitations sent by this API, and these
|
18
|
+
# solicitations do not appear in the Messaging section of Seller Central or in the recipient's Message Center. The
|
19
|
+
# Solicitations API returns responses that are formed according to the <a
|
20
|
+
# href=https://tools.ietf.org/html/draft-kelly-json-hal-08>JSON Hypertext Application Language</a> (HAL) standard.
|
21
|
+
class SolicitationsV1 < API
|
22
|
+
# Returns a list of solicitation types that are available for an order that you specify. A solicitation type is
|
23
|
+
# represented by an actions object, which contains a path and query parameter(s). You can use the path and
|
24
|
+
# parameter(s) to call an operation that sends a solicitation. Currently only the
|
25
|
+
# productReviewAndSellerFeedbackSolicitation solicitation type is available.
|
26
|
+
#
|
27
|
+
# @note This operation can make a static sandbox call.
|
28
|
+
# @param amazon_order_id [String] An Amazon order identifier. This specifies the order for which you want a list
|
29
|
+
# of available solicitation types.
|
30
|
+
# @param marketplace_ids [Array<String>] A marketplace identifier. This specifies the marketplace in which the
|
31
|
+
# order was placed. Only one marketplace can be specified.
|
32
|
+
# @param rate_limit [Float] Requests per second
|
33
|
+
# @return [Hash] The API response
|
34
|
+
def get_solicitation_actions_for_order(amazon_order_id, marketplace_ids, rate_limit: 1.0)
|
35
|
+
path = "/solicitations/v1/orders/#{amazon_order_id}"
|
36
|
+
params = {
|
37
|
+
"marketplaceIds" => marketplace_ids,
|
38
|
+
}.compact
|
39
|
+
|
40
|
+
meter(rate_limit).get(path, params:)
|
41
|
+
end
|
42
|
+
|
43
|
+
# Sends a solicitation to a buyer asking for seller feedback and a product review for the specified order. Send
|
44
|
+
# only one productReviewAndSellerFeedback or free form proactive message per order.
|
45
|
+
#
|
46
|
+
# @note This operation can make a static sandbox call.
|
47
|
+
# @param amazon_order_id [String] An Amazon order identifier. This specifies the order for which a solicitation is
|
48
|
+
# sent.
|
49
|
+
# @param marketplace_ids [Array<String>] A marketplace identifier. This specifies the marketplace in which the
|
50
|
+
# order was placed. Only one marketplace can be specified.
|
51
|
+
# @param rate_limit [Float] Requests per second
|
52
|
+
# @return [Hash] The API response
|
53
|
+
def create_product_review_and_seller_feedback_solicitation(amazon_order_id, marketplace_ids, rate_limit: 1.0)
|
54
|
+
path = "/solicitations/v1/orders/#{amazon_order_id}/solicitations/productReviewAndSellerFeedback"
|
55
|
+
params = {
|
56
|
+
"marketplaceIds" => marketplace_ids,
|
57
|
+
}.compact
|
58
|
+
|
59
|
+
meter(rate_limit).post(path, params:)
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
@@ -0,0 +1,100 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "peddler/api"
|
4
|
+
|
5
|
+
module Peddler
|
6
|
+
class << self
|
7
|
+
def supply_sources_2020_07_01(...)
|
8
|
+
API::SupplySources20200701.new(...)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
class API
|
13
|
+
# Selling Partner API for Supply Sources
|
14
|
+
#
|
15
|
+
# Manage configurations and capabilities of seller supply sources.
|
16
|
+
class SupplySources20200701 < API
|
17
|
+
# The path to retrieve paginated supply sources.
|
18
|
+
#
|
19
|
+
# @note This operation can make a static sandbox call.
|
20
|
+
# @param next_page_token [String] The pagination token to retrieve a specific page of results.
|
21
|
+
# @param page_size [Number] The number of supply sources to return per paginated request.
|
22
|
+
# @param rate_limit [Float] Requests per second
|
23
|
+
# @return [Hash] The API response
|
24
|
+
def get_supply_sources(next_page_token: nil, page_size: 10, rate_limit: nil)
|
25
|
+
path = "/supplySources/2020-07-01/supplySources"
|
26
|
+
params = {
|
27
|
+
"nextPageToken" => next_page_token,
|
28
|
+
"pageSize" => page_size,
|
29
|
+
}.compact
|
30
|
+
|
31
|
+
get(path, params:)
|
32
|
+
end
|
33
|
+
|
34
|
+
# Create a new supply source.
|
35
|
+
#
|
36
|
+
# @note This operation can make a static sandbox call.
|
37
|
+
# @param payload [Hash] A request to create a supply source.
|
38
|
+
# @param rate_limit [Float] Requests per second
|
39
|
+
# @return [Hash] The API response
|
40
|
+
def create_supply_source(payload, rate_limit: nil)
|
41
|
+
path = "/supplySources/2020-07-01/supplySources"
|
42
|
+
body = payload
|
43
|
+
|
44
|
+
post(path, body:)
|
45
|
+
end
|
46
|
+
|
47
|
+
# Retrieve a supply source.
|
48
|
+
#
|
49
|
+
# @note This operation can make a static sandbox call.
|
50
|
+
# @param supply_source_id [String] The unique identifier of a supply source.
|
51
|
+
# @param rate_limit [Float] Requests per second
|
52
|
+
# @return [Hash] The API response
|
53
|
+
def get_supply_source(supply_source_id, rate_limit: nil)
|
54
|
+
path = "/supplySources/2020-07-01/supplySources/#{supply_source_id}"
|
55
|
+
|
56
|
+
get(path)
|
57
|
+
end
|
58
|
+
|
59
|
+
# Update the configuration and capabilities of a supply source.
|
60
|
+
#
|
61
|
+
# @note This operation can make a static sandbox call.
|
62
|
+
# @param supply_source_id [String] The unique identitier of a supply source.
|
63
|
+
# @param payload [Hash]
|
64
|
+
# @param rate_limit [Float] Requests per second
|
65
|
+
# @return [Hash] The API response
|
66
|
+
def update_supply_source(supply_source_id, payload: nil, rate_limit: nil)
|
67
|
+
path = "/supplySources/2020-07-01/supplySources/#{supply_source_id}"
|
68
|
+
body = payload
|
69
|
+
|
70
|
+
put(path, body:)
|
71
|
+
end
|
72
|
+
|
73
|
+
# Archive a supply source, making it inactive. Cannot be undone.
|
74
|
+
#
|
75
|
+
# @note This operation can make a static sandbox call.
|
76
|
+
# @param supply_source_id [String] The unique identifier of a supply source.
|
77
|
+
# @param rate_limit [Float] Requests per second
|
78
|
+
# @return [Hash] The API response
|
79
|
+
def archive_supply_source(supply_source_id, rate_limit: nil)
|
80
|
+
path = "/supplySources/2020-07-01/supplySources/#{supply_source_id}"
|
81
|
+
|
82
|
+
delete(path)
|
83
|
+
end
|
84
|
+
|
85
|
+
# Update the status of a supply source.
|
86
|
+
#
|
87
|
+
# @note This operation can make a static sandbox call.
|
88
|
+
# @param supply_source_id [String] The unique identifier of a supply source.
|
89
|
+
# @param payload [Hash]
|
90
|
+
# @param rate_limit [Float] Requests per second
|
91
|
+
# @return [Hash] The API response
|
92
|
+
def update_supply_source_status(supply_source_id, payload: nil, rate_limit: nil)
|
93
|
+
path = "/supplySources/2020-07-01/supplySources/#{supply_source_id}/status"
|
94
|
+
body = payload
|
95
|
+
|
96
|
+
put(path, body:)
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "peddler/api"
|
4
|
+
|
5
|
+
module Peddler
|
6
|
+
class << self
|
7
|
+
def tokens_2021_03_01(...)
|
8
|
+
API::Tokens20210301.new(...)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
class API
|
13
|
+
# Selling Partner API for Tokens
|
14
|
+
#
|
15
|
+
# The Selling Partner API for Tokens provides a secure way to access a customer's PII (Personally Identifiable
|
16
|
+
# Information). You can call the Tokens API to get a Restricted Data Token (RDT) for one or more restricted
|
17
|
+
# resources that you specify. The RDT authorizes subsequent calls to restricted operations that correspond to the
|
18
|
+
# restricted resources that you specified. For more information, see the
|
19
|
+
# {https://developer-docs.amazon.com/sp-api/docs/tokens-api-use-case-guide Tokens API Use Case Guide}.
|
20
|
+
class Tokens20210301 < API
|
21
|
+
# Returns a Restricted Data Token (RDT) for one or more restricted resources that you specify. A restricted
|
22
|
+
# resource is the HTTP method and path from a restricted operation that returns Personally Identifiable
|
23
|
+
# Information (PII), plus a dataElements value that indicates the type of PII requested. See the Tokens API Use
|
24
|
+
# Case Guide for a list of restricted operations. Use the RDT returned here as the access token in subsequent
|
25
|
+
# calls to the corresponding restricted operations.
|
26
|
+
#
|
27
|
+
# @note This operation can make a static sandbox call.
|
28
|
+
# @param body [Hash] The restricted data token request details.
|
29
|
+
# @param rate_limit [Float] Requests per second
|
30
|
+
# @return [Hash] The API response
|
31
|
+
def create_restricted_data_token(body, rate_limit: 1.0)
|
32
|
+
path = "/tokens/2021-03-01/restrictedDataToken"
|
33
|
+
|
34
|
+
meter(rate_limit).post(path, body:)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "peddler/api"
|
4
|
+
|
5
|
+
module Peddler
|
6
|
+
class << self
|
7
|
+
def uploads_2020_11_01(...)
|
8
|
+
API::Uploads20201101.new(...)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
class API
|
13
|
+
# Selling Partner API for Uploads
|
14
|
+
#
|
15
|
+
# The Uploads API lets you upload files that you can programmatically access using other Selling Partner APIs, such
|
16
|
+
# as the A+ Content API and the Messaging API.
|
17
|
+
class Uploads20201101 < API
|
18
|
+
# Creates an upload destination, returning the information required to upload a file to the destination and to
|
19
|
+
# programmatically access the file.
|
20
|
+
#
|
21
|
+
# @param marketplace_ids [Array<String>] A list of marketplace identifiers. This specifies the marketplaces where
|
22
|
+
# the upload will be available. Only one marketplace can be specified.
|
23
|
+
# @param content_md5 [String] An MD5 hash of the content to be submitted to the upload destination. This value is
|
24
|
+
# used to determine if the data has been corrupted or tampered with during transit.
|
25
|
+
# @param resource [String] The resource for the upload destination that you are creating. For example, if you are
|
26
|
+
# creating an upload destination for the createLegalDisclosure operation of the Messaging API, the `{resource}`
|
27
|
+
# would be `/messaging/v1/orders/{amazonOrderId}/messages/legalDisclosure`, and the entire path would be
|
28
|
+
# `/uploads/2020-11-01/uploadDestinations/messaging/v1/orders/{amazonOrderId}/messages/legalDisclosure`. If you
|
29
|
+
# are creating an upload destination for an Aplus content document, the `{resource}` would be
|
30
|
+
# `aplus/2020-11-01/contentDocuments` and the path would be
|
31
|
+
# `/uploads/v1/uploadDestinations/aplus/2020-11-01/contentDocuments`.
|
32
|
+
# @param content_type [String] The content type of the file to be uploaded.
|
33
|
+
# @param rate_limit [Float] Requests per second
|
34
|
+
# @return [Hash] The API response
|
35
|
+
def create_upload_destination_for_resource(marketplace_ids, content_md5, resource, content_type: nil,
|
36
|
+
rate_limit: 10.0)
|
37
|
+
cannot_sandbox!
|
38
|
+
|
39
|
+
path = "/uploads/2020-11-01/uploadDestinations/#{resource}"
|
40
|
+
params = {
|
41
|
+
"marketplaceIds" => marketplace_ids,
|
42
|
+
"contentMD5" => content_md5,
|
43
|
+
"contentType" => content_type,
|
44
|
+
}.compact
|
45
|
+
|
46
|
+
meter(rate_limit).post(path, params:)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "peddler/api"
|
4
|
+
|
5
|
+
module Peddler
|
6
|
+
class << self
|
7
|
+
def vendor_direct_fulfillment_inventory_v1(...)
|
8
|
+
API::VendorDirectFulfillmentInventoryV1.new(...)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
class API
|
13
|
+
# Selling Partner API for Direct Fulfillment Inventory Updates
|
14
|
+
#
|
15
|
+
# The Selling Partner API for Direct Fulfillment Inventory Updates provides programmatic access to a direct
|
16
|
+
# fulfillment vendor's inventory updates.
|
17
|
+
class VendorDirectFulfillmentInventoryV1 < API
|
18
|
+
# Submits inventory updates for the specified warehouse for either a partial or full feed of inventory items.
|
19
|
+
#
|
20
|
+
# @note This operation can make a static sandbox call.
|
21
|
+
# @param body [Hash] The request body that contains the inventory update data to submit.
|
22
|
+
# @param warehouse_id [String] Identifier for the warehouse for which to update inventory.
|
23
|
+
# @param rate_limit [Float] Requests per second
|
24
|
+
# @return [Hash] The API response
|
25
|
+
def submit_inventory_update(body, warehouse_id, rate_limit: 10.0)
|
26
|
+
path = "/vendor/directFulfillment/inventory/v1/warehouses/#{warehouse_id}/items"
|
27
|
+
|
28
|
+
meter(rate_limit).post(path, body:)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|