peddler 2.4.4 → 3.0.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +406 -134
- data/lib/peddler/access_token.rb +76 -0
- data/lib/peddler/api/amazon_warehousing_and_distribution_2024_05_09.rb +80 -0
- data/lib/peddler/api/aplus_content_2020_11_01.rb +208 -0
- data/lib/peddler/api/application_management_2023_11_30.rb +25 -0
- data/lib/peddler/api/catalog_items_2020_12_01.rb +70 -0
- data/lib/peddler/api/catalog_items_2022_04_01.rb +83 -0
- data/lib/peddler/api/catalog_items_v0.rb +90 -0
- data/lib/peddler/api/data_kiosk_2023_11_15.rb +92 -0
- data/lib/peddler/api/easy_ship_2022_03_23.rb +108 -0
- data/lib/peddler/api/fba_inbound_eligibility_v1.rb +36 -0
- data/lib/peddler/api/fba_inventory_v1.rb +106 -0
- data/lib/peddler/api/feeds_2021_06_30.rb +104 -0
- data/lib/peddler/api/finances_v0.rb +121 -0
- data/lib/peddler/api/fulfillment_inbound_2024_03_20.rb +660 -0
- data/lib/peddler/api/fulfillment_inbound_v0.rb +314 -0
- data/lib/peddler/api/fulfillment_outbound_2020_07_01.rb +222 -0
- data/lib/peddler/api/listings_items_2020_09_01.rb +84 -0
- data/lib/peddler/api/listings_items_2021_08_01.rb +154 -0
- data/lib/peddler/api/listings_restrictions_2021_08_01.rb +37 -0
- data/lib/peddler/api/merchant_fulfillment_v0.rb +64 -0
- data/lib/peddler/api/messaging_v1.rb +241 -0
- data/lib/peddler/api/notifications_v1.rb +114 -0
- data/lib/peddler/api/orders_v0.rb +264 -0
- data/lib/peddler/api/product_fees_v0.rb +69 -0
- data/lib/peddler/api/product_pricing_2022_05_01.rb +43 -0
- data/lib/peddler/api/product_pricing_v0.rb +144 -0
- data/lib/peddler/api/product_type_definitions_2020_09_01.rb +75 -0
- data/lib/peddler/api/replenishment_2022_11_07.rb +45 -0
- data/lib/peddler/api/reports_2021_06_30.rb +139 -0
- data/lib/peddler/api/sales_v1.rb +69 -0
- data/lib/peddler/api/sellers_v1.rb +33 -0
- data/lib/peddler/api/services_v1.rb +308 -0
- data/lib/peddler/api/shipment_invoicing_v0.rb +46 -0
- data/lib/peddler/api/shipping_v1.rb +107 -0
- data/lib/peddler/api/shipping_v2.rb +267 -0
- data/lib/peddler/api/solicitations_v1.rb +53 -0
- data/lib/peddler/api/supply_sources_2020_07_01.rb +82 -0
- data/lib/peddler/api/tokens_2021_03_01.rb +30 -0
- data/lib/peddler/api/uploads_2020_11_01.rb +40 -0
- data/lib/peddler/api/vendor_direct_fulfillment_inventory_v1.rb +24 -0
- data/lib/peddler/api/vendor_direct_fulfillment_orders_2021_12_28.rb +72 -0
- data/lib/peddler/api/vendor_direct_fulfillment_orders_v1.rb +72 -0
- data/lib/peddler/api/vendor_direct_fulfillment_payments_v1.rb +23 -0
- data/lib/peddler/api/vendor_direct_fulfillment_sandbox_test_data_2021_10_28.rb +35 -0
- data/lib/peddler/api/vendor_direct_fulfillment_shipping_2021_12_28.rb +177 -0
- data/lib/peddler/api/vendor_direct_fulfillment_shipping_v1.rb +165 -0
- data/lib/peddler/api/vendor_direct_fulfillment_transactions_2021_12_28.rb +24 -0
- data/lib/peddler/api/vendor_direct_fulfillment_transactions_v1.rb +24 -0
- data/lib/peddler/api/vendor_invoices_v1.rb +22 -0
- data/lib/peddler/api/vendor_orders_v1.rb +148 -0
- data/lib/peddler/api/vendor_shipments_v1.rb +120 -0
- data/lib/peddler/api/vendor_transaction_status_v1.rb +24 -0
- data/lib/peddler/api.rb +115 -0
- data/lib/peddler/error.rb +30 -0
- data/lib/peddler/region.rb +30 -0
- data/lib/peddler/version.rb +1 -1
- data/lib/peddler.rb +52 -1
- metadata +70 -80
- data/lib/mws/easy_ship/client.rb +0 -93
- data/lib/mws/easy_ship.rb +0 -3
- data/lib/mws/feeds/client.rb +0 -122
- data/lib/mws/feeds.rb +0 -3
- data/lib/mws/finances/client.rb +0 -82
- data/lib/mws/finances.rb +0 -3
- data/lib/mws/fulfillment_inbound_shipment/client.rb +0 -388
- data/lib/mws/fulfillment_inbound_shipment.rb +0 -3
- data/lib/mws/fulfillment_inventory/client.rb +0 -57
- data/lib/mws/fulfillment_inventory.rb +0 -3
- data/lib/mws/fulfillment_outbound_shipment/client.rb +0 -211
- data/lib/mws/fulfillment_outbound_shipment.rb +0 -3
- data/lib/mws/merchant_fulfillment/client.rb +0 -87
- data/lib/mws/merchant_fulfillment.rb +0 -3
- data/lib/mws/off_amazon_payments.rb +0 -3
- data/lib/mws/orders/client.rb +0 -120
- data/lib/mws/orders.rb +0 -3
- data/lib/mws/products/client.rb +0 -268
- data/lib/mws/products.rb +0 -3
- data/lib/mws/recommendations/client.rb +0 -72
- data/lib/mws/recommendations.rb +0 -3
- data/lib/mws/reports/client.rb +0 -236
- data/lib/mws/reports.rb +0 -3
- data/lib/mws/sellers/client.rb +0 -44
- data/lib/mws/sellers.rb +0 -3
- data/lib/mws/shipment_invoicing/client.rb +0 -74
- data/lib/mws/shipment_invoicing.rb +0 -3
- data/lib/mws/subscriptions/client.rb +0 -179
- data/lib/mws/subscriptions.rb +0 -3
- data/lib/mws.rb +0 -29
- data/lib/peddler/client.rb +0 -159
- data/lib/peddler/errors/builder.rb +0 -64
- data/lib/peddler/errors/class_generator.rb +0 -40
- data/lib/peddler/errors/error.rb +0 -45
- data/lib/peddler/errors/parser.rb +0 -28
- data/lib/peddler/flat_file_parser.rb +0 -56
- data/lib/peddler/headers.rb +0 -102
- data/lib/peddler/marketplace.rb +0 -78
- data/lib/peddler/operation.rb +0 -78
- data/lib/peddler/parser.rb +0 -33
- data/lib/peddler/structured_list.rb +0 -23
- data/lib/peddler/vcr_matcher.rb +0 -97
- data/lib/peddler/xml_parser.rb +0 -38
- data/lib/peddler/xml_response_parser.rb +0 -25
@@ -1,87 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'peddler/client'
|
4
|
-
|
5
|
-
module MWS
|
6
|
-
module MerchantFulfillment
|
7
|
-
# The Merchant Fulfillment API provides programmatic access to Amazon's
|
8
|
-
# Shipping Services for sellers, including competitive rates from
|
9
|
-
# Amazon-partnered carriers. Sellers can find out what shipping service
|
10
|
-
# offers are available by submitting information about a proposed shipment,
|
11
|
-
# such as package size and weight, shipment origin, and delivery date
|
12
|
-
# requirements. Sellers can choose from the shipping service offers returned
|
13
|
-
# by Amazon, and then purchase shipping labels for fulfilling their orders.
|
14
|
-
class Client < ::Peddler::Client
|
15
|
-
self.version = '2015-06-01'
|
16
|
-
self.path = "/MerchantFulfillment/#{version}"
|
17
|
-
|
18
|
-
# Returns a list of shipping service offers that satisfy the shipment
|
19
|
-
# request details that you specify
|
20
|
-
#
|
21
|
-
# @see https://docs.developer.amazonservices.com/en_US/merch_fulfill/MerchFulfill_GetEligibleShippingServices.html
|
22
|
-
# @param [Struct, Hash] shipment_request_details
|
23
|
-
# @return [Peddler::XMLParser]
|
24
|
-
def get_eligible_shipping_services(shipment_request_details)
|
25
|
-
operation('GetEligibleShippingServices')
|
26
|
-
.add('ShipmentRequestDetails' => shipment_request_details)
|
27
|
-
.structure!('ItemList', 'Item')
|
28
|
-
|
29
|
-
run
|
30
|
-
end
|
31
|
-
|
32
|
-
# Purchases shipping and returns PNG or PDF document data for a shipping
|
33
|
-
# label
|
34
|
-
#
|
35
|
-
# @see https://docs.developer.amazonservices.com/en_US/merch_fulfill/MerchFulfill_CreateShipment.html
|
36
|
-
# @param [Struct, Hash] shipment_request_details
|
37
|
-
# @param [String] shipping_service_id
|
38
|
-
# @param [Hash] opts
|
39
|
-
# @option opts [String] :shipping_service_offer_id
|
40
|
-
# @return [Peddler::XMLParser]
|
41
|
-
def create_shipment(shipment_request_details, shipping_service_id,
|
42
|
-
opts = {})
|
43
|
-
operation('CreateShipment')
|
44
|
-
.add(opts)
|
45
|
-
.add('ShipmentRequestDetails' => shipment_request_details,
|
46
|
-
'ShippingServiceId' => shipping_service_id)
|
47
|
-
.structure!('ItemList', 'Item')
|
48
|
-
|
49
|
-
run
|
50
|
-
end
|
51
|
-
|
52
|
-
# Returns an existing shipment for the ShipmentId value that you specify
|
53
|
-
#
|
54
|
-
# @see https://docs.developer.amazonservices.com/en_US/merch_fulfill/MerchFulfill_GetShipment.html
|
55
|
-
# @param [String] shipment_id
|
56
|
-
# @return [Peddler::XMLParser]
|
57
|
-
def get_shipment(shipment_id)
|
58
|
-
operation('GetShipment')
|
59
|
-
.add('ShipmentId' => shipment_id)
|
60
|
-
|
61
|
-
run
|
62
|
-
end
|
63
|
-
|
64
|
-
# Cancels an existing shipment and requests a refund for the ShipmentId
|
65
|
-
# value that you specify
|
66
|
-
#
|
67
|
-
# @see https://docs.developer.amazonservices.com/en_US/merch_fulfill/MerchFulfill_CancelShipment.html
|
68
|
-
# @param [String] shipment_id
|
69
|
-
# @return [Peddler::XMLParser]
|
70
|
-
def cancel_shipment(shipment_id)
|
71
|
-
operation('CancelShipment')
|
72
|
-
.add('ShipmentId' => shipment_id)
|
73
|
-
|
74
|
-
run
|
75
|
-
end
|
76
|
-
|
77
|
-
# Gets the operational status of the API
|
78
|
-
#
|
79
|
-
# @see https://docs.developer.amazonservices.com/en_US/merch_fulfill/MWS_GetServiceStatus.html
|
80
|
-
# @return [Peddler::XMLParser]
|
81
|
-
def get_service_status
|
82
|
-
operation('GetServiceStatus')
|
83
|
-
run
|
84
|
-
end
|
85
|
-
end
|
86
|
-
end
|
87
|
-
end
|
data/lib/mws/orders/client.rb
DELETED
@@ -1,120 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'peddler/client'
|
4
|
-
|
5
|
-
module MWS
|
6
|
-
module Orders
|
7
|
-
# With the MWS Orders API, you can list orders created or updated during a
|
8
|
-
# time frame you specify or retrieve information about specific orders.
|
9
|
-
class Client < ::Peddler::Client
|
10
|
-
self.version = '2013-09-01'
|
11
|
-
self.path = "/Orders/#{version}"
|
12
|
-
|
13
|
-
# Lists orders
|
14
|
-
#
|
15
|
-
# @note When calling this operation, you must specify a time frame using
|
16
|
-
# either created_after or last_updated_after. When requesting orders by
|
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
|
19
|
-
# @overload list_orders(*marketplace_id, opts = {})
|
20
|
-
# @param [Array<String>] marketplace_id
|
21
|
-
# @param [Hash] opts
|
22
|
-
# @option opts [String, #iso8601] :created_after
|
23
|
-
# @option opts [String, #iso8601] :created_before
|
24
|
-
# @option opts [String, #iso8601] :last_updated_after
|
25
|
-
# @option opts [String, #iso8601] :last_updated_before
|
26
|
-
# @option opts [Array<String>, String] :order_status
|
27
|
-
# @option opts [Array<String>, String] :fulfillment_channel
|
28
|
-
# @option opts [Array<String>, String] :payment_method
|
29
|
-
# @option opts [String] :buyer_email
|
30
|
-
# @option opts [String] :seller_order_id
|
31
|
-
# @option opts [String] :max_results_per_page
|
32
|
-
# @option opts [String] :tfm_shipment_status
|
33
|
-
# @return [Peddler::XMLParser]
|
34
|
-
def list_orders(*marketplace_id)
|
35
|
-
marketplace_id = marketplace_id.dup
|
36
|
-
opts = extract_options(marketplace_id)
|
37
|
-
opts['TFMShipmentStatus'] = opts.delete(:tfm_shipment_status) if opts.key?(:tfm_shipment_status)
|
38
|
-
|
39
|
-
operation('ListOrders')
|
40
|
-
.add(opts)
|
41
|
-
.add('MarketplaceId' => marketplace_id)
|
42
|
-
.structure!('OrderStatus', 'Status')
|
43
|
-
.structure!('FulfillmentChannel', 'Channel')
|
44
|
-
.structure!('MarketplaceId', 'Id')
|
45
|
-
.structure!('PaymentMethod')
|
46
|
-
.structure!('TFMShipmentStatus', 'Status')
|
47
|
-
require_start_time!
|
48
|
-
|
49
|
-
run
|
50
|
-
end
|
51
|
-
|
52
|
-
# Lists the next page of orders
|
53
|
-
#
|
54
|
-
# @see https://docs.developer.amazonservices.com/en_US/orders-2013-09-01/Orders_ListOrdersByNextToken.html
|
55
|
-
# @param [String] next_token
|
56
|
-
# @return [Peddler::XMLParser]
|
57
|
-
def list_orders_by_next_token(next_token)
|
58
|
-
operation('ListOrdersByNextToken')
|
59
|
-
.add('NextToken' => next_token)
|
60
|
-
|
61
|
-
run
|
62
|
-
end
|
63
|
-
|
64
|
-
# Gets one or more orders
|
65
|
-
#
|
66
|
-
# @see https://docs.developer.amazonservices.com/en_US/orders-2013-09-01/Orders_GetOrder.html
|
67
|
-
# @param [Array<String>] amazon_order_ids
|
68
|
-
# @return [Peddler::XMLParser]
|
69
|
-
def get_order(*amazon_order_ids)
|
70
|
-
operation('GetOrder')
|
71
|
-
.add('AmazonOrderId' => amazon_order_ids)
|
72
|
-
.structure!('AmazonOrderId', 'Id')
|
73
|
-
|
74
|
-
run
|
75
|
-
end
|
76
|
-
|
77
|
-
# Lists order items for an order
|
78
|
-
#
|
79
|
-
# @see https://docs.developer.amazonservices.com/en_US/orders-2013-09-01/Orders_ListOrderItems.html
|
80
|
-
# @param [String] amazon_order_id
|
81
|
-
# @return [Peddler::XMLParser]
|
82
|
-
def list_order_items(amazon_order_id)
|
83
|
-
operation('ListOrderItems')
|
84
|
-
.add('AmazonOrderId' => amazon_order_id)
|
85
|
-
|
86
|
-
run
|
87
|
-
end
|
88
|
-
|
89
|
-
# Lists the next page of order items for an order
|
90
|
-
#
|
91
|
-
# @see https://docs.developer.amazonservices.com/en_US/orders-2013-09-01/Orders_ListOrderItemsByNextToken.html
|
92
|
-
# @param [String] next_token
|
93
|
-
# @return [Peddler::XMLParser]
|
94
|
-
def list_order_items_by_next_token(next_token)
|
95
|
-
operation('ListOrderItemsByNextToken')
|
96
|
-
.add('NextToken' => next_token)
|
97
|
-
|
98
|
-
run
|
99
|
-
end
|
100
|
-
|
101
|
-
# Gets the service status of the API
|
102
|
-
#
|
103
|
-
# @see https://docs.developer.amazonservices.com/en_US/orders-2013-09-01/MWS_GetServiceStatus.html
|
104
|
-
# @return [Peddler::XMLParser]
|
105
|
-
def get_service_status
|
106
|
-
operation('GetServiceStatus')
|
107
|
-
run
|
108
|
-
end
|
109
|
-
|
110
|
-
private
|
111
|
-
|
112
|
-
def require_start_time!
|
113
|
-
return if operation.key?('CreatedAfter')
|
114
|
-
return if operation.key?('LastUpdatedAfter')
|
115
|
-
|
116
|
-
raise ArgumentError, 'specify created_after or last_updated_after'
|
117
|
-
end
|
118
|
-
end
|
119
|
-
end
|
120
|
-
end
|
data/lib/mws/orders.rb
DELETED
data/lib/mws/products/client.rb
DELETED
@@ -1,268 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'peddler/client'
|
4
|
-
|
5
|
-
module MWS
|
6
|
-
module Products
|
7
|
-
# The MWS Products API helps you get information to match your products to
|
8
|
-
# existing product listings on Amazon Marketplace websites and to make
|
9
|
-
# sourcing and pricing decisions for listing those products on Amazon
|
10
|
-
# Marketplace websites.
|
11
|
-
class Client < ::Peddler::Client
|
12
|
-
self.version = '2011-10-01'
|
13
|
-
self.path = "/Products/#{version}"
|
14
|
-
|
15
|
-
# Lists products and their attributes, based on a search query
|
16
|
-
#
|
17
|
-
# @see https://docs.developer.amazonservices.com/en_US/products/Products_ListMatchingProducts.html
|
18
|
-
# @param [String] marketplace_id
|
19
|
-
# @param [String] query
|
20
|
-
# @param [Hash] opts
|
21
|
-
# @option opts [String] :query_context_id
|
22
|
-
# @return [Peddler::XMLParser]
|
23
|
-
def list_matching_products(marketplace_id, query, opts = {})
|
24
|
-
operation('ListMatchingProducts')
|
25
|
-
.add(opts)
|
26
|
-
.add('MarketplaceId' => marketplace_id, 'Query' => query)
|
27
|
-
|
28
|
-
run
|
29
|
-
end
|
30
|
-
|
31
|
-
# Lists products and their attributes, based on a list of ASIN values
|
32
|
-
#
|
33
|
-
# @see https://docs.developer.amazonservices.com/en_US/products/Products_GetMatchingProductForId.html
|
34
|
-
# @param [String] marketplace_id
|
35
|
-
# @param [Array<String>] asin_list
|
36
|
-
# @return [Peddler::XMLParser]
|
37
|
-
def get_matching_product(marketplace_id, *asin_list)
|
38
|
-
operation('GetMatchingProduct')
|
39
|
-
.add('MarketplaceId' => marketplace_id, 'ASINList' => asin_list)
|
40
|
-
.structure!('ASINList', 'ASIN')
|
41
|
-
|
42
|
-
run
|
43
|
-
end
|
44
|
-
|
45
|
-
# Lists products and their attributes, based on a list of ASIN, GCID,
|
46
|
-
# SellerSKU, UPC, EAN, ISBN, and JAN values
|
47
|
-
#
|
48
|
-
# @see https://docs.developer.amazonservices.com/en_US/products/Products_GetMatchingProduct.html
|
49
|
-
# @param [String] marketplace_id
|
50
|
-
# @param [String] id_type
|
51
|
-
# @param [Array<String>] id_list
|
52
|
-
# @return [Peddler::XMLParser]
|
53
|
-
def get_matching_product_for_id(marketplace_id, id_type, *id_list)
|
54
|
-
operation('GetMatchingProductForId')
|
55
|
-
.add('MarketplaceId' => marketplace_id, 'IdType' => id_type,
|
56
|
-
'IdList' => id_list)
|
57
|
-
.structure!('IdList', 'Id')
|
58
|
-
|
59
|
-
run
|
60
|
-
end
|
61
|
-
|
62
|
-
# Gets the current competitive price of a product, based on Seller SKU
|
63
|
-
#
|
64
|
-
# @see https://docs.developer.amazonservices.com/en_US/products/Products_GetCompetitivePricingForSKU.html
|
65
|
-
# @param [String] marketplace_id
|
66
|
-
# @param [Array<String>] seller_sku_list
|
67
|
-
# @return [Peddler::XMLParser]
|
68
|
-
def get_competitive_pricing_for_sku(marketplace_id, *seller_sku_list)
|
69
|
-
operation('GetCompetitivePricingForSKU')
|
70
|
-
.add('MarketplaceId' => marketplace_id,
|
71
|
-
'SellerSKUList' => seller_sku_list)
|
72
|
-
.structure!('SellerSKUList', 'SellerSKU')
|
73
|
-
|
74
|
-
run
|
75
|
-
end
|
76
|
-
|
77
|
-
# Gets the current competitive price of a product, identified by its ASIN
|
78
|
-
#
|
79
|
-
# @see https://docs.developer.amazonservices.com/en_US/products/Products_GetCompetitivePricingForASIN.html
|
80
|
-
# @param [String] marketplace_id
|
81
|
-
# @param [Array<String>] asin_list
|
82
|
-
# @return [Peddler::XMLParser]
|
83
|
-
def get_competitive_pricing_for_asin(marketplace_id, *asin_list)
|
84
|
-
operation('GetCompetitivePricingForASIN')
|
85
|
-
.add('MarketplaceId' => marketplace_id, 'ASINList' => asin_list)
|
86
|
-
.structure!('ASINList', 'ASIN')
|
87
|
-
|
88
|
-
run
|
89
|
-
end
|
90
|
-
|
91
|
-
# Gets pricing information for the lowest-price active offer listings for
|
92
|
-
# a product, based on Seller SKU
|
93
|
-
#
|
94
|
-
# @see https://docs.developer.amazonservices.com/en_US/products/Products_GetLowestOfferListingsForSKU.html
|
95
|
-
# @overload get_lowest_offer_listings_for_sku(marketplace_id, *seller_sku_list, opts = {})
|
96
|
-
# @param [String] marketplace_id
|
97
|
-
# @param [Array<String>] seller_sku_list
|
98
|
-
# @param [Hash] opts
|
99
|
-
# @option opts [String] :item_condition
|
100
|
-
# @option opts [Boolean] :exclude_me
|
101
|
-
# @return [Peddler::XMLParser]
|
102
|
-
def get_lowest_offer_listings_for_sku(marketplace_id, *seller_sku_list)
|
103
|
-
seller_sku_list = seller_sku_list.dup
|
104
|
-
opts = extract_options(seller_sku_list)
|
105
|
-
|
106
|
-
operation('GetLowestOfferListingsForSKU')
|
107
|
-
.add(opts)
|
108
|
-
.add('MarketplaceId' => marketplace_id,
|
109
|
-
'SellerSKUList' => seller_sku_list)
|
110
|
-
.structure!('SellerSKUList', 'SellerSKU')
|
111
|
-
|
112
|
-
run
|
113
|
-
end
|
114
|
-
|
115
|
-
# Gets pricing information for the lowest-price active offer listings for
|
116
|
-
# a product, identified by its ASIN
|
117
|
-
#
|
118
|
-
# @see https://docs.developer.amazonservices.com/en_US/products/Products_GetLowestOfferListingsForASIN.html
|
119
|
-
# @overload get_lowest_offers_listings_for_asin(marketplace_id, *asin_list, opts = {})
|
120
|
-
# @param [String] marketplace_id
|
121
|
-
# @param [Array<String>] asin_list
|
122
|
-
# @param [Hash] opts
|
123
|
-
# @option opts [String] :item_condition
|
124
|
-
# @option opts [Boolean] :exclude_me
|
125
|
-
# @return [Peddler::XMLParser]
|
126
|
-
def get_lowest_offer_listings_for_asin(marketplace_id, *asin_list)
|
127
|
-
asin_list = asin_list.dup
|
128
|
-
opts = extract_options(asin_list)
|
129
|
-
|
130
|
-
operation('GetLowestOfferListingsForASIN')
|
131
|
-
.add(opts)
|
132
|
-
.add('MarketplaceId' => marketplace_id, 'ASINList' => asin_list)
|
133
|
-
.structure!('ASINList', 'ASIN')
|
134
|
-
|
135
|
-
run
|
136
|
-
end
|
137
|
-
|
138
|
-
# Gets lowest priced offers for a single product, based on SellerSKU
|
139
|
-
#
|
140
|
-
# @see https://docs.developer.amazonservices.com/en_MX/products/Products_GetLowestPricedOffersForSKU.html
|
141
|
-
# @param [String] marketplace_id
|
142
|
-
# @param [String] seller_sku
|
143
|
-
# @param [String] item_condition
|
144
|
-
# @return [Peddler::XMLParser]
|
145
|
-
def get_lowest_priced_offers_for_sku(marketplace_id, seller_sku,
|
146
|
-
item_condition)
|
147
|
-
operation('GetLowestPricedOffersForSKU')
|
148
|
-
.add('MarketplaceId' => marketplace_id, 'SellerSKU' => seller_sku,
|
149
|
-
'ItemCondition' => item_condition)
|
150
|
-
|
151
|
-
run
|
152
|
-
end
|
153
|
-
|
154
|
-
# Gets lowest priced offers for a single product, based on ASIN
|
155
|
-
#
|
156
|
-
# @see https://docs.developer.amazonservices.com/en_MX/products/Products_GetLowestPricedOffersForASIN.html
|
157
|
-
# @param [String] marketplace_id
|
158
|
-
# @param [String] asin
|
159
|
-
# @param [String] item_condition
|
160
|
-
# @return [Peddler::XMLParser]
|
161
|
-
def get_lowest_priced_offers_for_asin(marketplace_id, asin,
|
162
|
-
item_condition)
|
163
|
-
operation('GetLowestPricedOffersForASIN')
|
164
|
-
.add('MarketplaceId' => marketplace_id, 'ASIN' => asin,
|
165
|
-
'ItemCondition' => item_condition)
|
166
|
-
|
167
|
-
run
|
168
|
-
end
|
169
|
-
|
170
|
-
# Gets the estimated fees for a list of products.
|
171
|
-
#
|
172
|
-
# @see https://docs.developer.amazonservices.com/en_US/products/Products_GetMyFeesEstimate.html
|
173
|
-
# @see https://docs.developer.amazonservices.com/en_US/products/Products_Datatypes.html#FeesEstimateRequest
|
174
|
-
# @param [Array<Struct, Hash>] fees_estimate_requests
|
175
|
-
# @return [Peddler::XMLParser]
|
176
|
-
def get_my_fees_estimate(*fees_estimate_requests)
|
177
|
-
operation('GetMyFeesEstimate')
|
178
|
-
.add('FeesEstimateRequestList' => fees_estimate_requests)
|
179
|
-
.structure!('FeesEstimateRequestList', 'FeesEstimateRequest')
|
180
|
-
|
181
|
-
run
|
182
|
-
end
|
183
|
-
|
184
|
-
# Gets pricing information for seller's own offer listings, based on
|
185
|
-
# Seller SKU
|
186
|
-
#
|
187
|
-
# @see https://docs.developer.amazonservices.com/en_US/products/Products_GetMyPriceForSKU.html
|
188
|
-
# @overload get_my_price_for_sku(marketplace_id, *seller_sku_list,
|
189
|
-
# opts = {})
|
190
|
-
# @param [String] marketplace_id
|
191
|
-
# @param [Array<String>] seller_sku_list
|
192
|
-
# @param [Hash] opts
|
193
|
-
# @option opts [String] :item_condition
|
194
|
-
# @return [Peddler::XMLParser]
|
195
|
-
def get_my_price_for_sku(marketplace_id, *seller_sku_list)
|
196
|
-
seller_sku_list = seller_sku_list.dup
|
197
|
-
opts = extract_options(seller_sku_list)
|
198
|
-
|
199
|
-
operation('GetMyPriceForSKU')
|
200
|
-
.add(opts)
|
201
|
-
.add('MarketplaceId' => marketplace_id,
|
202
|
-
'SellerSKUList' => seller_sku_list)
|
203
|
-
.structure!('SellerSKUList', 'SellerSKU')
|
204
|
-
|
205
|
-
run
|
206
|
-
end
|
207
|
-
|
208
|
-
# Gets pricing information for seller's own offer listings, identified by
|
209
|
-
# its ASIN
|
210
|
-
#
|
211
|
-
# @see https://docs.developer.amazonservices.com/en_US/products/Products_GetMyPriceForASIN.html
|
212
|
-
# @overload get_my_price_for_asin(marketplace_id, *asin_list, opts = {})
|
213
|
-
# @param [String] marketplace_id
|
214
|
-
# @param [Array<String>] asin_list
|
215
|
-
# @param [Hash] opts
|
216
|
-
# @option opts [String] :item_condition
|
217
|
-
# @return [Peddler::XMLParser]
|
218
|
-
def get_my_price_for_asin(marketplace_id, *asin_list)
|
219
|
-
asin_list = asin_list.dup
|
220
|
-
opts = extract_options(asin_list)
|
221
|
-
|
222
|
-
operation('GetMyPriceForASIN')
|
223
|
-
.add(opts)
|
224
|
-
.add('MarketplaceId' => marketplace_id,
|
225
|
-
'ASINList' => asin_list)
|
226
|
-
.structure!('ASINList', 'ASIN')
|
227
|
-
|
228
|
-
run
|
229
|
-
end
|
230
|
-
|
231
|
-
# Gets parent product categories that a product belongs to, based on
|
232
|
-
# Seller SKU
|
233
|
-
#
|
234
|
-
# @see https://docs.developer.amazonservices.com/en_US/products/Products_GetProductCategoriesForSKU.html
|
235
|
-
# @param [String] marketplace_id
|
236
|
-
# @param [String] seller_sku
|
237
|
-
# @return [Peddler::XMLParser]
|
238
|
-
def get_product_categories_for_sku(marketplace_id, seller_sku)
|
239
|
-
operation('GetProductCategoriesForSKU')
|
240
|
-
.add('MarketplaceId' => marketplace_id, 'SellerSKU' => seller_sku)
|
241
|
-
|
242
|
-
run
|
243
|
-
end
|
244
|
-
|
245
|
-
# Gets parent product categories that a product belongs to, based on ASIN
|
246
|
-
#
|
247
|
-
# @see https://docs.developer.amazonservices.com/en_US/products/Products_GetProductCategoriesForASIN.html
|
248
|
-
# @param [String] marketplace_id
|
249
|
-
# @param [String] asin
|
250
|
-
# @return [Peddler::XMLParser]
|
251
|
-
def get_product_categories_for_asin(marketplace_id, asin)
|
252
|
-
operation('GetProductCategoriesForASIN')
|
253
|
-
.add('MarketplaceId' => marketplace_id, 'ASIN' => asin)
|
254
|
-
|
255
|
-
run
|
256
|
-
end
|
257
|
-
|
258
|
-
# Gets the service status of the API
|
259
|
-
#
|
260
|
-
# @see https://docs.developer.amazonservices.com/en_US/products/Products_GetServiceStatus.html
|
261
|
-
# @return [Peddler::XMLParser]
|
262
|
-
def get_service_status
|
263
|
-
operation('GetServiceStatus')
|
264
|
-
run
|
265
|
-
end
|
266
|
-
end
|
267
|
-
end
|
268
|
-
end
|
data/lib/mws/products.rb
DELETED
@@ -1,72 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'peddler/client'
|
4
|
-
|
5
|
-
module MWS
|
6
|
-
module Recommendations
|
7
|
-
# The Recommendations API enables you to programmatically retrieve Amazon
|
8
|
-
# Selling Coach recommendations by recommendation category. A recommendation
|
9
|
-
# is an actionable, timely, and personalized opportunity to increase your
|
10
|
-
# sales and performance.
|
11
|
-
class Client < ::Peddler::Client
|
12
|
-
self.version = '2013-04-01'
|
13
|
-
self.path = "/Recommendations/#{version}"
|
14
|
-
|
15
|
-
# Checks whether there are active recommendations for each category for
|
16
|
-
# the given marketplace, and if there are, returns the time when
|
17
|
-
# recommendations were last updated for each category
|
18
|
-
#
|
19
|
-
# @see https://docs.developer.amazonservices.com/en_US/recommendations/Recommendations_GetLastUpdatedTimeForRecommendations.html
|
20
|
-
# @param [String] marketplace_id
|
21
|
-
# @return [Peddler::XMLParser]
|
22
|
-
def get_last_updated_time_for_recommendations(marketplace_id)
|
23
|
-
operation('GetLastUpdatedTimeForRecommendations')
|
24
|
-
.add('MarketplaceId' => marketplace_id)
|
25
|
-
|
26
|
-
run
|
27
|
-
end
|
28
|
-
|
29
|
-
# Lists active recommendations for a specific category or for all
|
30
|
-
# categories for a specific marketplace
|
31
|
-
#
|
32
|
-
# @see https://docs.developer.amazonservices.com/en_US/recommendations/Recommendations_ListRecommendations.html
|
33
|
-
# @param [String] marketplace_id
|
34
|
-
# @param [Hash] opts
|
35
|
-
# @option opts [String] :recommendation_category
|
36
|
-
# @option opts [Array<Struct, Hash>] :category_query_list
|
37
|
-
# @return [Peddler::XMLParser]
|
38
|
-
def list_recommendations(marketplace_id, opts = {})
|
39
|
-
operation('ListRecommendations')
|
40
|
-
.add(opts)
|
41
|
-
.add('MarketplaceId' => marketplace_id)
|
42
|
-
.structure!(
|
43
|
-
'CategoryQueryList', 'CategoryQuery', '1', 'FilterOptions',
|
44
|
-
'FilterOption'
|
45
|
-
)
|
46
|
-
|
47
|
-
run
|
48
|
-
end
|
49
|
-
|
50
|
-
# Lists the next page of active recommendations
|
51
|
-
#
|
52
|
-
# @see https://docs.developer.amazonservices.com/en_US/recommendations/Recommendations_ListRecommendationsByNextToken.html
|
53
|
-
# @param [String] next_token
|
54
|
-
# @return [Peddler::XMLParser]
|
55
|
-
def list_recommendations_by_next_token(next_token)
|
56
|
-
operation('ListRecommendationsByNextToken')
|
57
|
-
.add('NextToken' => next_token)
|
58
|
-
|
59
|
-
run
|
60
|
-
end
|
61
|
-
|
62
|
-
# Gets the service status of the API
|
63
|
-
#
|
64
|
-
# @see https://docs.developer.amazonservices.com/en_US/recommendations/Recommendations_GetServiceStatus.html
|
65
|
-
# @return [Peddler::XMLParser]
|
66
|
-
def get_service_status
|
67
|
-
operation('GetServiceStatus')
|
68
|
-
run
|
69
|
-
end
|
70
|
-
end
|
71
|
-
end
|
72
|
-
end
|
data/lib/mws/recommendations.rb
DELETED