peddler 2.1.1 → 2.4.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (98) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +45 -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/mws/subscriptions/client.rb +2 -2
  11. data/lib/peddler/client.rb +17 -13
  12. data/lib/peddler/errors/builder.rb +7 -2
  13. data/lib/peddler/errors/class_generator.rb +9 -4
  14. data/lib/peddler/errors/error.rb +6 -2
  15. data/lib/peddler/errors/parser.rb +1 -1
  16. data/lib/peddler/flat_file_parser.rb +5 -3
  17. data/lib/peddler/headers.rb +6 -1
  18. data/lib/peddler/marketplace.rb +25 -19
  19. data/lib/peddler/operation.rb +17 -11
  20. data/lib/peddler/parser.rb +1 -1
  21. data/lib/peddler/structured_list.rb +1 -1
  22. data/lib/peddler/vcr_matcher.rb +7 -7
  23. data/lib/peddler/version.rb +1 -1
  24. data/lib/peddler/xml_parser.rb +1 -1
  25. data/lib/peddler/xml_response_parser.rb +3 -2
  26. metadata +15 -152
  27. data/lib/mws/off_amazon_payments/client.rb +0 -362
  28. data/lib/peddler/content.rb +0 -69
  29. data/lib/peddler/mws.rb +0 -58
  30. data/test/credentials.rb +0 -23
  31. data/test/helper.rb +0 -15
  32. data/test/integration/internals/test_errors.rb +0 -17
  33. data/test/integration/internals/test_multibyte_queries.rb +0 -17
  34. data/test/integration/internals/test_mws_headers.rb +0 -21
  35. data/test/integration/internals/test_string_encodings.rb +0 -38
  36. data/test/integration/test_feeds.rb +0 -37
  37. data/test/integration/test_fulfillment_inbound_shipment.rb +0 -35
  38. data/test/integration/test_fulfillment_inventory.rb +0 -20
  39. data/test/integration/test_fulfillment_outbound_shipment.rb +0 -13
  40. data/test/integration/test_merchant_fulfillment.rb +0 -69
  41. data/test/integration/test_off_amazon_payments.rb +0 -13
  42. data/test/integration/test_orders.rb +0 -30
  43. data/test/integration/test_products.rb +0 -97
  44. data/test/integration/test_recommendations.rb +0 -20
  45. data/test/integration/test_reports.rb +0 -51
  46. data/test/integration/test_sellers.rb +0 -13
  47. data/test/integration/test_subscriptions.rb +0 -27
  48. data/test/integration_helper.rb +0 -53
  49. data/test/mws.yml +0 -36
  50. data/test/mws.yml.example +0 -32
  51. data/test/null_client.rb +0 -25
  52. data/test/recorder.rb +0 -39
  53. data/test/unit/mws/test_feeds_client.rb +0 -103
  54. data/test/unit/mws/test_finances_client.rb +0 -74
  55. data/test/unit/mws/test_fulfillment_inbound_shipment_client.rb +0 -426
  56. data/test/unit/mws/test_fulfillment_inventory_client.rb +0 -48
  57. data/test/unit/mws/test_fulfillment_outbound_shipment_client.rb +0 -202
  58. data/test/unit/mws/test_merchant_fulfillment_client.rb +0 -109
  59. data/test/unit/mws/test_off_amazon_payments_client.rb +0 -286
  60. data/test/unit/mws/test_orders_client.rb +0 -111
  61. data/test/unit/mws/test_products_client.rb +0 -248
  62. data/test/unit/mws/test_recommendations_client.rb +0 -62
  63. data/test/unit/mws/test_reports_client.rb +0 -209
  64. data/test/unit/mws/test_sellers_client.rb +0 -47
  65. data/test/unit/mws/test_subscriptions_client.rb +0 -182
  66. data/test/unit/peddler/errors/test_builder.rb +0 -65
  67. data/test/unit/peddler/errors/test_class_generator.rb +0 -18
  68. data/test/unit/peddler/errors/test_error.rb +0 -33
  69. data/test/unit/peddler/errors/test_parser.rb +0 -44
  70. data/test/unit/peddler/test_client.rb +0 -203
  71. data/test/unit/peddler/test_flat_file_parser.rb +0 -111
  72. data/test/unit/peddler/test_headers.rb +0 -103
  73. data/test/unit/peddler/test_marketplace.rb +0 -47
  74. data/test/unit/peddler/test_operation.rb +0 -87
  75. data/test/unit/peddler/test_parser.rb +0 -36
  76. data/test/unit/peddler/test_structured_list.rb +0 -39
  77. data/test/unit/peddler/test_vcr_matcher.rb +0 -55
  78. data/test/unit/peddler/test_xml_parser.rb +0 -37
  79. data/test/unit/peddler/test_xml_response_parser.rb +0 -39
  80. data/test/unit/test_mws.rb +0 -11
  81. data/test/vcr_cassettes/CartInformation.yml +0 -433
  82. data/test/vcr_cassettes/CustomerInformation.yml +0 -433
  83. data/test/vcr_cassettes/Errors.yml +0 -444
  84. data/test/vcr_cassettes/Feeds.yml +0 -9957
  85. data/test/vcr_cassettes/FulfillmentInboundShipment.yml +0 -6166
  86. data/test/vcr_cassettes/FulfillmentInventory.yml +0 -850
  87. data/test/vcr_cassettes/FulfillmentOutboundShipment.yml +0 -433
  88. data/test/vcr_cassettes/MWSHeaders.yml +0 -2964
  89. data/test/vcr_cassettes/MerchantFulfillment.yml +0 -753
  90. data/test/vcr_cassettes/MultibyteQueries.yml +0 -437
  91. data/test/vcr_cassettes/OffAmazonPayments.yml +0 -433
  92. data/test/vcr_cassettes/Orders.yml +0 -4740
  93. data/test/vcr_cassettes/PeddlerVCRMatcher.yml +0 -41
  94. data/test/vcr_cassettes/Products.yml +0 -7139
  95. data/test/vcr_cassettes/Recommendations.yml +0 -3145
  96. data/test/vcr_cassettes/Reports.yml +0 -5549
  97. data/test/vcr_cassettes/Sellers.yml +0 -433
  98. 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: 6c141fcdd828d246b41f5bf226f58774c8ec308a5d07057ba594dc30f0de02d5
