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, #merchant_id, #path, #primary_marketplace_id, #version

Instance Method Summary collapse

Methods inherited from Peddler::Client

#aws_endpoint, #defaults, #error_handler, #headers, #initialize, #marketplace, #marketplace_id, #marketplace_id=, on_error, #on_error, #operation, path, #run, version

Constructor Details

This class inherits a constructor from Peddler::Client

Instance Method Details

#get_competitive_pricing_for_asin(*asins, opts = {) ⇒ Peddler::XMLParser

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

marketplace_id: primary_marketplace_id })

Parameters:

  • asin (String)

    one or more asins

  • opts (Hash) (defaults to: {)

Options Hash (opts):

  • :marketplace_id (String)

Returns:

See Also:



100
101
102
103
104
105
106
107
108
# File 'lib/mws/products/client.rb', line 100

def get_competitive_pricing_for_asin(*asin_list)
  opts = extract_options(asin_list)

  operation_with_marketplace('GetCompetitivePricingForASIN')
    .add(opts.update('ASINList' => asin_list))
    .structure!('ASINList', 'ASIN')

  run
end

#get_competitive_pricing_for_sku(*seller_skus, opts = {) ⇒ Peddler::XMLParser

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

marketplace_id: primary_marketplace_id })

Parameters:

  • seller_sku (String)

    one or more seller_skus

  • opts (Hash) (defaults to: {)

Options Hash (opts):

  • :marketplace_id (String)

Returns:

See Also:



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

def get_competitive_pricing_for_sku(*seller_sku_list)
  opts = extract_options(seller_sku_list)

  operation_with_marketplace('GetCompetitivePricingForSKU')
    .add(opts.update('SellerSKUList' => seller_sku_list))
    .structure!('SellerSKUList', 'SellerSKU')

  run
end

#get_lowest_offer_listings_for_asin(*asins, opts = {) ⇒ Peddler::XMLParser

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

marketplace_id: primary_marketplace_id })

Parameters:

  • asin (String)

    one or more asins

  • opts (Hash) (defaults to: {)

Options Hash (opts):

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

Returns:

See Also:



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

def get_lowest_offer_listings_for_asin(*asin_list)
  opts = extract_options(asin_list)

  operation_with_marketplace('GetLowestOfferListingsForASIN')
    .add(opts.update('ASINList' => asin_list))
    .structure!('ASINList', 'ASIN')

  run
end

#get_lowest_offer_listings_for_sku(*seller_skus, opts = {) ⇒ Peddler::XMLParser

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

marketplace_id: primary_marketplace_id })

Parameters:

  • seller_sku (String)

    one or more seller_skus

  • opts (Hash) (defaults to: {)

Options Hash (opts):

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

Returns:

See Also:



122
123
124
125
126
127
128
129
130
# File 'lib/mws/products/client.rb', line 122

def get_lowest_offer_listings_for_sku(*seller_sku_list)
  opts = extract_options(seller_sku_list)

  operation_with_marketplace('GetLowestOfferListingsForSKU')
    .add(opts.update('SellerSKUList' => seller_sku_list))
    .structure!('SellerSKUList', 'SellerSKU')

  run
end

#get_lowest_priced_offers_for_asin(asin, item_condition, opts = ) ⇒ Peddler::XMLParser

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

{ marketplace_id: primary_marketplace_id })

Parameters:

  • asin (String)
  • item_condition (String)
  • opts (Hash) (defaults to: )

Options Hash (opts):

  • :marketplace_id (String)

Returns:

See Also:



186
187
188
189
190
191
192
193
194
195
# File 'lib/mws/products/client.rb', line 186

def get_lowest_priced_offers_for_asin(asin, item_condition, opts = {})
  opts.update(
    'ASIN' => asin,
    'ItemCondition' => item_condition
  )
  operation_with_marketplace('GetLowestPricedOffersForASIN')
    .add(opts)

  run
end

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

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

opts = { marketplace_id: primary_marketplace_id })

Parameters:

  • seller_sku (String)
  • item_condition (String)
  • opts (Hash)

Returns:

See Also:



164
165
166
167
168
169
170
171
172
173
174
# File 'lib/mws/products/client.rb', line 164

def get_lowest_priced_offers_for_sku(seller_sku, item_condition,
                                     opts = {})
  opts.update(
    'SellerSKU' => seller_sku,
    'ItemCondition' => item_condition
  )
  operation_with_marketplace('GetLowestPricedOffersForSKU')
    .add(opts)

  run
end

#get_matching_product(*asins, opts = { marketplace_id:) ⇒ Peddler::XMLParser

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

primary_marketplace_id })

