peddler 2.1.1 → 2.4.2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of peddler might be problematic. Click here for more details.

Files changed (97) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +43 -41
  3. data/lib/mws.rb +2 -1
  4. data/lib/mws/easy_ship.rb +3 -0
  5. data/lib/mws/easy_ship/client.rb +93 -0
  6. data/lib/mws/fulfillment_outbound_shipment/client.rb +1 -1
  7. data/lib/mws/orders/client.rb +7 -9
  8. data/lib/mws/shipment_invoicing.rb +3 -0
  9. data/lib/mws/shipment_invoicing/client.rb +74 -0
  10. data/lib/peddler/client.rb +16 -13
  11. data/lib/peddler/errors/builder.rb +7 -2
  12. data/lib/peddler/errors/class_generator.rb +7 -2
  13. data/lib/peddler/errors/error.rb +6 -2
  14. data/lib/peddler/errors/parser.rb +1 -1
  15. data/lib/peddler/flat_file_parser.rb +5 -3
  16. data/lib/peddler/headers.rb +6 -1
  17. data/lib/peddler/marketplace.rb +24 -19
  18. data/lib/peddler/operation.rb +17 -11
  19. data/lib/peddler/parser.rb +1 -1
  20. data/lib/peddler/structured_list.rb +1 -1
  21. data/lib/peddler/vcr_matcher.rb +7 -7
  22. data/lib/peddler/version.rb +1 -1
  23. data/lib/peddler/xml_parser.rb +1 -1
  24. data/lib/peddler/xml_response_parser.rb +3 -2
  25. metadata +15 -152
  26. data/lib/mws/off_amazon_payments/client.rb +0 -362
  27. data/lib/peddler/content.rb +0 -69
  28. data/lib/peddler/mws.rb +0 -58
  29. data/test/credentials.rb +0 -23
  30. data/test/helper.rb +0 -15
  31. data/test/integration/internals/test_errors.rb +0 -17
  32. data/test/integration/internals/test_multibyte_queries.rb +0 -17
  33. data/test/integration/internals/test_mws_headers.rb +0 -21
  34. data/test/integration/internals/test_string_encodings.rb +0 -38
  35. data/test/integration/test_feeds.rb +0 -37
  36. data/test/integration/test_fulfillment_inbound_shipment.rb +0 -35
  37. data/test/integration/test_fulfillment_inventory.rb +0 -20
  38. data/test/integration/test_fulfillment_outbound_shipment.rb +0 -13
  39. data/test/integration/test_merchant_fulfillment.rb +0 -69
  40. data/test/integration/test_off_amazon_payments.rb +0 -13
  41. data/test/integration/test_orders.rb +0 -30
  42. data/test/integration/test_products.rb +0 -97
  43. data/test/integration/test_recommendations.rb +0 -20
  44. data/test/integration/test_reports.rb +0 -51
  45. data/test/integration/test_sellers.rb +0 -13
  46. data/test/integration/test_subscriptions.rb +0 -27
  47. data/test/integration_helper.rb +0 -53
  48. data/test/mws.yml +0 -36
  49. data/test/mws.yml.example +0 -32
  50. data/test/null_client.rb +0 -25
  51. data/test/recorder.rb +0 -39
  52. data/test/unit/mws/test_feeds_client.rb +0 -103
  53. data/test/unit/mws/test_finances_client.rb +0 -74
  54. data/test/unit/mws/test_fulfillment_inbound_shipment_client.rb +0 -426
  55. data/test/unit/mws/test_fulfillment_inventory_client.rb +0 -48
  56. data/test/unit/mws/test_fulfillment_outbound_shipment_client.rb +0 -202
  57. data/test/unit/mws/test_merchant_fulfillment_client.rb +0 -109
  58. data/test/unit/mws/test_off_amazon_payments_client.rb +0 -286
  59. data/test/unit/mws/test_orders_client.rb +0 -111
  60. data/test/unit/mws/test_products_client.rb +0 -248
  61. data/test/unit/mws/test_recommendations_client.rb +0 -62
  62. data/test/unit/mws/test_reports_client.rb +0 -209
  63. data/test/unit/mws/test_sellers_client.rb +0 -47
  64. data/test/unit/mws/test_subscriptions_client.rb +0 -182
  65. data/test/unit/peddler/errors/test_builder.rb +0 -65
  66. data/test/unit/peddler/errors/test_class_generator.rb +0 -18
  67. data/test/unit/peddler/errors/test_error.rb +0 -33
  68. data/test/unit/peddler/errors/test_parser.rb +0 -44
  69. data/test/unit/peddler/test_client.rb +0 -203
  70. data/test/unit/peddler/test_flat_file_parser.rb +0 -111
  71. data/test/unit/peddler/test_headers.rb +0 -103
  72. data/test/unit/peddler/test_marketplace.rb +0 -47
  73. data/test/unit/peddler/test_operation.rb +0 -87
  74. data/test/unit/peddler/test_parser.rb +0 -36
  75. data/test/unit/peddler/test_structured_list.rb +0 -39
  76. data/test/unit/peddler/test_vcr_matcher.rb +0 -55
  77. data/test/unit/peddler/test_xml_parser.rb +0 -37
  78. data/test/unit/peddler/test_xml_response_parser.rb +0 -39
  79. data/test/unit/test_mws.rb +0 -11
  80. data/test/vcr_cassettes/CartInformation.yml +0 -433
  81. data/test/vcr_cassettes/CustomerInformation.yml +0 -433
  82. data/test/vcr_cassettes/Errors.yml +0 -444
  83. data/test/vcr_cassettes/Feeds.yml +0 -9957
  84. data/test/vcr_cassettes/FulfillmentInboundShipment.yml +0 -6166
  85. data/test/vcr_cassettes/FulfillmentInventory.yml +0 -850
  86. data/test/vcr_cassettes/FulfillmentOutboundShipment.yml +0 -433
  87. data/test/vcr_cassettes/MWSHeaders.yml +0 -2964
  88. data/test/vcr_cassettes/MerchantFulfillment.yml +0 -753
  89. data/test/vcr_cassettes/MultibyteQueries.yml +0 -437
  90. data/test/vcr_cassettes/OffAmazonPayments.yml +0 -433
  91. data/test/vcr_cassettes/Orders.yml +0 -4740
  92. data/test/vcr_cassettes/PeddlerVCRMatcher.yml +0 -41
  93. data/test/vcr_cassettes/Products.yml +0 -7139
  94. data/test/vcr_cassettes/Recommendations.yml +0 -3145
  95. data/test/vcr_cassettes/Reports.yml +0 -5549
  96. data/test/vcr_cassettes/Sellers.yml +0 -433
  97. data/test/vcr_cassettes/Subscriptions.yml +0 -1529
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5e7134fb2dff4131780197cb98d282b481c650c9042b71c235557db707d02e10
4
- data.tar.gz: 491ddd1e18e480cb2b4250eb1cee4422239cc511ff2c6c1ade32d2ec7717e89e
3
+ metadata.gz: 528062a09e318a0c9e08e86c419e7bcefab7b1877f0030dd89c0e37023932e52
4
+ data.tar.gz: f5967c7ca79aac9eb1c4cf067239b82405de9f8d34f0c8aff3ba7453b30ba598
5
5
  SHA512:
6
- metadata.gz: ed79ae488893ad0fd4e4fceebbbeb28074f1b8825dae4b23827db946e3d332b199ce29212de4d48970d2a54316a7aacf9121e9f58581aa57d3be7e75047dcad2
7
- data.tar.gz: dbcc2289dcc8dafbd1dc157fdcfcdb6e11712c89a7c1f1ba35ddd280a54a33ef8e382cf5926da276286a24eeb5b15b766ff72be81b07d6bc914ab0677b75fbdb
6
+ metadata.gz: 921aa429d2686a6941d287d2d13ee84a3dc10bacfd093faf711da3f326c78224e73507c0c870b807f402afae649d7b7f988157e72c642d856b3bb91eba140ae8
7
+ data.tar.gz: b2b6daa1c6a1b830f8a349f97afca979dd0fec97ec487c35ed68dd0304cfb073ec71c3ebd89c22348deedb19012b4a1c8c81f6d7adab18cb0a1870eaf0769999
data/README.md CHANGED
@@ -1,12 +1,12 @@
1
1
  # Peddler
2
2
 
3
- [![Build Status](https://travis-ci.org/hakanensari/peddler.svg)](https://travis-ci.org/hakanensari/peddler)
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 an [application developer](https://docs.developer.amazonservices.com/en_US/dev_guide/DG_Registering.html#DG_Registering__RegisteringAsADeveloper).
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](http://www.rubydoc.info/github/hakanensari/peddler) also links individual operations to their corresponding entries in the Amazon docs.
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/gp/mws/api.html?group=bde&section=feeds)
146
- - [Peddler API docs](http://www.rubydoc.info/gems/peddler/MWS/Feeds/Client)
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/gp/mws/api.html?group=finances&section=finances)
154
- - [Peddler API docs](http://www.rubydoc.info/gems/peddler/MWS/Finances/Client)
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/gp/mws/api.html?group=fulfillment&section=inbound)
161
- - [Peddler API docs](http://www.rubydoc.info/gems/peddler/MWS/FulfillmentInboundShipment/Client)
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/gp/mws/api.html?group=fulfillment&section=inventory)
168
- - [Peddler API docs](http://www.rubydoc.info/gems/peddler/MWS/FulfillmentInventory/Client)
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/gp/mws/api.html?group=fulfillment&section=outbound)
177
- - [Peddler API docs](http://www.rubydoc.info/gems/peddler/MWS/FulfillmentOutboundShipment/Client)
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/gp/mws/api.html?group=merchantfulfillment&section=merchantfulfillment)
184
- - [Peddler API docs](http://www.rubydoc.info/gems/peddler/MWS/MerchantFulfillment/Client)
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&section=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/gp/mws/api.html?group=orders&section=orders)
205
- - [Peddler API docs](http://www.rubydoc.info/gems/peddler/MWS/Orders/Client)
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/gp/mws/api.html?group=products&section=products)
212
- - [Peddler API docs](http://www.rubydoc.info/gems/peddler/MWS/Products/Client)
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/gp/mws/api.html?group=recommendations&section=recommendations)
219
- - [Peddler API docs](http://www.rubydoc.info/gems/peddler/MWS/Recommendations/Client)
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/gp/mws/api.html?group=bde&section=reports)
226
- - [Peddler API docs](http://www.rubydoc.info/gems/peddler/MWS/Reports/Client)
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/gp/mws/api.html?group=sellers&section=sellers)
233
- - [Peddler API docs](http://www.rubydoc.info/gems/peddler/MWS/Sellers/Client)
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/gp/mws/api.html?group=subscriptions&section=subscriptions)
240
- - [Peddler API docs](http://www.rubydoc.info/gems/peddler/MWS/Subscriptions/Client)
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,3 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'mws/easy_ship/client'
@@ -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
@@ -32,7 +32,7 @@ module MWS
32
32
  .add(opts)
33
33
  .add('Address' => address, 'Items' => items)
34
34
  .structure!('Items', 'member')
35
- .structure!('ShippingSpeedCategories')
35
+ .structure!('ShippingSpeedCategories', 'member')
36
36
 
37
37
  run
38
38
  end
@@ -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/2013-09-01/Orders_ListOrders.html
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/2013-09-01/Orders_ListOrdersByNextToken.html
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/2013-09-01/Orders_GetOrder.html
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/2013-09-01/Orders_ListOrderItems.html
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/2013-09-01/Orders_ListOrderItemsByNextToken.html
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/2013-09-01/MWS_GetServiceStatus.html
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')
@@ -0,0 +1,3 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'mws/shipment_invoicing/client'
@@ -0,0 +1,74 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'peddler/client'
4
+
5
+ module MWS
6
+ module ShipmentInvoicing
7
+ # With the Shipment Invoicing API section, you can integrate invoicing into
8
+ # Amazon's shipping process for a seller's FBA order.
9
+ #
10
+ # @note This functionality is available only in the Brazil marketplace.
11
+ class Client < ::Peddler::Client
12
+ self.version = '2018-09-01'
13
+ self.path = "/ShipmentInvoicing/#{version}"
14
+
15
+ # Returns the information required to generate an invoice for the shipment
16
+ # of a Fulfillment by Amazon order
17
+ #
18
+ # @see https://docs.developer.amazonservices.com/en_US/shipment_invoicing/ShipmentInvoicing_GetFBAOutboundShipmentDetail.html
19
+ # @param [String] marketplace_id
20
+ # @param [String] amazon_shipment_id
21
+ # @return [Peddler::XMLParser]
22
+ def get_fba_outbound_shipment_detail(marketplace_id, amazon_shipment_id)
23
+ operation('GetFBAOutboundShipmentDetail')
24
+ .add('MarketplaceId' => marketplace_id,
25
+ 'AmazonShipmentId' => amazon_shipment_id)
26
+
27
+ run
28
+ end
29
+
30
+ # Submits shipment invoice data for a given shipment
31
+ #
32
+ # @see https://docs.developer.amazonservices.com/en_US/shipment_invoicing/ShipmentInvoicing_SubmitFBAOutboundShipmentInvoice.html
33
+ # @param [String] marketplace_id
34
+ # @param [String] amazon_shipment_id
35
+ # @param [String] invoice_content
36
+ # @return [Peddler::XMLParser]
37
+ def submit_fba_outbound_shipment_invoice(marketplace_id,
38
+ amazon_shipment_id,
39
+ invoice_content)
40
+ self.body = invoice_content
41
+
42
+ operation('SubmitFBAOutboundShipmentInvoice')
43
+ .add('MarketplaceId' => marketplace_id,
44
+ 'AmazonShipmentId' => amazon_shipment_id)
45
+
46
+ run
47
+ end
48
+
49
+ # Gets the invoice processing status for the shipments that you specify
50
+ #
51
+ # @see https://docs.developer.amazonservices.com/en_US/shipment_invoicing/ShipmentInvoicing_GetFBAOutboundShipmentInvoiceStatus.html
52
+ # @param [String] marketplace_id
53
+ # @param [String] amazon_shipment_id
54
+ # @return [Peddler::XMLParser]
55
+ def get_fba_outbound_shipment_invoice_status(marketplace_id,
56
+ amazon_shipment_id)
57
+ operation('GetFBAOutboundShipmentInvoiceStatus')
58
+ .add('MarketplaceId' => marketplace_id,
59
+ 'AmazonShipmentId' => amazon_shipment_id)
60
+
61
+ run
62
+ end
63
+
64
+ # Gets the operational status of the API
65
+ #
66
+ # @see https://docs.developer.amazonservices.com/en_US/shipment_invoicing/ShipmentInvoicing_GetServiceStatus.html
67
+ # @return [Peddler::XMLParser]
68
+ def get_service_status
69
+ operation('GetServiceStatus')
70
+ run
71
+ end
72
+ end
73
+ end
74
+ end