4
+ data.tar.gz: 2b1b8f93023b5d239d96204aa205faef1e7a4cd1ce59ea309dde713756060c7c
5
5
  SHA512:
6
- metadata.gz: ed79ae488893ad0fd4e4fceebbbeb28074f1b8825dae4b23827db946e3d332b199ce29212de4d48970d2a54316a7aacf9121e9f58581aa57d3be7e75047dcad2
7
- data.tar.gz: dbcc2289dcc8dafbd1dc157fdcfcdb6e11712c89a7c1f1ba35ddd280a54a33ef8e382cf5926da276286a24eeb5b15b766ff72be81b07d6bc914ab0677b75fbdb
6
+ metadata.gz: 9917964b5dec46e1e96cf057717891e6de96e7a05bf83b8f8cb95956306e0db6ec5e41c1f2aa7026f4eb8357b1d58740cb669499c83fd356be546e8623a5f90d
7
+ data.tar.gz: c300ba54012e53c7bef4fbf6ac1b3ab42548def3e0f5101b39d6394193616e6eb49319932bf938b4fe2caafb7b353c8633d6df4ba3a013333aede70ab3c7b1f0
data/README.md CHANGED
@@ -1,12 +1,14 @@
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
+ > :boom: Amazon is migrating to the newly-launched Selling Partner API (SP-API). There is no date yet for when MWS APIs will be deprecated. I will add support in Peddler in due course.
8
+
7
9
  **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
10
 
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).
11
+ 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
12
 
11
13
  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
14
 
