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

Instance Method Summary collapse

Methods inherited from Peddler::Client

#aws_endpoint, #defaults, #headers, inherited, #initialize, #marketplace, #on_error, #operation, parser, parser=, path, #run

Constructor Details

This class inherits a constructor from Peddler::Client

Instance Method Details

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

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

Parameters:

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

Options Hash (opts):

  • :marketplace_id (String)

Returns:

See Also:



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

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_sku_list, opts = { marketplace_id: marketplace_id }) ⇒ Peddler::XMLParser

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

Parameters:

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

Options Hash (opts):

  • :marketplace_id (String)

Returns:

See Also:



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

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(*asin_list, 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:

  • asin_list (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:



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

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_sku_list, 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:

  • seller_sku_list (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:



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

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

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

Parameters:

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

Options Hash (opts):

  • :marketplace_id (String)

Returns:

See Also:



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

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, *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:



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

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

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

Parameters:

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

Options Hash (opts):

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

Returns:

See Also:



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

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_sku_list, opts = { marketplace_id: marketplace_id }) ⇒ Peddler::XMLParser

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

Parameters:

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

Options Hash (opts):

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

Returns:

See Also:



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

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: 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:



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

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: marketplace_id }) ⇒ Peddler::XMLParser

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

Parameters:

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

Options Hash (opts):

  • :marketplace_id (String)

Returns:

See Also:



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

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



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

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:



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

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

  run
end

#operation_with_marketplace(*args) ⇒ 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.



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

def operation_with_marketplace(*args)
  operation(*args).tap do |opts|
    unless opts.key?('MarketplaceId')
      opts.store('MarketplaceId', marketplace_id)
    end
  end
end