Class: MWS::Products::Client

Inherits:
Peddler::Client show all
Defined in:
lib/mws/products/client.rb

Overview

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.

Instance Attribute Summary

Attributes inherited from Peddler::Client

#auth_token, #body, #marketplace, #merchant_id, #path

Instance Method Summary collapse

Methods inherited from Peddler::Client

#aws_endpoint, #defaults, #headers, #initialize, #operation, #run

Constructor Details

This class inherits a constructor from Peddler::Client

Instance Method Details

#get_competitive_pricing_for_asin(marketplace_id, *asin_list) ⇒ Peddler::XMLParser

Gets the current competitive price of a product, identified by its ASIN

Parameters:

  • marketplace_id (String)
  • asin_list (Array<String>)

Returns:

See Also:



83
84
85
86
87
88
89
# File 'lib/mws/products/client.rb', line 83

def get_competitive_pricing_for_asin(marketplace_id, *asin_list)
  operation('GetCompetitivePricingForASIN')
    .add('MarketplaceId' => marketplace_id, 'ASINList' => asin_list)
    .structure!('ASINList', 'ASIN')

  run
end

#get_competitive_pricing_for_sku(marketplace_id, *seller_sku_list) ⇒ Peddler::XMLParser

Gets the current competitive price of a product, based on Seller SKU

Parameters:

  • marketplace_id (String)
  • seller_sku_list (Array<String>)

Returns:

See Also:



68
69
70
71
72
73
74
75
# File 'lib/mws/products/client.rb', line 68

def get_competitive_pricing_for_sku(marketplace_id, *seller_sku_list)
  operation('GetCompetitivePricingForSKU')
    .add('MarketplaceId' => marketplace_id,
         'SellerSKUList' => seller_sku_list)
    .structure!('SellerSKUList', 'SellerSKU')

  run
end

#get_lowest_offers_listings_for_asin(marketplace_id, *asin_list, opts = {}) ⇒ Peddler::XMLParser

Gets pricing information for the lowest-price active offer listings for a product, identified by its ASIN

Parameters:

  • marketplace_id (String)
  • asin_list (Array<String>)
  • opts (Hash) (defaults to: {})

Options Hash (opts):

  • :item_condition (String)
  • :exclude_me (Boolean)

Returns:

See Also:



126
127
128
129
130
131
132
133
134
135
136
# File 'lib/mws/products/client.rb', line 126

def get_lowest_offer_listings_for_asin(marketplace_id, *asin_list)
  asin_list = asin_list.dup
  opts = extract_options(asin_list)

  operation('GetLowestOfferListingsForASIN')
    .add(opts)
    .add('MarketplaceId' => marketplace_id, 'ASINList' => asin_list)
    .structure!('ASINList', 'ASIN')

  run
end

#get_lowest_offer_listings_for_sku(marketplace_id, *seller_sku_list, opts = {}) ⇒ Peddler::XMLParser

Gets pricing information for the lowest-price active offer listings for a product, based on Seller SKU

Parameters:

  • marketplace_id (String)
  • seller_sku_list (Array<String>)
  • opts (Hash) (defaults to: {})

Options Hash (opts):

  • :item_condition (String)
  • :exclude_me (Boolean)

Returns:

See Also:



102
103
104
105
106
107
108
109
110
111
112
113
# File 'lib/mws/products/client.rb', line 102

def get_lowest_offer_listings_for_sku(marketplace_id, *seller_sku_list)
  seller_sku_list = seller_sku_list.dup
  opts = extract_options(seller_sku_list)

  operation('GetLowestOfferListingsForSKU')
    .add(opts)
    .add('MarketplaceId' => marketplace_id,
         'SellerSKUList' => seller_sku_list)
    .structure!('SellerSKUList', 'SellerSKU')

  run
end

#get_lowest_priced_offers_for_asin(marketplace_id, asin, item_condition) ⇒ Peddler::XMLParser

Gets lowest priced offers for a single product, based on ASIN

Parameters:

  • marketplace_id (String)
  • asin (String)
  • item_condition (String)

Returns:

See Also:



161
162
163
164
165
166
167
168
# File 'lib/mws/products/client.rb', line 161

def get_lowest_priced_offers_for_asin(marketplace_id, asin,
                                      item_condition)
  operation('GetLowestPricedOffersForASIN')
    .add('MarketplaceId' => marketplace_id, 'ASIN' => asin,
         'ItemCondition' => item_condition)

  run
end

#get_lowest_priced_offers_for_sku(marketplace_id, seller_sku, item_condition) ⇒ Peddler::XMLParser

Gets lowest priced offers for a single product, based on SellerSKU

Parameters:

  • marketplace_id (String)
  • seller_sku (String)
  • item_condition (String)

Returns:

See Also:



145
146
147
148
149
150
151
152
# File 'lib/mws/products/client.rb', line 145

def get_lowest_priced_offers_for_sku(marketplace_id, seller_sku,
                                     item_condition)
  operation('GetLowestPricedOffersForSKU')
    .add('MarketplaceId' => marketplace_id, 'SellerSKU' => seller_sku,
         'ItemCondition' => item_condition)

  run
end

#get_matching_product(marketplace_id, *asin_list) ⇒ Peddler::XMLParser