@@ -120,7 +122,7 @@ Read [tips on how to avoid throttling](https://docs.developer.amazonservices.com
120
122
 
121
123
  ### Debugging
122
124
 
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.
125
+ 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
126
 
125
127
  Note that some optional keywords have default values.
126
128
 
@@ -138,34 +140,41 @@ You can access the same attributes on `error.response`. See <a href="#throttling
138
140
 
139
141
  ## The APIs
140
142
 
143
+ ### Easy Ship
144
+
145
+ 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.
146
+
147
+ - [Amazon references](https://docs.developer.amazonservices.com/en_US/easy_ship/EasyShip_Overview.html)
148
+ - [Peddler API docs](https://www.rubydoc.info/gems/peddler/MWS/EasyShip/Client)
149
+
141
150
  ### Feeds
142
151
 
143
152
  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
153
 
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)
154
+ - [Amazon references](https://docs.developer.amazonservices.com/en_US/feeds/Feeds_Overview.html)
155
+ - [Peddler API docs](https://www.rubydoc.info/gems/peddler/MWS/Feeds/Client)
147
156
  - [XML schema docs](https://sellercentral.amazon.com/gp/help/help-page.html?itemID=1611)
148
157
 
149
158
  ### Finances
150
159
 
151
160
  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
161
 
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)
162
+ - [Amazon references](https://docs.developer.amazonservices.com/en_US/finances/Finances_Overview.html)
163
+ - [Peddler API docs](https://www.rubydoc.info/gems/peddler/MWS/Finances/Client)
155
164
 
156
165
  ### Fulfillment Inbound Shipment
157
166
 
158
167
  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
168
 
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)
169
+ - [Amazon references](https://docs.developer.amazonservices.com/en_US/fba_inbound/FBAInbound_Overview.html)
170
+ - [Peddler API docs](https://www.rubydoc.info/gems/peddler/MWS/FulfillmentInboundShipment/Client)
162
171
 
163
172
  ### Fulfillment Inventory
164
173
 
165
174
  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
175
 
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)
176
+ - [Amazon references](https://docs.developer.amazonservices.com/en_US/fba_inventory/FBAInventory_Overview.html)
177
+ - [Peddler API docs](https://www.rubydoc.info/gems/peddler/MWS/FulfillmentInventory/Client)
169
178
 
170
179
  ### Fulfillment Outbound Shipment
171
180
 
@@ -173,68 +182,63 @@ The MWS Fulfillment Outbound Shipment API enables you to fulfill orders placed t
173
182
 
174
183
  Support for creating and cancelling fulfillment orders has been implemented, but the rest of the API is not supported yet.
175
184
 
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)
185
+ - [Amazon references](https://docs.developer.amazonservices.com/en_US/fba_outbound/FBAOutbound_Overview.html)
186
+ - [Peddler API docs](https://www.rubydoc.info/gems/peddler/MWS/FulfillmentOutboundShipment/Client)
178
187
 
179
188
  ### Merchant Fulfillment
180
189
 
181
190
  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
191
 
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)
192
+ - [Amazon references](https://docs.developer.amazonservices.com/en_US/merch_fulfill/MerchFulfill_Overview.html)
193
+ - [Peddler API docs](https://www.rubydoc.info/gems/peddler/MWS/MerchantFulfillment/Client)
199
194
 
200
195
  ### Orders
201
196
 
202
197
  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
198
 
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)
199
+ - [Amazon references](https://docs.developer.amazonservices.com/en_US/orders-2013-09-01/Orders_Overview.html)
200
+ - [Peddler API docs](https://www.rubydoc.info/gems/peddler/MWS/Orders/Client)
206
201
 
207
202
  ### Products
208
203
 
209
204
  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
205
 
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)
206
+ - [Amazon references](https://docs.developer.amazonservices.com/en_US/products/Products_Overview.html)
207
+ - [Peddler API docs](https://www.rubydoc.info/gems/peddler/MWS/Products/Client)
213
208
 
214
209
  ### Recommendations
215
210
 
216
211
  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
212
 
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)
213
+ - [Amazon references](https://docs.developer.amazonservices.com/en_US/recommendations/Recommendations_Overview.html)
214
+ - [Peddler API docs](https://www.rubydoc.info/gems/peddler/MWS/Recommendations/Client)
220
215
 
221
216
  ### Reports
222
217
 
223
218
  The Reports API lets you request reports about your inventory and orders.
224
219
 
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)
220
+ - [Amazon references](https://docs.developer.amazonservices.com/en_US/reports/Reports_Overview.html)
221
+ - [Peddler API docs](https://www.rubydoc.info/gems/peddler/MWS/Reports/Client)
227
222
 
228
223
  ### Sellers
229
224
 
230
225
  The Sellers API lets sellers retrieve information about their seller account, such as the marketplaces they participate in.
231
226
 
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)
227
+ - [Amazon references](https://docs.developer.amazonservices.com/en_US/subscriptions/Subscriptions_Overview.html)
228
+ - [Peddler API docs](https://www.rubydoc.info/gems/peddler/MWS/Sellers/Client)
229
+
230
+ ### Shipment Invoicing
231
+
232
+ 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.
233
+
234
+ This functionality is available only in the Brazil marketplace.
235
+
236
+ - [Amazon references](https://docs.developer.amazonservices.com/en_US/shipment_invoicing/ShipmentInvoicing_Overview.html)
237
+ - [Peddler API docs](https://www.rubydoc.info/gems/peddler/MWS/ShipmentInvoicing/Client)
234
238
 
235
239
  ### Subscriptions
236
240
 
237
241
  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
242
 
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)
243
+ - [Amazon references](https://docs.developer.amazonservices.com/en_US/subscriptions/Subscriptions_Overview.html)
244
+ - [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