Class: MWS::Products

Inherits:
Peddler::Client show all
Defined in:
lib/mws/products.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.

Constant Summary

Constants inherited from Peddler::Client

Peddler::Client::BadMarketplaceId, Peddler::Client::HOSTS

Instance Attribute Summary

Attributes inherited from Peddler::Client

#body, #marketplace_id, #merchant_id

Instance Method Summary collapse

Methods inherited from Peddler::Client

#aws_endpoint, #headers, inherited, #initialize, path, #run

Constructor Details

This class inherits a constructor from Peddler::Client

Instance Method Details

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

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

Parameters:

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

Options Hash (opts):

  • :marketplace_id (String)

Returns:

See Also:



91
92
93
94
95
96
97
98
99
# File 'lib/mws/products.rb', line 91

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

  operation('GetCompetitivePricingForASIN')
    .add(opts.merge('ASINList' => asins))
    .structure!('ASINList', 'ASIN')

  run
end

#get_competitive_pricing_for_sku(*skus, opts = { marketplace_id: marketplace_id }) ⇒ Peddler::XMLParser

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

Parameters:

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

Options Hash (opts):

  • :marketplace_id (String)

Returns:

See Also:



73
74
75
76
77
78
79
80
81
# File 'lib/mws/products.rb', line 73

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

  operation('GetCompetitivePricingForSKU')
    .add(opts.merge('SellerSKUList' => skus))
    .structure!('SellerSKUList', 'SellerSKU')

  run
end

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

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

Parameters:

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

Options Hash (opts):

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

Returns:

See Also:



133
134
135
136
137
138
139
140
141
# File 'lib/mws/products.rb', line 133

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

  operation('GetLowestOfferListingsForASIN')
    .add(opts.merge('ASINList' => asins))
    .structure!('ASINList', 'ASIN')

  run
end

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

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

Parameters:

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

Options Hash (opts):

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

Returns:

See Also:



112
113
114
115
116
117
118
119
120
# File 'lib/mws/products.rb', line 112

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

  operation('GetLowestOfferListingsForSKU')
    .add(opts.merge('SellerSKUList' => skus))
    .structure!('SellerSKUList', 'SellerSKU')

  run
end

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

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

Parameters:

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

Options Hash (opts):

  • :marketplace_id (String)

Returns:

See Also:



55
56
57
58
59
60
61
62
63
# File 'lib/mws/products.rb', line 55

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

  operation('GetMatchingProduct')
    .add(opts.merge('ASINList' => asins))
    .structure!('ASINList', 'ASIN')

  run
end

#get_matching_product_for_id(id_type, *id_list, opts = { marketplace_id: marketplace_id }) ⇒ Peddler::XMLParser

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

SellerSKU, UPC, EAN, ISBN, and JAN values

Parameters:

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

Options Hash (opts):

  • :marketplace_id (String)

Returns:

See Also:



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

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

  operation('GetMatchingProductForId')
    .add(opts.merge('IdType' => id_type, 'IdList' => id_list))
    .structure!('IdList', 'Id')

  run
end

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

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

Parameters:

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

Options Hash (opts):

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

Returns:

See Also:



173
174
175
176
177
178
179
180
181
# File 'lib/mws/products.rb', line 173

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

  operation('GetMyPriceForASIN')
    .add(opts.merge('ASINList' => asins))
    .structure!('ASINList', 'ASIN')

  run
end

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

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

Parameters:

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

Options Hash (opts):

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

Returns:

See Also:



153
154
155
156
157
158
159
160
161
# File 'lib/mws/products.rb', line 153

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

  operation('GetMyPriceForSKU')
    .add(opts.merge('SellerSKUList' => skus))
    .structure!('SellerSKUList', 'SellerSKU')

  run
end

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

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

Parameters:

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

Options Hash (opts):

  • :marketplace_id (String)

Returns:

See Also:



207
208
209
210
211
212
# File 'lib/mws/products.rb', line 207

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

  run
end

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

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

Parameters:

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

Options Hash (opts):

  • :marketplace_id (String)

Returns:

See Also:



192
193
194
195
196
197
# File 'lib/mws/products.rb', line 192

def get_product_categories_for_sku(sku, opts = {})
  operation('GetProductCategoriesForSKU')
    .add(opts.merge('SellerSKU' => sku))

  run
end

#get_service_statusPeddler::XMLParser

Gets the service status of the API



218
219
220
221
# File 'lib/mws/products.rb', line 218

def get_service_status
  operation('GetServiceStatus')
  run
end

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

Lists products and their attributes, based on a search query

Parameters:

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

Options Hash (opts):

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

Returns:

See Also:



20
21
22
23
24
25
# File 'lib/mws/products.rb', line 20

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

  run
end

#operationObject

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.



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

def operation(*)
  super.tap do |opts|
    unless opts.has_key?('MarketplaceId')
      opts.store('MarketplaceId', marketplace_id)
    end
  end
end