Parameters:

  • asin (String)

    one or more asins

  • opts (Hash) (defaults to: { marketplace_id:)

Options Hash (opts):

  • :marketplace_id (String)

Returns:

See Also:



62
63
64
65
66
67
68
69
70
# File 'lib/mws/products/client.rb', line 62

def get_matching_product(*asin_list)
  opts = extract_options(asin_list)

  operation_with_marketplace('GetMatchingProduct')
    .add(opts.update('ASINList' => asin_list))
    .structure!('ASINList', 'ASIN')

  run
end

#get_matching_product_for_id(id_type, *ids, opts = {) ⇒ Peddler::XMLParser

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

SellerSKU, UPC, EAN, ISBN, and JAN values

marketplace_id: primary_marketplace_id })

Parameters:

  • id_type (String)
  • id (String)

    one or more ids

  • opts (Hash) (defaults to: {)

Options Hash (opts):

  • :marketplace_id (String)

Returns:

See Also:



43
44
45
46
47
48
49
50
51
# File 'lib/mws/products/client.rb', line 43

def get_matching_product_for_id(id_type, *id_list)
  opts = extract_options(id_list)

  operation_with_marketplace('GetMatchingProductForId')
    .add(opts.update('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.



203
204
205
206
207
208
209
# File 'lib/mws/products/client.rb', line 203

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(*asins, opts = { marketplace_id:) ⇒ Peddler::XMLParser

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

primary_marketplace_id })

Parameters:

  • asin (String)

    one or more asins

  • opts (Hash) (defaults to: { marketplace_id:)

Options Hash (opts):

  • :marketplace_id (String)
  • :item_condition (String)

Returns:

See Also:



243
244
245
246
247
248
249
250
251
# File 'lib/mws/products/client.rb', line 243

def get_my_price_for_asin(*asin_list)
  opts = extract_options(asin_list)

  operation_with_marketplace('GetMyPriceForASIN')
    .add(opts.update('ASINList' => asin_list))
    .structure!('ASINList', 'ASIN')

  run
end

#get_my_price_for_sku(*seller_skus, opts = { marketplace_id:) ⇒ Peddler::XMLParser

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

primary_marketplace_id })

Parameters:

  • seller_sku (String)

    one or more seller_skus

  • opts (Hash) (defaults to: { marketplace_id:)

Options Hash (opts):

  • :marketplace_id (String)
  • :item_condition (String)

Returns:

See Also:



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

def get_my_price_for_sku(*seller_sku_list)
  opts = extract_options(seller_sku_list)

  operation_with_marketplace('GetMyPriceForSKU')
    .add(opts.update('SellerSKUList' => seller_sku_list))
    .structure!('SellerSKUList', 'SellerSKU')

  run
end

#get_product_categories_for_asin(asin, opts = { marketplace_id:) ⇒ Peddler::XMLParser

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

primary_marketplace_id })

Parameters:

  • asin (String)
  • opts (Hash) (defaults to: { marketplace_id:)

Options Hash (opts):

  • :marketplace_id (String)

Returns:

See Also:



279
280
281
282
283
284
# File 'lib/mws/products/client.rb', line 279

def get_product_categories_for_asin(asin, opts = {})
  operation_with_marketplace('GetProductCategoriesForASIN')
    .add(opts.update('ASIN' => asin))

  run
end

#get_product_categories_for_sku(sku, opts = { marketplace_id:) ⇒ Peddler::XMLParser

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

primary_marketplace_id })

Parameters:

  • seller_sku (String)
  • opts (Hash) (defaults to: { marketplace_id:)

Options Hash (opts):

  • :marketplace_id (String)

Returns:

See Also:



263
264
265
266
267
268
# File 'lib/mws/products/client.rb', line 263

def get_product_categories_for_sku(seller_sku, opts = {})
  operation_with_marketplace('GetProductCategoriesForSKU')
    .add(opts.update('SellerSKU' => seller_sku))

  run
end

#get_service_statusPeddler::XMLParser

Gets the service status of the API



290
291
292
293
# File 'lib/mws/products/client.rb', line 290

def get_service_status
  operation('GetServiceStatus')
  run
end

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

Lists products and their attributes, based on a search query

primary_marketplace_id })

Parameters:

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

Options Hash (opts):

  • :marketplace_id (String)
  • :query_context_id (String)

Returns:

See Also:



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

def list_matching_products(query, opts = {})
  operation_with_marketplace('ListMatchingProducts')
    .add(opts.update('Query' => query))

  run
end

#operation_with_marketplace(action) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



296
297
298
299
300
# File 'lib/mws/products/client.rb', line 296

def operation_with_marketplace(action)
  operation(action).tap do |opts|
    opts.store('MarketplaceId', primary_marketplace_id)
  end
end