Lists products and their attributes, based on a list of ASIN values

Parameters:

  • marketplace_id (String)
  • asin_list (Array<String>)

Returns:

See Also:



37
38
39
40
41
42
43
# File 'lib/mws/products/client.rb', line 37

def get_matching_product(marketplace_id, *asin_list)
  operation('GetMatchingProduct')
    .add('MarketplaceId' => marketplace_id, 'ASINList' => asin_list)
    .structure!('ASINList', 'ASIN')

  run
end

#get_matching_product_for_id(marketplace_id, id_type, *id_list) ⇒ Peddler::XMLParser

Lists products and their attributes, based on a list of ASIN, GCID,

SellerSKU, UPC, EAN, ISBN, and JAN values

Parameters:

  • marketplace_id (String)
  • id_type (String)
  • id_list (Array<String>)

Returns:

See Also:



53
54
55
56
57
58
59
60
# File 'lib/mws/products/client.rb', line 53

def get_matching_product_for_id(marketplace_id, id_type, *id_list)
  operation('GetMatchingProductForId')
    .add('MarketplaceId' => marketplace_id, 'IdType' => id_type,
         'IdList' => id_list)
    .structure!('IdList', 'Id')

  run
end

#get_my_fees_estimate(*fees_estimate_requests) ⇒ Peddler::XMLParser

Gets the estimated fees for a list of products.



176
177
178
179
180
181
182
# File 'lib/mws/products/client.rb', line 176

def get_my_fees_estimate(*fees_estimate_requests)
  operation('GetMyFeesEstimate')
    .add('FeesEstimateRequestList' => fees_estimate_requests)
    .structure!('FeesEstimateRequestList', 'FeesEstimateRequest')

  run
end

#get_my_price_for_asin(marketplace_id, *asin_list, opts = {}) ⇒ Peddler::XMLParser

Gets pricing information for seller's own offer listings, identified by its ASIN

Parameters:

  • marketplace_id (String)
  • asin_list (Array<String>)
  • opts (Hash) (defaults to: {})

Options Hash (opts):

  • :item_condition (String)

Returns:

See Also:



218
219
220
221
222
223
224
225
226
227
228
229
# File 'lib/mws/products/client.rb', line 218

def get_my_price_for_asin(marketplace_id, *asin_list)
  asin_list = asin_list.dup
  opts = extract_options(asin_list)

  operation('GetMyPriceForASIN')
    .add(opts)
    .add('MarketplaceId' => marketplace_id,
         'ASINList' => asin_list)
    .structure!('ASINList', 'ASIN')

  run
end

#get_my_price_for_sku(marketplace_id, *seller_sku_list) ⇒ Peddler::XMLParser

Gets pricing information for seller's own offer listings, based on Seller SKU

opts = {})

Parameters:

  • marketplace_id (String)
  • seller_sku_list (Array<String>)
  • opts (Hash)

Returns:

See Also:



195
196
197
198
199
200
201
202
203
204
205
206
# File 'lib/mws/products/client.rb', line 195

def get_my_price_for_sku(marketplace_id, *seller_sku_list)
  seller_sku_list = seller_sku_list.dup
  opts = extract_options(seller_sku_list)

  operation('GetMyPriceForSKU')
    .add(opts)
    .add('MarketplaceId' => marketplace_id,
         'SellerSKUList' => seller_sku_list)
    .structure!('SellerSKUList', 'SellerSKU')

  run
end

#get_product_categories_for_asin(marketplace_id, asin) ⇒ Peddler::XMLParser

Gets parent product categories that a product belongs to, based on ASIN



251
252
253
254
255
256
# File 'lib/mws/products/client.rb', line 251

def get_product_categories_for_asin(marketplace_id, asin)
  operation('GetProductCategoriesForASIN')
    .add('MarketplaceId' => marketplace_id, 'ASIN' => asin)

  run
end

#get_product_categories_for_sku(marketplace_id, seller_sku) ⇒ Peddler::XMLParser

Gets parent product categories that a product belongs to, based on Seller SKU

Parameters:

  • marketplace_id (String)
  • seller_sku (String)

Returns:

See Also:



238
239
240
241
242
243
# File 'lib/mws/products/client.rb', line 238

def get_product_categories_for_sku(marketplace_id, seller_sku)
  operation('GetProductCategoriesForSKU')
    .add('MarketplaceId' => marketplace_id, 'SellerSKU' => seller_sku)

  run
end

#get_service_statusPeddler::XMLParser

Gets the service status of the API



262
263
264
265
# File 'lib/mws/products/client.rb', line 262

def get_service_status
  operation('GetServiceStatus')
  run
end

#list_matching_products(marketplace_id, query, opts = {}) ⇒ Peddler::XMLParser

Lists products and their attributes, based on a search query

Parameters:

  • marketplace_id (String)
  • query (String)
  • opts (Hash) (defaults to: {})

Options Hash (opts):

  • :query_context_id (String)

Returns:

See Also:



23
24
25
26
27
28
29
# File 'lib/mws/products/client.rb', line 23

def list_matching_products(marketplace_id, query, opts = {})
  operation('ListMatchingProducts')
    .add(opts)
    .add('MarketplaceId' => marketplace_id, 'Query' => query)

  run
end