Class: Ebay::Merchandising

Inherits:
Object
  • Object
show all
Includes:
Requestable
Defined in:
lib/ebay/merchandising.rb

Overview

Retrieves information about products or item listings on eBay to help you sell more merchandise to eBay buyers

Instance Attribute Summary collapse

Attributes included from Requestable

#endpoint, #headers, #http

Instance Method Summary collapse

Methods included from Requestable

#market_id=, #persistent, #sandbox, #use, #via

Constructor Details

#initialize(consumer_id: Config.app_id, global_id: nil, response_data_format: nil, service_version: nil) ⇒ Merchandising

Returns a Finding API request instance

Parameters:

  • consumer_id (String) (defaults to: Config.app_id)
  • global_id (String) (defaults to: nil)
  • response_data_format (String) (defaults to: nil)
  • service_version (String) (defaults to: nil)


41
42
43
44
45
46
47
# File 'lib/ebay/merchandising.rb', line 41

def initialize(consumer_id: Config.app_id, global_id: nil,
               response_data_format: nil, service_version: nil)
  @consumer_id = consumer_id
  @global_id = global_id
  @response_data_format = response_data_format
  @service_version = service_version
end

Instance Attribute Details

#consumer_idString (readonly)

Returns:

  • (String)


24
25
26
# File 'lib/ebay/merchandising.rb', line 24

def consumer_id
  @consumer_id
end

#global_idString (readonly)

Returns:

  • (String)


27
28
29
# File 'lib/ebay/merchandising.rb', line 27

def global_id
  @global_id
end

#response_data_formatString (readonly)

Returns:

  • (String)


30
31
32
# File 'lib/ebay/merchandising.rb', line 30

def response_data_format
  @response_data_format
end

#service_versionString (readonly)

Returns:

  • (String)


33
34
35
# File 'lib/ebay/merchandising.rb', line 33

def service_version
  @service_version
end

Instance Method Details

#get_most_watched_items(payload = {}) ⇒ HTTP::Response

Retrieves data for items with the highest watch count

Parameters:

  • payload (Hash) (defaults to: {})

Returns:

  • (HTTP::Response)


53
54
55
# File 'lib/ebay/merchandising.rb', line 53

def get_most_watched_items(payload = {})
  request('getMostWatchedItems', payload)
end

Retrieves recommended items from categories related to a specified category or item

Parameters:

  • payload (Hash) (defaults to: {})

Returns:

  • (HTTP::Response)


62
63
64
# File 'lib/ebay/merchandising.rb', line 62

def get_related_category_items(payload = {})
  request('getRelatedCategoryItems', payload)
end

#get_similar_items(item_id, payload = {}) ⇒ HTTP::Response

Retrieves items that are similar to the specified item

Parameters:

  • item_id (String)
  • payload (Hash) (defaults to: {})

Returns:

  • (HTTP::Response)


71
72
73
74
# File 'lib/ebay/merchandising.rb', line 71

def get_similar_items(item_id, payload = {})
  payload = payload.merge('itemId' => item_id)
  request('getSimilarItems', payload)
end

#get_versionHTTP::Response

Returns the current service version

Returns:

  • (HTTP::Response)


79
80
81
# File 'lib/ebay/merchandising.rb', line 79

def get_version
  request('getVersion')
end