peddler 2.1.0 → 2.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +43 -41
- data/lib/mws.rb +2 -1
- data/lib/mws/easy_ship.rb +3 -0
- data/lib/mws/easy_ship/client.rb +93 -0
- data/lib/mws/fulfillment_inbound_shipment/client.rb +2 -2
- data/lib/mws/fulfillment_outbound_shipment/client.rb +1 -1
- data/lib/mws/orders/client.rb +7 -9
- data/lib/mws/reports/client.rb +9 -0
- data/lib/mws/shipment_invoicing.rb +3 -0
- data/lib/mws/shipment_invoicing/client.rb +74 -0
- data/lib/mws/subscriptions/client.rb +2 -2
- data/lib/peddler/client.rb +19 -15
- data/lib/peddler/errors/builder.rb +7 -2
- data/lib/peddler/errors/class_generator.rb +9 -4
- data/lib/peddler/errors/error.rb +6 -2
- data/lib/peddler/errors/parser.rb +1 -1
- data/lib/peddler/flat_file_parser.rb +6 -4
- data/lib/peddler/headers.rb +53 -1
- data/lib/peddler/marketplace.rb +24 -22
- data/lib/peddler/operation.rb +17 -11
- data/lib/peddler/parser.rb +1 -1
- data/lib/peddler/structured_list.rb +1 -1
- data/lib/peddler/vcr_matcher.rb +7 -7
- data/lib/peddler/version.rb +1 -1
- data/lib/peddler/xml_parser.rb +1 -1
- data/lib/peddler/xml_response_parser.rb +3 -2
- metadata +15 -150
- data/lib/mws/off_amazon_payments/client.rb +0 -362
- data/lib/mws/reports/parser.rb +0 -35
- data/test/credentials.rb +0 -23
- data/test/helper.rb +0 -15
- data/test/integration/test_errors.rb +0 -25
- data/test/integration/test_feeds.rb +0 -37
- data/test/integration/test_fulfillment_inbound_shipment.rb +0 -35
- data/test/integration/test_fulfillment_inventory.rb +0 -20
- data/test/integration/test_fulfillment_outbound_shipment.rb +0 -13
- data/test/integration/test_merchant_fulfillment.rb +0 -69
- data/test/integration/test_multibyte_queries.rb +0 -17
- data/test/integration/test_mws_headers.rb +0 -16
- data/test/integration/test_off_amazon_payments.rb +0 -13
- data/test/integration/test_orders.rb +0 -30
- data/test/integration/test_products.rb +0 -97
- data/test/integration/test_recommendations.rb +0 -20
- data/test/integration/test_reports.rb +0 -51
- data/test/integration/test_sellers.rb +0 -13
- data/test/integration/test_subscriptions.rb +0 -27
- data/test/integration_helper.rb +0 -53
- data/test/mws.yml +0 -36
- data/test/mws.yml.example +0 -32
- data/test/null_client.rb +0 -25
- data/test/recorder.rb +0 -39
- data/test/unit/mws/test_feeds_client.rb +0 -103
- data/test/unit/mws/test_finances_client.rb +0 -74
- data/test/unit/mws/test_fulfillment_inbound_shipment_client.rb +0 -426
- data/test/unit/mws/test_fulfillment_inventory_client.rb +0 -48
- data/test/unit/mws/test_fulfillment_outbound_shipment_client.rb +0 -202
- data/test/unit/mws/test_merchant_fulfillment_client.rb +0 -109
- data/test/unit/mws/test_off_amazon_payments_client.rb +0 -286
- data/test/unit/mws/test_orders_client.rb +0 -111
- data/test/unit/mws/test_products_client.rb +0 -248
- data/test/unit/mws/test_recommendations_client.rb +0 -62
- data/test/unit/mws/test_reports_client.rb +0 -209
- data/test/unit/mws/test_sellers_client.rb +0 -47
- data/test/unit/mws/test_subscriptions_client.rb +0 -182
- data/test/unit/peddler/errors/test_builder.rb +0 -65
- data/test/unit/peddler/errors/test_class_generator.rb +0 -18
- data/test/unit/peddler/errors/test_error.rb +0 -33
- data/test/unit/peddler/errors/test_parser.rb +0 -44
- data/test/unit/peddler/test_client.rb +0 -203
- data/test/unit/peddler/test_flat_file_parser.rb +0 -102
- data/test/unit/peddler/test_headers.rb +0 -55
- data/test/unit/peddler/test_marketplace.rb +0 -47
- data/test/unit/peddler/test_operation.rb +0 -87
- data/test/unit/peddler/test_parser.rb +0 -36
- data/test/unit/peddler/test_structured_list.rb +0 -39
- data/test/unit/peddler/test_vcr_matcher.rb +0 -55
- data/test/unit/peddler/test_xml_parser.rb +0 -37
- data/test/unit/peddler/test_xml_response_parser.rb +0 -39
- data/test/unit/test_mws.rb +0 -11
- data/test/vcr_cassettes/CartInformation.yml +0 -433
- data/test/vcr_cassettes/CustomerInformation.yml +0 -433
- data/test/vcr_cassettes/Errors.yml +0 -885
- data/test/vcr_cassettes/Feeds.yml +0 -9957
- data/test/vcr_cassettes/FulfillmentInboundShipment.yml +0 -6166
- data/test/vcr_cassettes/FulfillmentInventory.yml +0 -850
- data/test/vcr_cassettes/FulfillmentOutboundShipment.yml +0 -433
- data/test/vcr_cassettes/MWSHeaders.yml +0 -2964
- data/test/vcr_cassettes/MerchantFulfillment.yml +0 -753
- data/test/vcr_cassettes/MultibyteQueries.yml +0 -437
- data/test/vcr_cassettes/OffAmazonPayments.yml +0 -433
- data/test/vcr_cassettes/Orders.yml +0 -4740
- data/test/vcr_cassettes/PeddlerVCRMatcher.yml +0 -41
- data/test/vcr_cassettes/Products.yml +0 -7139
- data/test/vcr_cassettes/Recommendations.yml +0 -3145
- data/test/vcr_cassettes/Reports.yml +0 -5549
- data/test/vcr_cassettes/Sellers.yml +0 -433
- data/test/vcr_cassettes/Subscriptions.yml +0 -1529
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f4a66be7a75ab648d2ad1780ee497a77849b7530943834db809822702989a310
|
4
|
+
data.tar.gz: 4fb3d4cc33073309224aa39f8689e5ef101109fb0aec1b2bded2e09d8626b7f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2dc3c385ac768a25017570de392fca4000ee21428d0ede8a54c854867a4873001b30cd1d41ab1f01d762e260af31952982d756981a1e3d7dff90ef5f29326daa
|
7
|
+
data.tar.gz: 94d60b85d866ad6825ae6e7f41753b39ad6debe47e020934445698489e6baf4976076ec1548426fae6c9df197923386d56948228c6ea875a2d6df9bbe220cdd8
|
data/README.md
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
# Peddler
|
2
2
|
|
3
|
-
[![Build
|
3
|
+
[![Build](https://github.com/hakanensari/peddler/workflows/build/badge.svg)](https://github.com/hakanensari/peddler/actions)
|
4
4
|
[![Maintainability](https://api.codeclimate.com/v1/badges/281e6176048f3c0a1ed3/maintainability)](https://codeclimate.com/github/hakanensari/peddler/maintainability)
|
5
5
|
[![Test Coverage](https://api.codeclimate.com/v1/badges/281e6176048f3c0a1ed3/test_coverage)](https://codeclimate.com/github/hakanensari/peddler/test_coverage)
|
6
6
|
|
7
7
|
**Peddler** is a Ruby interface to the [Amazon MWS API](https://developer.amazonservices.com/), a collection of web services that help Amazon sellers programmatically exchange data on their listings, orders, payments, reports, and more.
|
8
8
|
|
9
|
-
To use Amazon MWS, you must have an eligible seller account and register as
|
9
|
+
To use Amazon MWS, you must have an eligible seller account and [register as a developer](https://docs.developer.amazonservices.com/en_US/dev_guide/DG_Registering.html#DG_Registering__RegisteringAsADeveloper). You can then access your own selling account using its merchant ID—note that Amazon also refers to this as seller ID or merchant token in different places.
|
10
10
|
|
11
11
|
Amazon has [multiple regions](https://docs.developer.amazonservices.com/en_US/dev_guide/DG_Endpoints.html). Each region requires application developers to register individually. Some MWS API sections may require additional authorisation from Amazon.
|
12
12
|
|
@@ -120,7 +120,7 @@ Read [tips on how to avoid throttling](https://docs.developer.amazonservices.com
|
|
120
120
|
|
121
121
|
### Debugging
|
122
122
|
|
123
|
-
If you are having trouble with a request, read the [Amazon documentation](https://developer.amazonservices.com/gp/mws/docs.html). [Peddler's source](
|
123
|
+
If you are having trouble with a request, read the [Amazon documentation](https://developer.amazonservices.com/gp/mws/docs.html). [Peddler's source](https://www.rubydoc.info/github/hakanensari/peddler) also links individual operations to their corresponding entries in the Amazon docs.
|
124
124
|
|
125
125
|
Note that some optional keywords have default values.
|
126
126
|
|
@@ -138,34 +138,41 @@ You can access the same attributes on `error.response`. See <a href="#throttling
|
|
138
138
|
|
139
139
|
## The APIs
|
140
140
|
|
141
|
+
### Easy Ship
|
142
|
+
|
143
|
+
With the Easy Ship API, you can build applications that help sellers in India manage and ship their Amazon Easy Ship orders. Your Amazon Easy Ship applications can get available pickup slots; schedule, reschedule, and cancel pickups; and print labels, invoices, and warranties.
|
144
|
+
|
145
|
+
- [Amazon references](https://docs.developer.amazonservices.com/en_US/easy_ship/EasyShip_Overview.html)
|
146
|
+
- [Peddler API docs](https://www.rubydoc.info/gems/peddler/MWS/EasyShip/Client)
|
147
|
+
|
141
148
|
### Feeds
|
142
149
|
|
143
150
|
The MWS Feeds API lets you upload inventory and order data to Amazon. You can also use this API to get information about the processing of feeds.
|
144
151
|
|
145
|
-
- [Amazon references](https://developer.amazonservices.com/
|
146
|
-
- [Peddler API docs](
|
152
|
+
- [Amazon references](https://docs.developer.amazonservices.com/en_US/feeds/Feeds_Overview.html)
|
153
|
+
- [Peddler API docs](https://www.rubydoc.info/gems/peddler/MWS/Feeds/Client)
|
147
154
|
- [XML schema docs](https://sellercentral.amazon.com/gp/help/help-page.html?itemID=1611)
|
148
155
|
|
149
156
|
### Finances
|
150
157
|
|
151
158
|
The MWS Finances API enables you to obtain financial information relevant to your business with Amazon. You can obtain financial events for a given order, financial event group, or date range without having to wait until a statement period closes. You can also obtain financial event groups for a given date range.
|
152
159
|
|
153
|
-
- [Amazon references](https://developer.amazonservices.com/
|
154
|
-
- [Peddler API docs](
|
160
|
+
- [Amazon references](https://docs.developer.amazonservices.com/en_US/finances/Finances_Overview.html)
|
161
|
+
- [Peddler API docs](https://www.rubydoc.info/gems/peddler/MWS/Finances/Client)
|
155
162
|
|
156
163
|
### Fulfillment Inbound Shipment
|
157
164
|
|
158
165
|
With the MWS Fulfillment Inbound Shipment API, you can create and update inbound shipments of inventory in the Amazon Fulfillment Network. You can also also request lists of inbound shipments or inbound shipment items based on criteria that you specify.
|
159
166
|
|
160
|
-
- [Amazon references](https://developer.amazonservices.com/
|
161
|
-
- [Peddler API docs](
|
167
|
+
- [Amazon references](https://docs.developer.amazonservices.com/en_US/fba_inbound/FBAInbound_Overview.html)
|
168
|
+
- [Peddler API docs](https://www.rubydoc.info/gems/peddler/MWS/FulfillmentInboundShipment/Client)
|
162
169
|
|
163
170
|
### Fulfillment Inventory
|
164
171
|
|
165
172
|
The MWS Fulfillment Inventory API can help you stay up-to-date on the availability of your inventory in the Amazon Fulfillment Network. The Fulfillment Inventory API reports real-time availability information for your Amazon Fulfillment Network inventory regardless of whether you are selling your inventory on Amazon's retail web site or through other retail channels.
|
166
173
|
|
167
|
-
- [Amazon references](https://developer.amazonservices.com/
|
168
|
-
- [Peddler API docs](
|
174
|
+
- [Amazon references](https://docs.developer.amazonservices.com/en_US/fba_inventory/FBAInventory_Overview.html)
|
175
|
+
- [Peddler API docs](https://www.rubydoc.info/gems/peddler/MWS/FulfillmentInventory/Client)
|
169
176
|
|
170
177
|
### Fulfillment Outbound Shipment
|
171
178
|
|
@@ -173,68 +180,63 @@ The MWS Fulfillment Outbound Shipment API enables you to fulfill orders placed t
|
|
173
180
|
|
174
181
|
Support for creating and cancelling fulfillment orders has been implemented, but the rest of the API is not supported yet.
|
175
182
|
|
176
|
-
- [Amazon references](https://developer.amazonservices.com/
|
177
|
-
- [Peddler API docs](
|
183
|
+
- [Amazon references](https://docs.developer.amazonservices.com/en_US/fba_outbound/FBAOutbound_Overview.html)
|
184
|
+
- [Peddler API docs](https://www.rubydoc.info/gems/peddler/MWS/FulfillmentOutboundShipment/Client)
|
178
185
|
|
179
186
|
### Merchant Fulfillment
|
180
187
|
|
181
188
|
The Merchant Fulfillment API provides programmatic access to Amazon’s fulfillment shipping services for sellers, including competitive rates with Amazon-partnered carriers. Sellers can find out what shipping services are available by submitting information about a proposed fulfillment shipment, such as package size and weight; shipment origin and destination; and delivery date requirements. Sellers can choose from the shipping service options returned by Amazon, and then receive shipping labels for fulfilling their orders.
|
182
189
|
|
183
|
-
- [Amazon references](https://developer.amazonservices.com/
|
184
|
-
- [Peddler API docs](
|
185
|
-
|
186
|
-
### Off Amazon Payments
|
187
|
-
|
188
|
-
The MWS Off-Amazon Payments API helps you to process payments for purchases made by buyers on your website using the Login and Pay with Amazon service. This API enables you to programmatically retrieve shipping and payment information provided by the buyer from their Amazon account. It allows you to authorize, capture, and refund payments, enabling a variety of payments scenarios.
|
189
|
-
|
190
|
-
You can switch the client to the sandbox environment:
|
191
|
-
|
192
|
-
```ruby
|
193
|
-
client = MWS.off_amazon_payments.sandbox
|
194
|
-
```
|
195
|
-
|
196
|
-
- [Amazon references](https://developer.amazonservices.com/gp/mws/api.html?group=offamazonpayments§ion=offamazonpayments)
|
197
|
-
- [Official Ruby client](https://github.com/amzn/login-and-pay-with-amazon-sdk-ruby)
|
198
|
-
- [Peddler API docs](http://www.rubydoc.info/gems/peddler/MWS/OffAmazonPayments/Client)
|
190
|
+
- [Amazon references](https://docs.developer.amazonservices.com/en_US/merch_fulfill/MerchFulfill_Overview.html)
|
191
|
+
- [Peddler API docs](https://www.rubydoc.info/gems/peddler/MWS/MerchantFulfillment/Client)
|
199
192
|
|
200
193
|
### Orders
|
201
194
|
|
202
195
|
With the MWS Orders API, you can list orders created or updated during a time frame you specify or retrieve information about specific orders.
|
203
196
|
|
204
|
-
- [Amazon references](https://developer.amazonservices.com/
|
205
|
-
- [Peddler API docs](
|
197
|
+
- [Amazon references](https://docs.developer.amazonservices.com/en_US/orders-2013-09-01/Orders_Overview.html)
|
198
|
+
- [Peddler API docs](https://www.rubydoc.info/gems/peddler/MWS/Orders/Client)
|
206
199
|
|
207
200
|
### Products
|
208
201
|
|
209
202
|
The MWS Products API helps you get information to match your products to existing product listings on Amazon Marketplace websites and to make sourcing and pricing decisions for listing those products on Amazon Marketplace websites.
|
210
203
|
|
211
|
-
- [Amazon references](https://developer.amazonservices.com/
|
212
|
-
- [Peddler API docs](
|
204
|
+
- [Amazon references](https://docs.developer.amazonservices.com/en_US/products/Products_Overview.html)
|
205
|
+
- [Peddler API docs](https://www.rubydoc.info/gems/peddler/MWS/Products/Client)
|
213
206
|
|
214
207
|
### Recommendations
|
215
208
|
|
216
209
|
The Recommendations API enables you to programmatically retrieve Amazon Selling Coach recommendations by recommendation category. A recommendation is an actionable, timely, and personalized opportunity to increase your sales and performance.
|
217
210
|
|
218
|
-
- [Amazon references](https://developer.amazonservices.com/
|
219
|
-
- [Peddler API docs](
|
211
|
+
- [Amazon references](https://docs.developer.amazonservices.com/en_US/recommendations/Recommendations_Overview.html)
|
212
|
+
- [Peddler API docs](https://www.rubydoc.info/gems/peddler/MWS/Recommendations/Client)
|
220
213
|
|
221
214
|
### Reports
|
222
215
|
|
223
216
|
The Reports API lets you request reports about your inventory and orders.
|
224
217
|
|
225
|
-
- [Amazon references](https://developer.amazonservices.com/
|
226
|
-
- [Peddler API docs](
|
218
|
+
- [Amazon references](https://docs.developer.amazonservices.com/en_US/reports/Reports_Overview.html)
|
219
|
+
- [Peddler API docs](https://www.rubydoc.info/gems/peddler/MWS/Reports/Client)
|
227
220
|
|
228
221
|
### Sellers
|
229
222
|
|
230
223
|
The Sellers API lets sellers retrieve information about their seller account, such as the marketplaces they participate in.
|
231
224
|
|
232
|
-
- [Amazon references](https://developer.amazonservices.com/
|
233
|
-
- [Peddler API docs](
|
225
|
+
- [Amazon references](https://docs.developer.amazonservices.com/en_US/subscriptions/Subscriptions_Overview.html)
|
226
|
+
- [Peddler API docs](https://www.rubydoc.info/gems/peddler/MWS/Sellers/Client)
|
227
|
+
|
228
|
+
### Shipment Invoicing
|
229
|
+
|
230
|
+
With the Shipment Invoicing API section (in conjunction with the FBAOutboundShipmentStatus notification), you can integrate invoicing into Amazon’s shipping process for a seller’s Fulfillment by Amazon (FBA) orders.
|
231
|
+
|
232
|
+
This functionality is available only in the Brazil marketplace.
|
233
|
+
|
234
|
+
- [Amazon references](https://docs.developer.amazonservices.com/en_US/shipment_invoicing/ShipmentInvoicing_Overview.html)
|
235
|
+
- [Peddler API docs](https://www.rubydoc.info/gems/peddler/MWS/ShipmentInvoicing/Client)
|
234
236
|
|
235
237
|
### Subscriptions
|
236
238
|
|
237
239
|
The Amazon MWS Subscriptions API section enables you to subscribe to receive notifications that are relevant to your business with Amazon. With the operations in the Subscriptions API section, you can register to receive important information from Amazon without having to poll the Amazon MWS service. Instead, the information is sent directly to you when an event occurs to which you are subscribed.
|
238
240
|
|
239
|
-
- [Amazon references](https://developer.amazonservices.com/
|
240
|
-
- [Peddler API docs](
|
241
|
+
- [Amazon references](https://docs.developer.amazonservices.com/en_US/subscriptions/Subscriptions_Overview.html)
|
242
|
+
- [Peddler API docs](https://www.rubydoc.info/gems/peddler/MWS/Subscriptions/Client)
|
data/lib/mws.rb
CHANGED
@@ -1,18 +1,19 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'forwardable'
|
4
|
+
require 'mws/easy_ship'
|
4
5
|
require 'mws/feeds'
|
5
6
|
require 'mws/finances'
|
6
7
|
require 'mws/fulfillment_inbound_shipment'
|
7
8
|
require 'mws/fulfillment_inventory'
|
8
9
|
require 'mws/fulfillment_outbound_shipment'
|
9
10
|
require 'mws/merchant_fulfillment'
|
10
|
-
require 'mws/off_amazon_payments'
|
11
11
|
require 'mws/orders'
|
12
12
|
require 'mws/products'
|
13
13
|
require 'mws/recommendations'
|
14
14
|
require 'mws/reports'
|
15
15
|
require 'mws/sellers'
|
16
|
+
require 'mws/shipment_invoicing'
|
16
17
|
require 'mws/subscriptions'
|
17
18
|
|
18
19
|
# The various Amazon MWS API sections.
|
@@ -0,0 +1,93 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'peddler/client'
|
4
|
+
|
5
|
+
module MWS
|
6
|
+
module EasyShip
|
7
|
+
# With the Easy Ship API section, you can build applications that help
|
8
|
+
# sellers in India manage and ship their Amazon Easy Ship orders.
|
9
|
+
#
|
10
|
+
# @note This functionality is available only in the India marketplace.
|
11
|
+
class Client < ::Peddler::Client
|
12
|
+
self.version = '2018-09-01'
|
13
|
+
self.path = "/EasyShip/#{version}"
|
14
|
+
|
15
|
+
# Returns time slots for Amazon Easy Ship package pickup
|
16
|
+
#
|
17
|
+
# @see https://docs.developer.amazonservices.com/en_US/easy_ship/EasyShip_ListPickupSlots.html
|
18
|
+
# @param [String] marketplace_id
|
19
|
+
# @param [String] amazon_order_id
|
20
|
+
# @param [Struct, Hash] package_dimensions
|
21
|
+
# @param [Struct, Hash] package_weight
|
22
|
+
# @return [Peddler::XMLParser]
|
23
|
+
def list_pickup_slots(marketplace_id, amazon_order_id, package_dimensions,
|
24
|
+
package_weight)
|
25
|
+
operation('ListPickupSlots')
|
26
|
+
.add('MarketplaceId' => marketplace_id,
|
27
|
+
'AmazonOrderId' => amazon_order_id,
|
28
|
+
'PackageDimensions' => package_dimensions,
|
29
|
+
'PackageWeight' => package_weight)
|
30
|
+
|
31
|
+
run
|
32
|
+
end
|
33
|
+
|
34
|
+
# Schedules an Amazon Easy Ship pickup slot
|
35
|
+
#
|
36
|
+
# @see https://docs.developer.amazonservices.com/en_US/easy_ship/EasyShip_CreateScheduledPackage.html
|
37
|
+
# @param [String] marketplace_id
|
38
|
+
# @param [String] amazon_order_id
|
39
|
+
# @param [Struct, Hash] package_request_details
|
40
|
+
# @return [Peddler::XMLParser]
|
41
|
+
def create_scheduled_package(marketplace_id, amazon_order_id,
|
42
|
+
package_request_details)
|
43
|
+
operation('CreateScheduledPackage')
|
44
|
+
.add('MarketplaceId' => marketplace_id,
|
45
|
+
'AmazonOrderId' => amazon_order_id,
|
46
|
+
'PackageRequestDetails' => package_request_details)
|
47
|
+
|
48
|
+
run
|
49
|
+
end
|
50
|
+
|
51
|
+
# Updates an Amazon Easy Ship pickup slot
|
52
|
+
#
|
53
|
+
# @see https://docs.developer.amazonservices.com/en_US/easy_ship/EasyShip_UpdateScheduledPackages.html
|
54
|
+
# @param [String] marketplace_id
|
55
|
+
# @param [Array<Struct, Hash>] scheduled_package_update_details_list
|
56
|
+
# @return [Peddler::XMLParser]
|
57
|
+
def update_scheduled_packages(marketplace_id,
|
58
|
+
scheduled_package_update_details_list)
|
59
|
+
operation('UpdateScheduledPackages')
|
60
|
+
.add('MarketplaceId' => marketplace_id,
|
61
|
+
'ScheduledPackageUpdateDetailsList' =>
|
62
|
+
scheduled_package_update_details_list)
|
63
|
+
.structure!('ScheduledPackageUpdateDetailsList',
|
64
|
+
'PackageUpdateDetails')
|
65
|
+
|
66
|
+
run
|
67
|
+
end
|
68
|
+
|
69
|
+
# Returns information about a scheduled package
|
70
|
+
#
|
71
|
+
# @see https://docs.developer.amazonservices.com/en_US/easy_ship/EasyShip_GetScheduledPackage.html
|
72
|
+
# @param [String] marketplace_id
|
73
|
+
# @param [Struct, Hash] scheduled_package_id
|
74
|
+
# @return [Peddler::XMLParser]
|
75
|
+
def get_scheduled_package(marketplace_id, scheduled_package_id)
|
76
|
+
operation('GetScheduledPackage')
|
77
|
+
.add('MarketplaceId' => marketplace_id,
|
78
|
+
'ScheduledPackageId' => scheduled_package_id)
|
79
|
+
|
80
|
+
run
|
81
|
+
end
|
82
|
+
|
83
|
+
# Returns the operational status of the API
|
84
|
+
#
|
85
|
+
# @see https://docs.developer.amazonservices.com/en_US/shipment_invoicing/ShipmentInvoicing_GetServiceStatus.html
|
86
|
+
# @return [Peddler::XMLParser]
|
87
|
+
def get_service_status
|
88
|
+
operation('GetServiceStatus')
|
89
|
+
run
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
@@ -155,8 +155,8 @@ module MWS
|
|
155
155
|
# Work around a bug upstream
|
156
156
|
#
|
157
157
|
# @see https://github.com/hakanensari/peddler/issues/122
|
158
|
-
rescue Peddler::Errors::Error =>
|
159
|
-
raise unless
|
158
|
+
rescue Peddler::Errors::Error => e
|
159
|
+
raise unless e.message.include?("Value null at 'asinList'")
|
160
160
|
|
161
161
|
get_prep_instructions_for_asin_with_bad_params(ship_to_country_code,
|
162
162
|
*asin_list)
|
data/lib/mws/orders/client.rb
CHANGED
@@ -15,7 +15,7 @@ module MWS
|
|
15
15
|
# @note When calling this operation, you must specify a time frame using
|
16
16
|
# either created_after or last_updated_after. When requesting orders by
|
17
17
|
# "Unshipped" status you must also request "PartiallyShipped" orders.
|
18
|
-
# @see https://docs.developer.amazonservices.com/en_US/orders
|
18
|
+
# @see https://docs.developer.amazonservices.com/en_US/orders-2013-09-01/Orders_ListOrders.html
|
19
19
|
# @overload list_orders(*marketplace_id, opts = {})
|
20
20
|
# @param [Array<String>] marketplace_id
|
21
21
|
# @param [Hash] opts
|
@@ -34,9 +34,7 @@ module MWS
|
|
34
34
|
def list_orders(*marketplace_id)
|
35
35
|
marketplace_id = marketplace_id.dup
|
36
36
|
opts = extract_options(marketplace_id)
|
37
|
-
if opts.key?(:tfm_shipment_status)
|
38
|
-
opts['TFMShipmentStatus'] = opts.delete(:tfm_shipment_status)
|
39
|
-
end
|
37
|
+
opts['TFMShipmentStatus'] = opts.delete(:tfm_shipment_status) if opts.key?(:tfm_shipment_status)
|
40
38
|
|
41
39
|
operation('ListOrders')
|
42
40
|
.add(opts)
|
@@ -53,7 +51,7 @@ module MWS
|
|
53
51
|
|
54
52
|
# Lists the next page of orders
|
55
53
|
#
|
56
|
-
# @see https://docs.developer.amazonservices.com/en_US/orders
|
54
|
+
# @see https://docs.developer.amazonservices.com/en_US/orders-2013-09-01/Orders_ListOrdersByNextToken.html
|
57
55
|
# @param [String] next_token
|
58
56
|
# @return [Peddler::XMLParser]
|
59
57
|
def list_orders_by_next_token(next_token)
|
@@ -65,7 +63,7 @@ module MWS
|
|
65
63
|
|
66
64
|
# Gets one or more orders
|
67
65
|
#
|
68
|
-
# @see https://docs.developer.amazonservices.com/en_US/orders
|
66
|
+
# @see https://docs.developer.amazonservices.com/en_US/orders-2013-09-01/Orders_GetOrder.html
|
69
67
|
# @param [Array<String>] amazon_order_ids
|
70
68
|
# @return [Peddler::XMLParser]
|
71
69
|
def get_order(*amazon_order_ids)
|
@@ -78,7 +76,7 @@ module MWS
|
|
78
76
|
|
79
77
|
# Lists order items for an order
|
80
78
|
#
|
81
|
-
# @see https://docs.developer.amazonservices.com/en_US/orders
|
79
|
+
# @see https://docs.developer.amazonservices.com/en_US/orders-2013-09-01/Orders_ListOrderItems.html
|
82
80
|
# @param [String] amazon_order_id
|
83
81
|
# @return [Peddler::XMLParser]
|
84
82
|
def list_order_items(amazon_order_id)
|
@@ -90,7 +88,7 @@ module MWS
|
|
90
88
|
|
91
89
|
# Lists the next page of order items for an order
|
92
90
|
#
|
93
|
-
# @see https://docs.developer.amazonservices.com/en_US/orders
|
91
|
+
# @see https://docs.developer.amazonservices.com/en_US/orders-2013-09-01/Orders_ListOrderItemsByNextToken.html
|
94
92
|
# @param [String] next_token
|
95
93
|
# @return [Peddler::XMLParser]
|
96
94
|
def list_order_items_by_next_token(next_token)
|
@@ -102,7 +100,7 @@ module MWS
|
|
102
100
|
|
103
101
|
# Gets the service status of the API
|
104
102
|
#
|
105
|
-
# @see https://docs.developer.amazonservices.com/en_US/orders
|
103
|
+
# @see https://docs.developer.amazonservices.com/en_US/orders-2013-09-01/MWS_GetServiceStatus.html
|
106
104
|
# @return [Peddler::XMLParser]
|
107
105
|
def get_service_status
|
108
106
|
operation('GetServiceStatus')
|
data/lib/mws/reports/client.rb
CHANGED
@@ -12,6 +12,7 @@ module MWS
|
|
12
12
|
# Creates a report request
|
13
13
|
#
|
14
14
|
# @see https://docs.developer.amazonservices.com/en_US/reports/Reports_RequestReport.html
|
15
|
+
# @see https://docs.developer.amazonservices.com/en_US/reports/Reports_ReportType.html
|
15
16
|
# @param [String] report_type
|
16
17
|
# @param [Hash] opts
|
17
18
|
# @option opts [String, #iso8601] :start_date
|
@@ -31,6 +32,7 @@ module MWS
|
|
31
32
|
# Lists report requests
|
32
33
|
#
|
33
34
|
# @see https://docs.developer.amazonservices.com/en_US/reports/Reports_GetReportRequestList.html
|
35
|
+
# @see https://docs.developer.amazonservices.com/en_US/reports/Reports_ReportType.html
|
34
36
|
# @param [Hash] opts
|
35
37
|
# @option opts [Array<String>, String] :report_request_id_list
|
36
38
|
# @option opts [Array<String>, String] :report_type_list
|
@@ -64,6 +66,7 @@ module MWS
|
|
64
66
|
# Counts requested reports
|
65
67
|
#
|
66
68
|
# @see https://docs.developer.amazonservices.com/en_US/reports/Reports_GetReportRequestCount.html
|
69
|
+
# @see https://docs.developer.amazonservices.com/en_US/reports/Reports_ReportType.html
|
67
70
|
# @param [Hash] opts
|
68
71
|
# @option opts [Array<String>, String] :report_type_list
|
69
72
|
# @option opts [Array<String>, String] :report_processing_status_list
|
@@ -82,6 +85,7 @@ module MWS
|
|
82
85
|
# Cancels one or more report requests
|
83
86
|
#
|
84
87
|
# @see https://docs.developer.amazonservices.com/en_US/reports/Reports_CancelReportRequests.html
|
88
|
+
# @see https://docs.developer.amazonservices.com/en_US/reports/Reports_ReportType.html
|
85
89
|
# @param [Hash] opts
|
86
90
|
# @option opts [Array<String>, String] :report_type_list
|
87
91
|
# @option opts [Array<String>, String] :report_processing_status_list
|
@@ -100,6 +104,7 @@ module MWS
|
|
100
104
|
# Lists reports
|
101
105
|
#
|
102
106
|
# @see https://docs.developer.amazonservices.com/en_US/reports/Reports_GetReportList.html
|
107
|
+
# @see https://docs.developer.amazonservices.com/en_US/reports/Reports_ReportType.html
|
103
108
|
# @param [Hash] opts
|
104
109
|
# @option opts [Integer] :max_count
|
105
110
|
# @option opts [Array<String>, String] :report_type_list
|
@@ -132,6 +137,7 @@ module MWS
|
|
132
137
|
# Counts reports
|
133
138
|
#
|
134
139
|
# @see https://docs.developer.amazonservices.com/en_US/reports/Reports_GetReportCount.html
|
140
|
+
# @see https://docs.developer.amazonservices.com/en_US/reports/Reports_ReportType.html
|
135
141
|
# @param [Hash] opts
|
136
142
|
# @option opts [Array<String>, String] :report_type_list
|
137
143
|
# @option opts [Boolean] :acknowledged
|
@@ -162,6 +168,7 @@ module MWS
|
|
162
168
|
# Creates, updates, or deletes a report request schedule
|
163
169
|
#
|
164
170
|
# @see https://docs.developer.amazonservices.com/en_US/reports/Reports_ManageReportSchedule.html
|
171
|
+
# @see https://docs.developer.amazonservices.com/en_US/reports/Reports_ReportType.html
|
165
172
|
# @param [String] report_type
|
166
173
|
# @param [String] schedule
|
167
174
|
# @param [Hash] opts
|
@@ -178,6 +185,7 @@ module MWS
|
|
178
185
|
# Lists scheduled reports
|
179
186
|
#
|
180
187
|
# @see https://docs.developer.amazonservices.com/en_US/reports/Reports_GetReportScheduleList.html
|
188
|
+
# @see https://docs.developer.amazonservices.com/en_US/reports/Reports_ReportType.html
|
181
189
|
# @param [Array<String>] report_type_list
|
182
190
|
# @return [Peddler::XMLParser]
|
183
191
|
def get_report_schedule_list(*report_type_list)
|
@@ -199,6 +207,7 @@ module MWS
|
|
199
207
|
# Counts scheduled reports
|
200
208
|
#
|
201
209
|
# @see https://docs.developer.amazonservices.com/en_US/reports/Reports_GetReportScheduleCount.html
|
210
|
+
# @see https://docs.developer.amazonservices.com/en_US/reports/Reports_ReportType.html
|
202
211
|
# @param [Array<String>] report_type_list
|
203
212
|
# @return [Peddler::XMLParser]
|
204
213
|
def get_report_schedule_count(*report_type_list)
|