peddler 1.2.0 → 1.3.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 +50 -28
- data/lib/mws.rb +2 -0
- data/lib/mws/cart_information/client.rb +7 -6
- data/lib/mws/customer_information/client.rb +6 -6
- data/lib/mws/feeds/client.rb +8 -8
- data/lib/mws/finances/client.rb +6 -6
- data/lib/mws/fulfillment_inbound_shipment/client.rb +41 -40
- data/lib/mws/fulfillment_inventory/client.rb +3 -3
- data/lib/mws/fulfillment_outbound_shipment/client.rb +18 -18
- data/lib/mws/merchant_fulfillment.rb +1 -0
- data/lib/mws/merchant_fulfillment/client.rb +88 -0
- data/lib/mws/off_amazon_payments/client.rb +203 -202
- data/lib/mws/orders/client.rb +6 -6
- data/lib/mws/products/client.rb +38 -38
- data/lib/mws/recommendations/client.rb +4 -4
- data/lib/mws/reports/client.rb +19 -17
- data/lib/mws/sellers/client.rb +2 -2
- data/lib/mws/subscriptions/client.rb +22 -22
- data/lib/mws/webstore/client.rb +8 -8
- data/lib/peddler/client.rb +7 -7
- data/lib/peddler/flat_file_parser.rb +1 -1
- data/lib/peddler/marketplace.rb +2 -2
- data/lib/peddler/operation.rb +7 -12
- data/lib/peddler/vcr_matcher.rb +5 -3
- data/lib/peddler/version.rb +2 -1
- data/test/helper.rb +11 -2
- data/test/integration/test_fulfillment_inbound_shipment.rb +1 -1
- data/test/integration/test_merchant_fulfillment.rb +11 -0
- data/test/integration/test_orders.rb +20 -0
- data/test/unit/mws/test_merchant_fulfillment_client.rb +83 -0
- data/test/unit/peddler/test_client.rb +12 -10
- data/test/unit/peddler/test_vcr_matcher.rb +3 -3
- data/test/vcr_cassettes/MerchantFulfillment.yml +195 -0
- data/test/vcr_cassettes/Orders.yml +1902 -5
- metadata +10 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b95e55aea4d9f7f44675d59cbbec0dfc2dc72155
|
4
|
+
data.tar.gz: 75074f1a3a288aefe5cb452dfa8b20fe521bc28f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ebdd605e71a49b34b84a3825da5cd01814ca37c8ad2eea6ad2743da14396eea4824caa0a8c968ae83d2153138acd2a75853be7f0251e73f0a13bf7f3551a8dee
|
7
|
+
data.tar.gz: 7813fd21aa2039e3bd9692eac635dab4b8c73965f22df28d0cd57b822177feb20f6b8792dc4cfd97d3b5bcda6a871452c2bd04ddd736e7f1f0dae9e6a658a5fe
|
data/README.md
CHANGED
@@ -32,10 +32,10 @@ client = MWS.orders
|
|
32
32
|
Each client requires valid MWS credentials. You can set these globally in the shell.
|
33
33
|
|
34
34
|
```bash
|
35
|
-
export MWS_MARKETPLACE_ID=
|
36
|
-
export MWS_MERCHANT_ID=
|
37
|
-
export AWS_ACCESS_KEY_ID=
|
38
|
-
export AWS_SECRET_ACCESS_KEY=
|
35
|
+
export MWS_MARKETPLACE_ID=YOUR_MARKETPLACE_ID
|
36
|
+
export MWS_MERCHANT_ID=YOUR_MERCHANT_OR_SELLER_ID
|
37
|
+
export AWS_ACCESS_KEY_ID=YOUR_AWS_ACCESS_KEY_ID
|
38
|
+
export AWS_SECRET_ACCESS_KEY=YOUR_AWS_SECRET_ACCESS_KEY
|
39
39
|
```
|
40
40
|
|
41
41
|
You can now instantiate a client.
|
@@ -44,23 +44,29 @@ You can now instantiate a client.
|
|
44
44
|
client = MWS.orders
|
45
45
|
```
|
46
46
|
|
47
|
-
Alternatively, you can set some or all credentials when or after creating the client.
|
47
|
+
Alternatively, if you do not rely on environment variables, you can set some or all credentials when or after creating the client.
|
48
48
|
|
49
49
|
```ruby
|
50
50
|
client = MWS.orders(
|
51
|
-
primary_marketplace_id: "
|
52
|
-
merchant_id: "
|
53
|
-
aws_access_key_id: "
|
54
|
-
aws_secret_access_key: "
|
51
|
+
primary_marketplace_id: "Your Marketplace ID",
|
52
|
+
merchant_id: "Your Merchant or Seller ID",
|
53
|
+
aws_access_key_id: "Your AWS Access Key ID",
|
54
|
+
aws_secret_access_key: "Your AWS Secret Access Key",
|
55
55
|
)
|
56
|
-
|
56
|
+
|
57
|
+
client.primary_marketplace_id = "Another Marketplace ID"
|
57
58
|
```
|
58
59
|
|
59
|
-
If you are creating a client for another seller, pass the latter's `MWSAuthToken`
|
60
|
+
If you are creating a [client for another seller](https://developer.amazonservices.com/gp/mws/faq.html#developForSeller), pass the latter's Merchant (Seller) ID and Marketplace ID along with the `MWSAuthToken` they obtained for you.
|
60
61
|
|
61
62
|
```ruby
|
62
|
-
client = MWS.orders
|
63
|
-
|
63
|
+
client = MWS.orders(
|
64
|
+
primary_marketplace_id: "Seller's Marketplace ID",
|
65
|
+
merchant_id: "Seller's Merchant or Seller ID",
|
66
|
+
aws_access_key_id: "Your AWS Access Key ID",
|
67
|
+
aws_secret_access_key: "Your AWS Secret Access Key",
|
68
|
+
auth_token: "Seller's MWS Authorisation Token"
|
69
|
+
)
|
64
70
|
```
|
65
71
|
|
66
72
|
Once you have a client with valid credentials, you should be able to make requests to the API. Clients map operation names in a flat structure. Methods have positional arguments for required input and keyword arguments for optional parameters. Both method and argument names are underscored but otherwise identical to the names of the corresponding operations and parameters documented in the API.
|
@@ -107,37 +113,43 @@ end
|
|
107
113
|
|
108
114
|
With the MWS Cart Information API, you can retrieve shopping carts that your Amazon Webstore customers have created. The Cart Information API enables you to programmatically integrate Amazon Webstore cart information with your CRM systems, marketing applications, and other systems that require cart data.
|
109
115
|
|
110
|
-
[
|
116
|
+
- [Amazon references](https://developer.amazonservices.com/gp/mws/api.html?group=cartinformation§ion=cartinformation)
|
117
|
+
- [Peddler API docs](http://www.rubydoc.info/gems/peddler/MWS/CartInformation/Client)
|
111
118
|
|
112
119
|
### Customer Information
|
113
120
|
|
114
121
|
With the MWS Customer Information API, you can retrieve information from the customer accounts of your Amazon Webstore customers. This customer information includes customer name, contact information, customer account type, and associated Amazon Webstore marketplaces. The Customer Information API enables you to programmatically integrate Amazon Webstore customer account information with your CRM systems, marketing applications, and other systems that require customer data.
|
115
122
|
|
116
|
-
[
|
123
|
+
- [Amazon references](https://developer.amazonservices.com/gp/mws/api.html?group=customerinformation§ion=customerinformation)
|
124
|
+
- [Peddler API docs](http://www.rubydoc.info/gems/peddler/MWS/CustomerInformation/Client)
|
117
125
|
|
118
126
|
### Feeds
|
119
127
|
|
120
128
|
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.
|
121
129
|
|
122
|
-
[
|
130
|
+
- [Amazon references](https://developer.amazonservices.com/gp/mws/api.html?group=bde§ion=feeds)
|
131
|
+
- [Peddler API docs](http://www.rubydoc.info/gems/peddler/MWS/Feeds/Client)
|
123
132
|
|
124
133
|
### Finances
|
125
134
|
|
126
135
|
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.
|
127
136
|
|
128
|
-
[
|
137
|
+
- [Amazon references](https://developer.amazonservices.com/gp/mws/api.html?group=finances§ion=finances)
|
138
|
+
- [Peddler API docs](http://www.rubydoc.info/gems/peddler/MWS/Finances/Client)
|
129
139
|
|
130
140
|
### Fulfillment Inbound Shipment
|
131
141
|
|
132
142
|
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.
|
133
143
|
|
134
|
-
[
|
144
|
+
- [Amazon references](https://developer.amazonservices.com/gp/mws/api.html?group=fulfillment§ion=inbound)
|
145
|
+
- [Peddler API docs](http://www.rubydoc.info/gems/peddler/MWS/FulfillmentInboundShipment/Client)
|
135
146
|
|
136
147
|
### Fulfillment Inventory
|
137
148
|
|
138
149
|
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.
|
139
150
|
|
140
|
-
[
|
151
|
+
- [Amazon references](https://developer.amazonservices.com/gp/mws/api.html?group=fulfillment§ion=inventory)
|
152
|
+
- [Peddler API docs](http://www.rubydoc.info/gems/peddler/MWS/FulfillmentInventory/Client)
|
141
153
|
|
142
154
|
### Fulfillment Outbound Shipment
|
143
155
|
|
@@ -145,7 +157,8 @@ The MWS Fulfillment Outbound Shipment API enables you to fulfill orders placed t
|
|
145
157
|
|
146
158
|
Support for creating and cancelling fulfillment orders has been implemented, but the rest of the API is not supported yet.
|
147
159
|
|
148
|
-
[
|
160
|
+
- [Amazon references](https://developer.amazonservices.com/gp/mws/api.html?group=fulfillment§ion=outbound)
|
161
|
+
- [Peddler API docs](http://www.rubydoc.info/gems/peddler/MWS/FulfillmentOutboundShipment/Client)
|
149
162
|
|
150
163
|
### Off Amazon Payments
|
151
164
|
|
@@ -157,46 +170,55 @@ You can switch the client to the sandbox environment:
|
|
157
170
|
client = MWS.off_amazon_payments.sandbox
|
158
171
|
```
|
159
172
|
|
160
|
-
[
|
173
|
+
- [Amazon references](https://developer.amazonservices.com/gp/mws/api.html?group=offamazonpayments§ion=offamazonpayments)
|
174
|
+
- [Official Ruby client](https://github.com/amzn/login-and-pay-with-amazon-sdk-ruby)
|
175
|
+
- [Peddler API docs](http://www.rubydoc.info/gems/peddler/MWS/OffAmazonPayments/Client)
|
161
176
|
|
162
177
|
### Orders
|
163
178
|
|
164
179
|
With the MWS Orders API, you can list orders created or updated during a time frame you specify or retrieve information about specific orders.
|
165
180
|
|
166
|
-
[
|
181
|
+
- [Amazon references](https://developer.amazonservices.com/gp/mws/api.html?group=orders§ion=orders)
|
182
|
+
- [Peddler API docs](http://www.rubydoc.info/gems/peddler/MWS/Orders/Client)
|
167
183
|
|
168
184
|
### Products
|
169
185
|
|
170
186
|
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.
|
171
187
|
|
172
|
-
[
|
188
|
+
- [Amazon references](https://developer.amazonservices.com/gp/mws/api.html?group=products§ion=products)
|
189
|
+
- [Peddler API docs](http://www.rubydoc.info/gems/peddler/MWS/Products/Client)
|
173
190
|
|
174
191
|
### Recommendations
|
175
192
|
|
176
193
|
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.
|
177
194
|
|
178
|
-
[
|
195
|
+
- [Amazon references](https://developer.amazonservices.com/gp/mws/api.html?group=recommendations§ion=recommendations)
|
196
|
+
- [Peddler API docs](http://www.rubydoc.info/gems/peddler/MWS/Recommendations/Client)
|
179
197
|
|
180
198
|
### Reports
|
181
199
|
|
182
200
|
The Reports API lets you request reports about your inventory and orders.
|
183
201
|
|
184
|
-
[
|
202
|
+
- [Amazon references](https://developer.amazonservices.com/gp/mws/api.html?group=bde§ion=reports)
|
203
|
+
- [Peddler API docs](http://www.rubydoc.info/gems/peddler/MWS/Reports/Client)
|
185
204
|
|
186
205
|
### Sellers
|
187
206
|
|
188
207
|
The Sellers API lets sellers retrieve information about their seller account, such as the marketplaces they participate in.
|
189
208
|
|
190
|
-
[
|
209
|
+
- [Amazon references](https://developer.amazonservices.com/gp/mws/api.html?group=sellers§ion=sellers)
|
210
|
+
- [Peddler API docs](http://www.rubydoc.info/gems/peddler/MWS/Sellers/Client)
|
191
211
|
|
192
212
|
### Subscriptions
|
193
213
|
|
194
214
|
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.
|
195
215
|
|
196
|
-
[
|
216
|
+
- [Amazon references](https://developer.amazonservices.com/gp/mws/api.html?group=subscriptions§ion=subscriptions)
|
217
|
+
- [Peddler API docs](http://www.rubydoc.info/gems/peddler/MWS/Subscriptions/Client)
|
197
218
|
|
198
219
|
### Webstore
|
199
220
|
|
200
221
|
With the Webstore API section of Amazon Marketplace Web Service (Amazon MWS), you can get “Email Me When Available” subscription information for items listed on your Amazon Webstore. The Webstore API section can help you plan your inventory replenishment cycle by enabling you to query for items that your customers subscribed to when they clicked the Email Me When Available button on your Webstore. The Webstore API section can also return information about the notifications that were sent to your customers when out-of-stock items came back in stock. This information, when combined with sales information that your Webstore tracks, can help you determine how many notifications were converted into sales.
|
201
222
|
|
202
|
-
[
|
223
|
+
- [Amazon references](https://developer.amazonservices.com/gp/mws/api.html?group=webstore§ion=webstore)
|
224
|
+
- [Peddler API docs](http://www.rubydoc.info/gems/peddler/MWS/Webstore/Client)
|
data/lib/mws.rb
CHANGED
@@ -6,6 +6,7 @@ require 'mws/finances'
|
|
6
6
|
require 'mws/fulfillment_inbound_shipment'
|
7
7
|
require 'mws/fulfillment_inventory'
|
8
8
|
require 'mws/fulfillment_outbound_shipment'
|
9
|
+
require 'mws/merchant_fulfillment'
|
9
10
|
require 'mws/off_amazon_payments'
|
10
11
|
require 'mws/orders'
|
11
12
|
require 'mws/products'
|
@@ -15,6 +16,7 @@ require 'mws/sellers'
|
|
15
16
|
require 'mws/subscriptions'
|
16
17
|
require 'mws/webstore'
|
17
18
|
|
19
|
+
# The various Amazon MWS API sections.
|
18
20
|
module MWS
|
19
21
|
class << self
|
20
22
|
extend Forwardable
|
@@ -16,14 +16,14 @@ module MWS
|
|
16
16
|
# @note In addition to registering for Amazon MWS, you must also request
|
17
17
|
# authorization to use the Cart Information API section.
|
18
18
|
class Client < ::Peddler::Client
|
19
|
-
version
|
19
|
+
version '2014-03-01'
|
20
20
|
path "/CartInformation/#{version}"
|
21
21
|
|
22
22
|
# Lists shopping carts
|
23
23
|
#
|
24
24
|
# @see http://docs.developer.amazonservices.com/en_US/cart_info/CartInfo_ListCarts.html
|
25
|
-
# @param
|
26
|
-
# @param
|
25
|
+
# @param [String, #iso8601] date_range_start
|
26
|
+
# @param [Hash] opts
|
27
27
|
# @option opts [String] :marketplace_id
|
28
28
|
# @option opts [String, #iso8601] :date_range_end
|
29
29
|
# @return [Peddler::XMLParser]
|
@@ -37,7 +37,7 @@ module MWS
|
|
37
37
|
# Lists the next page of shopping carts
|
38
38
|
#
|
39
39
|
# @see http://docs.developer.amazonservices.com/en_US/cart_info/CartInfo_ListCartsByNextToken.html
|
40
|
-
# @param
|
40
|
+
# @param [String] next_token
|
41
41
|
# @return [Peddler::XMLParser]
|
42
42
|
def list_carts_by_next_token(next_token)
|
43
43
|
operation('ListCartsByNextToken')
|
@@ -49,8 +49,9 @@ module MWS
|
|
49
49
|
# Returns shopping carts based on specified values
|
50
50
|
#
|
51
51
|
# @see http://docs.developer.amazonservices.com/en_US/cart_info/CartInfo_GetCarts.html
|
52
|
-
# @
|
53
|
-
#
|
52
|
+
# @overload get_carts(marketplace_id, *cart_ids)
|
53
|
+
# @param [String] marketplace_id
|
54
|
+
# @param [String] cart_id one or more cart_ids
|
54
55
|
# @return [Peddler::XMLParser]
|
55
56
|
def get_carts(marketplace_id, *cart_id_list)
|
56
57
|
operation('GetCarts')
|
@@ -18,13 +18,13 @@ module MWS
|
|
18
18
|
# @note In addition to registering for Amazon MWS, you must request
|
19
19
|
# authorization to use the Customer Information API.
|
20
20
|
class Client < ::Peddler::Client
|
21
|
-
version
|
21
|
+
version '2014-03-01'
|
22
22
|
path "/CustomerInformation/#{version}"
|
23
23
|
|
24
24
|
# Lists customer accounts based on search criteria that you specify
|
25
25
|
#
|
26
26
|
# @see http://docs.developer.amazonservices.com/en_US/customer_info/CustomerInfo_ListCustomers.html
|
27
|
-
# @param
|
27
|
+
# @param [Hash] opts
|
28
28
|
# @option opts [String] :marketplace_id
|
29
29
|
# @option opts [String, #iso8601] :date_range_start
|
30
30
|
# @option opts [String, #iso8601] :date_range_end
|
@@ -40,7 +40,7 @@ module MWS
|
|
40
40
|
# Lists the next page of customer accounts
|
41
41
|
#
|
42
42
|
# @see http://docs.developer.amazonservices.com/en_US/customer_info/CustomerInfo_ListCustomersByNextToken.html
|
43
|
-
# @param
|
43
|
+
# @param [String] next_token
|
44
44
|
# @return [Peddler::XMLParser]
|
45
45
|
def list_customers_by_next_token(next_token)
|
46
46
|
operation('ListCustomersByNextToken')
|
@@ -53,9 +53,9 @@ module MWS
|
|
53
53
|
# specify
|
54
54
|
#
|
55
55
|
# @see http://docs.developer.amazonservices.com/en_US/customer_info/CustomerInfo_GetCustomersForCustomerId.html
|
56
|
-
# @overload get_customers_for_customer_id(*
|
57
|
-
# @param
|
58
|
-
# @param
|
56
|
+
# @overload get_customers_for_customer_id(*customer_ids, opts = {})
|
57
|
+
# @param [String] customer_id one or more customer_ids
|
58
|
+
# @param [Hash] opts
|
59
59
|
# @option opts [String] :marketplace_id
|
60
60
|
# @return [Peddler::XMLParser]
|
61
61
|
def get_customers_for_customer_id(*customer_id_list)
|
data/lib/mws/feeds/client.rb
CHANGED
@@ -12,9 +12,9 @@ module MWS
|
|
12
12
|
# @note Feed size is limited to 2,147,483,647 bytes (2^31 -1) per feed.
|
13
13
|
# @see http://docs.developer.amazonservices.com/en_US/feeds/Feeds_SubmitFeed.html
|
14
14
|
# @see http://docs.developer.amazonservices.com/en_US/feeds/Feeds_FeedType.html
|
15
|
-
# @param
|
16
|
-
# @param
|
17
|
-
# @param
|
15
|
+
# @param [String] feed_content an XML or flat file feed
|
16
|
+
# @param [String] feed_type the feed type
|
17
|
+
# @param [Hash] opts
|
18
18
|
# @option opts [Array<String>, String] :marketplace_id_list
|
19
19
|
# @option opts [Boolean] :purge_and_replace
|
20
20
|
# @return [Peddler::XMLParser]
|
@@ -31,7 +31,7 @@ module MWS
|
|
31
31
|
#
|
32
32
|
# @see http://docs.developer.amazonservices.com/en_US/feeds/Feeds_GetFeedSubmissionList.html
|
33
33
|
# @see http://docs.developer.amazonservices.com/en_US/feeds/Feeds_FeedType.html
|
34
|
-
# @param
|
34
|
+
# @param [Hash] opts
|
35
35
|
# @option opts [Array<String>, String] :feed_submission_id_list
|
36
36
|
# @option opts [Integer] :max_count
|
37
37
|
# @option opts [Array<String>, String] :feed_type_list
|
@@ -52,7 +52,7 @@ module MWS
|
|
52
52
|
# Lists the next page of feed submissions
|
53
53
|
#
|
54
54
|
# @see http://docs.developer.amazonservices.com/en_US/feeds/Feeds_GetFeedSubmissionListByNextToken.html
|
55
|
-
# @param
|
55
|
+
# @param [String] next_token
|
56
56
|
# @return [Peddler::XMLParser]
|
57
57
|
def get_feed_submission_list_by_next_token(next_token)
|
58
58
|
operation('GetFeedSubmissionListByNextToken')
|
@@ -65,7 +65,7 @@ module MWS
|
|
65
65
|
#
|
66
66
|
# @see http://docs.developer.amazonservices.com/en_US/feeds/Feeds_GetFeedSubmissionCount.html
|
67
67
|
# @see http://docs.developer.amazonservices.com/en_US/feeds/Feeds_FeedType.html
|
68
|
-
# @param
|
68
|
+
# @param [Hash] opts
|
69
69
|
# @option opts [Array<String>, String] :feed_type_list
|
70
70
|
# @option opts [Array<String>, String] :feed_processing_status_list
|
71
71
|
# @option opts [String, #iso8601] :submitted_from_date
|
@@ -84,7 +84,7 @@ module MWS
|
|
84
84
|
#
|
85
85
|
# @see http://docs.developer.amazonservices.com/en_US/feeds/Feeds_CancelFeedSubmissions.html
|
86
86
|
# @see http://docs.developer.amazonservices.com/en_US/feeds/Feeds_FeedType.html
|
87
|
-
# @param
|
87
|
+
# @param [Hash] opts
|
88
88
|
# @option opts [Array<String>, String] :feed_submission_id_list
|
89
89
|
# @option opts [Array<String>, String] :feed_type_list
|
90
90
|
# @option opts [String, #iso8601] :submitted_from_date
|
@@ -102,7 +102,7 @@ module MWS
|
|
102
102
|
# Gets the processing report for a feed and its Content-MD5 header
|
103
103
|
#
|
104
104
|
# @see http://docs.developer.amazonservices.com/en_US/feeds/Feeds_GetFeedSubmissionResult.html
|
105
|
-
# @param
|
105
|
+
# @param [Integer, String] feed_submission_id
|
106
106
|
# @return [Peddler::XMLParser] if the report is in XML format
|
107
107
|
# @return [Peddler::CSVParser] if the report is a flat file
|
108
108
|
def get_feed_submission_result(feed_submission_id)
|
data/lib/mws/finances/client.rb
CHANGED
@@ -5,13 +5,13 @@ module MWS
|
|
5
5
|
# With the MWS Finances API you can retrieve financial transactions for your
|
6
6
|
# seller account.
|
7
7
|
class Client < ::Peddler::Client
|
8
|
-
version
|
8
|
+
version '2015-05-01'
|
9
9
|
path "/Finances/#{version}"
|
10
10
|
|
11
11
|
# Lists financial events
|
12
12
|
#
|
13
13
|
# @see http://docs.developer.amazonservices.com/en_US/finances/Finances_ListFinancialEvents.html
|
14
|
-
# @param
|
14
|
+
# @param [Hash] opts
|
15
15
|
# @option opts [Integer] :max_results_per_page
|
16
16
|
# @option opts [String] :amazon_order_id
|
17
17
|
# @option opts [String] :financial_event_group_id
|
@@ -26,7 +26,7 @@ module MWS
|
|
26
26
|
# Lists the next page of financial events
|
27
27
|
#
|
28
28
|
# @see http://docs.developer.amazonservices.com/en_US/finances/Finances_ListFinancialEventGroupsByNextToken.html
|
29
|
-
# @param
|
29
|
+
# @param [String] next_token
|
30
30
|
# @return [Peddler::XMLParser]
|
31
31
|
def list_financial_events_by_next_token(next_token)
|
32
32
|
operation('ListFinancialEventsByNextToken')
|
@@ -38,8 +38,8 @@ module MWS
|
|
38
38
|
# Lists financial event groups
|
39
39
|
#
|
40
40
|
# @see http://docs.developer.amazonservices.com/en_US/finances/Finances_ListFinancialEventGroups.html
|
41
|
-
# @param
|
42
|
-
# @param
|
41
|
+
# @param [String, #iso8601] financial_event_group_started_after
|
42
|
+
# @param [Hash] opts
|
43
43
|
# @option opts [Integer] :max_results_per_page
|
44
44
|
# @option opts [String, #iso8601] :financial_event_group_started_before
|
45
45
|
# @return [Peddler::XMLParser]
|
@@ -54,7 +54,7 @@ module MWS
|
|
54
54
|
# Lists the next page of financial event groups
|
55
55
|
#
|
56
56
|
# @see http://docs.developer.amazonservices.com/en_US/finances/Finances_ListFinancialEventGroupsByNextToken.html
|
57
|
-
# @param
|
57
|
+
# @param [String] next_token
|
58
58
|
# @return [Peddler::XMLParser]
|
59
59
|
def list_financial_event_groups_by_next_token(next_token)
|
60
60
|
operation('ListFinancialEventGroupsByNextToken')
|
@@ -7,15 +7,15 @@ module MWS
|
|
7
7
|
# also request lists of inbound shipments or inbound shipment items based on
|
8
8
|
# criteria that you specify.
|
9
9
|
class Client < ::Peddler::Client
|
10
|
-
version
|
10
|
+
version '2010-10-01'
|
11
11
|
path "/FulfillmentInboundShipment/#{version}"
|
12
12
|
|
13
13
|
# Returns the information required to create an inbound shipment
|
14
14
|
#
|
15
15
|
# @see http://docs.developer.amazonservices.com/en_US/fba_inbound/FBAInbound_CreateInboundShipmentPlan.html
|
16
|
-
# @param
|
17
|
-
# @param
|
18
|
-
# @param
|
16
|
+
# @param [Struct, Hash] ship_from_address
|
17
|
+
# @param [Array<Struct, Hash>] inbound_shipment_plan_request_items
|
18
|
+
# @param [Hash] opts
|
19
19
|
# @option opts [String] :label_prep_preference
|
20
20
|
# @return [Peddler::XMLParser]
|
21
21
|
def create_inbound_shipment_plan(ship_from_address, inbound_shipment_plan_request_items, opts = {})
|
@@ -32,48 +32,36 @@ module MWS
|
|
32
32
|
# Creates an inbound shipment
|
33
33
|
#
|
34
34
|
# @see http://docs.developer.amazonservices.com/en_US/fba_inbound/FBAInbound_CreateInboundShipment.html
|
35
|
-
# @param
|
36
|
-
# @param
|
37
|
-
# @param
|
35
|
+
# @param [String] shipment_id
|
36
|
+
# @param [Struct, Hash] inbound_shipment_header
|
37
|
+
# @param [Hash] opts
|
38
38
|
# @option opts [Array<Struct, Hash>] :inbound_shipment_items
|
39
39
|
# @return [Peddler::XMLParser]
|
40
40
|
def create_inbound_shipment(shipment_id, inbound_shipment_header, opts = {})
|
41
|
-
|
42
|
-
.add(opts.update(
|
43
|
-
'ShipmentId' => shipment_id,
|
44
|
-
'InboundShipmentHeader' => inbound_shipment_header
|
45
|
-
))
|
46
|
-
.structure!('InboundShipmentItems', 'member')
|
47
|
-
|
41
|
+
build_inbound_shipment_operation('CreateInboundShipment', shipment_id, inbound_shipment_header, opts)
|
48
42
|
run
|
49
43
|
end
|
50
44
|
|
51
45
|
# Updates an existing inbound shipment
|
52
46
|
#
|
53
47
|
# @see http://docs.developer.amazonservices.com/en_US/fba_inbound/FBAInbound_UpdateInboundShipment.html
|
54
|
-
# @param
|
55
|
-
# @param
|
56
|
-
# @param
|
48
|
+
# @param [String] shipment_id
|
49
|
+
# @param [Struct, Hash] inbound_shipment_header
|
50
|
+
# @param [Hash] opts
|
57
51
|
# @option opts [Array<Struct, Hash>] :inbound_shipment_items
|
58
52
|
# @return [Peddler::XMLParser]
|
59
53
|
def update_inbound_shipment(shipment_id, inbound_shipment_header, opts = {})
|
60
|
-
|
61
|
-
.add(opts.update(
|
62
|
-
'ShipmentId' => shipment_id,
|
63
|
-
'InboundShipmentHeader' => inbound_shipment_header
|
64
|
-
))
|
65
|
-
.structure!('InboundShipmentItems', 'member')
|
66
|
-
|
54
|
+
build_inbound_shipment_operation('UpdateInboundShipment', shipment_id, inbound_shipment_header, opts)
|
67
55
|
run
|
68
56
|
end
|
69
57
|
|
70
58
|
# Sends transportation information to Amazon about an inbound shipment
|
71
59
|
#
|
72
60
|
# @see http://docs.developer.amazonservices.com/en_US/fba_inbound/FBAInbound_PutTransportContent.html
|
73
|
-
# @param
|
74
|
-
# @param
|
75
|
-
# @param
|
76
|
-
# @param
|
61
|
+
# @param [String] shipment_id
|
62
|
+
# @param [Boolean] is_partnered
|
63
|
+
# @param [String] shipment_type
|
64
|
+
# @param [Struct, Hash] transport_details
|
77
65
|
# @return [Peddler::XMLParser]
|
78
66
|
def put_transport_content(shipment_id, is_partnered, shipment_type, transport_details)
|
79
67
|
operation('PutTransportContent')
|
@@ -91,7 +79,7 @@ module MWS
|
|
91
79
|
# Requests an estimate of the shipping cost for an inbound shipment
|
92
80
|
#
|
93
81
|
# @see http://docs.developer.amazonservices.com/en_US/fba_inbound/FBAInbound_EstimateTransportRequest.html
|
94
|
-
# @param
|
82
|
+
# @param [String] shipment_id
|
95
83
|
# @return [Peddler::XMLParser]
|
96
84
|
def estimate_transport_request(shipment_id)
|
97
85
|
operation('EstimateTransportRequest').add('ShipmentId' => shipment_id)
|
@@ -101,7 +89,7 @@ module MWS
|
|
101
89
|
# Returns current transportation information about an inbound shipment
|
102
90
|
#
|
103
91
|
# @see http://docs.developer.amazonservices.com/en_US/fba_inbound/FBAInbound_GetTransportContent.html
|
104
|
-
# @param
|
92
|
+
# @param [String] shipment_id
|
105
93
|
# @return [Peddler::XMLParser]
|
106
94
|
def get_transport_content(shipment_id)
|
107
95
|
operation('GetTransportContent').add('ShipmentId' => shipment_id)
|
@@ -112,7 +100,7 @@ module MWS
|
|
112
100
|
# request that the Amazon-partnered carrier ship your inbound shipment
|
113
101
|
#
|
114
102
|
# @see http://docs.developer.amazonservices.com/en_US/fba_inbound/FBAInbound_ConfirmTransportRequest.html
|
115
|
-
# @param
|
103
|
+
# @param [String] shipment_id
|
116
104
|
# @return [Peddler::XMLParser]
|
117
105
|
def confirm_transport_request(shipment_id)
|
118
106
|
operation('ConfirmTransportRequest').add('ShipmentId' => shipment_id)
|
@@ -123,7 +111,7 @@ module MWS
|
|
123
111
|
# an Amazon-partnered carrier
|
124
112
|
#
|
125
113
|
# @see http://docs.developer.amazonservices.com/en_US/fba_inbound/FBAInbound_VoidTransportRequest.html
|
126
|
-
# @param
|
114
|
+
# @param [String] shipment_id
|
127
115
|
# @return [Peddler::XMLParser]
|
128
116
|
def void_transport_request(shipment_id)
|
129
117
|
operation('VoidTransportRequest').add('ShipmentId' => shipment_id)
|
@@ -134,9 +122,9 @@ module MWS
|
|
134
122
|
# shipment
|
135
123
|
#
|
136
124
|
# @see http://docs.developer.amazonservices.com/en_US/fba_inbound/FBAInbound_GetPackageLabels.html
|
137
|
-
# @param
|
138
|
-
# @param
|
139
|
-
# @param
|
125
|
+
# @param [String] shipment_id
|
126
|
+
# @param [String] page_type
|
127
|
+
# @param [Hash] opts
|
140
128
|
# @option opts [Integer] :number_of_packages
|
141
129
|
# @return [Peddler::XMLParser]
|
142
130
|
def get_package_labels(shipment_id, page_type, opts = {})
|
@@ -153,7 +141,7 @@ module MWS
|
|
153
141
|
# shipment
|
154
142
|
#
|
155
143
|
# @see http://docs.developer.amazonservices.com/en_US/fba_inbound/FBAInbound_GetBillOfLading.html
|
156
|
-
# @param
|
144
|
+
# @param [String] shipment_id
|
157
145
|
# @return [Peddler::XMLParser]
|
158
146
|
def get_bill_of_lading(shipment_id)
|
159
147
|
operation('GetBillOfLading').add('ShipmentId' => shipment_id)
|
@@ -163,7 +151,7 @@ module MWS
|
|
163
151
|
# Returns a list of inbound shipments based on criteria that you specify
|
164
152
|
#
|
165
153
|
# @see http://docs.developer.amazonservices.com/en_US/fba_inbound/FBAInbound_ListInboundShipments.html
|
166
|
-
# @param
|
154
|
+
# @param [Hash] opts
|
167
155
|
# @option opts [Array<String>] :shipment_status_list
|
168
156
|
# @option opts [Array<String>] :shipment_id_list
|
169
157
|
# @option opts [String, #iso8601] :last_updated_after
|
@@ -181,7 +169,7 @@ module MWS
|
|
181
169
|
# Returns the next page of inbound shipments
|
182
170
|
#
|
183
171
|
# @see http://docs.developer.amazonservices.com/en_US/fba_inbound/FBAInbound_ListInboundShipmentsByNextToken.html
|
184
|
-
# @param
|
172
|
+
# @param [String] next_token
|
185
173
|
# @return [Peddler::XMLParser]
|
186
174
|
def list_inbound_shipments_by_next_token(next_token)
|
187
175
|
operation('ListInboundShipmentsByNextToken')
|
@@ -194,7 +182,7 @@ module MWS
|
|
194
182
|
# items that were updated within a specified time frame
|
195
183
|
#
|
196
184
|
# @see http://docs.developer.amazonservices.com/en_US/fba_inbound/FBAInbound_ListInboundShipmentItems.html
|
197
|
-
# @param
|
185
|
+
# @param [Hash] opts
|
198
186
|
# @option opts [String] :shipment_id
|
199
187
|
# @option opts [String, #iso8601] :last_updated_after
|
200
188
|
# @option opts [String, #iso8601] :last_updated_before
|
@@ -207,7 +195,7 @@ module MWS
|
|
207
195
|
# Returns the next page of inbound shipment items
|
208
196
|
#
|
209
197
|
# @see http://docs.developer.amazonservices.com/en_US/fba_inbound/FBAInbound_ListInboundShipmentItemsByNextToken.html
|
210
|
-
# @param
|
198
|
+
# @param [String] next_token
|
211
199
|
# @return [Peddler::XMLParser]
|
212
200
|
def list_inbound_shipment_items_by_next_token(next_token)
|
213
201
|
operation('ListInboundShipmentItemsByNextToken')
|
@@ -224,6 +212,19 @@ module MWS
|
|
224
212
|
operation('GetServiceStatus')
|
225
213
|
run
|
226
214
|
end
|
215
|
+
|
216
|
+
private
|
217
|
+
|
218
|
+
def build_inbound_shipment_operation(operation_name, shipment_id, inbound_shipment_header, opts)
|
219
|
+
operation(operation_name)
|
220
|
+
.add(
|
221
|
+
opts.update(
|
222
|
+
'ShipmentId' => shipment_id,
|
223
|
+
'InboundShipmentHeader' => inbound_shipment_header
|
224
|
+
)
|
225
|
+
)
|
226
|
+
.structure!('InboundShipmentItems', 'member')
|
227
|
+
end
|
227
228
|
end
|
228
229
|
end
|
229
230
|
end
|