Class: Ebay::Shopping
- Inherits:
-
Object
- Object
- Ebay::Shopping
- Includes:
- Requestable
- Defined in:
- lib/ebay/shopping.rb
Overview
The eBay Shopping API makes it easy to search for things on eBay.
Instance Attribute Summary collapse
- #affiliate_user_id ⇒ String readonly
- #app_id ⇒ String readonly
- #response_encoding ⇒ String readonly
- #site_id ⇒ String readonly
- #tracking_id ⇒ String readonly
- #tracking_partner_code ⇒ String readonly
- #version ⇒ String readonly
- #version_handling ⇒ String readonly
Attributes included from Requestable
Instance Method Summary collapse
-
#find_products(payload = {}) ⇒ HTTP::Response
Returns one or more eBay catalog products based on a query string or product ID value.
-
#get_category_info(category_id, payload = {}) ⇒ HTTP::Response
Retrieves high-level data for a specified eBay category.
-
#get_ebay_time(payload = {}) ⇒ HTTP::Response
Gets the official eBay system time in GMT.
-
#get_item_status(*item_ids, payload = {}) ⇒ HTTP::Response
Retrieves the current status of up to 20 eBay listings.
-
#get_multiple_items(*item_ids, payload = {}) ⇒ HTTP::Response
Retrieves publicly available data for one or more listings.
-
#get_shipping_costs(item_id, payload = {}) ⇒ HTTP::Response
Gets shipping costs for a listing.
-
#get_single_item(item_id, payload = {}) ⇒ HTTP::Response
Gets publicly visible details about one listing.
-
#get_user_profile(user_id, payload = {}) ⇒ HTTP::Response
Retrieves user information.
-
#initialize(app_id: Config.app_id, response_encoding: nil, site_id: nil, version: '1119', version_handling: nil, tracking_id: nil, tracking_partner_code: nil, affiliate_user_id: nil) ⇒ Shopping
constructor
Returns a Finding API request instance.
Methods included from Requestable
#market_id=, #persistent, #sandbox, #use, #via
Constructor Details
#initialize(app_id: Config.app_id, response_encoding: nil, site_id: nil, version: '1119', version_handling: nil, tracking_id: nil, tracking_partner_code: nil, affiliate_user_id: nil) ⇒ Shopping
Returns a Finding API request instance
56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/ebay/shopping.rb', line 56 def initialize(app_id: Config.app_id, response_encoding: nil, site_id: nil, version: '1119', version_handling: nil, tracking_id: nil, tracking_partner_code: nil, affiliate_user_id: nil) @app_id = app_id @response_encoding = response_encoding @site_id = site_id @version = version @version_handling = version_handling @tracking_id = tracking_id @tracking_partner_code = tracking_partner_code @affiliate_user_id = affiliate_user_id end |
Instance Attribute Details
#affiliate_user_id ⇒ String (readonly)
44 45 46 |
# File 'lib/ebay/shopping.rb', line 44 def affiliate_user_id @affiliate_user_id end |
#app_id ⇒ String (readonly)
23 24 25 |
# File 'lib/ebay/shopping.rb', line 23 def app_id @app_id end |
#response_encoding ⇒ String (readonly)
26 27 28 |
# File 'lib/ebay/shopping.rb', line 26 def response_encoding @response_encoding end |
#site_id ⇒ String (readonly)
29 30 31 |
# File 'lib/ebay/shopping.rb', line 29 def site_id @site_id end |
#tracking_id ⇒ String (readonly)
38 39 40 |
# File 'lib/ebay/shopping.rb', line 38 def tracking_id @tracking_id end |
#tracking_partner_code ⇒ String (readonly)
41 42 43 |
# File 'lib/ebay/shopping.rb', line 41 def tracking_partner_code @tracking_partner_code end |
#version ⇒ String (readonly)
32 33 34 |
# File 'lib/ebay/shopping.rb', line 32 def version @version end |
#version_handling ⇒ String (readonly)
35 36 37 |
# File 'lib/ebay/shopping.rb', line 35 def version_handling @version_handling end |
Instance Method Details
#find_products(payload = {}) ⇒ HTTP::Response
Returns one or more eBay catalog products based on a query string or product ID value
75 76 77 |
# File 'lib/ebay/shopping.rb', line 75 def find_products(payload = {}) request('FindProducts', payload) end |
#get_category_info(category_id, payload = {}) ⇒ HTTP::Response
Retrieves high-level data for a specified eBay category
84 85 86 87 |
# File 'lib/ebay/shopping.rb', line 84 def get_category_info(category_id, payload = {}) payload = payload.merge('CategoryID' => category_id) request('GetCategoryInfo', payload) end |
#get_ebay_time(payload = {}) ⇒ HTTP::Response
Gets the official eBay system time in GMT
93 94 95 |
# File 'lib/ebay/shopping.rb', line 93 def get_ebay_time(payload = {}) request('GeteBayTime', payload) end |
#get_item_status(*item_ids, payload = {}) ⇒ HTTP::Response
Retrieves the current status of up to 20 eBay listings
103 104 105 106 107 |
# File 'lib/ebay/shopping.rb', line 103 def get_item_status(*item_ids) payload = item_ids.last.is_a?(Hash) ? item_ids.pop : {} payload = payload.merge('ItemID' => item_ids.map(&:to_s)) request('GetItemStatus', payload) end |
#get_multiple_items(*item_ids, payload = {}) ⇒ HTTP::Response
Retrieves publicly available data for one or more listings
115 116 117 118 119 120 |
# File 'lib/ebay/shopping.rb', line 115 def get_multiple_items(*item_ids) payload = item_ids.last.is_a?(Hash) ? item_ids.pop : {} payload = payload.merge('ItemID' => item_ids.map(&:to_s)) request('GetMultipleItems', payload) end |
#get_shipping_costs(item_id, payload = {}) ⇒ HTTP::Response
Gets shipping costs for a listing
127 128 129 130 |
# File 'lib/ebay/shopping.rb', line 127 def get_shipping_costs(item_id, payload = {}) payload = payload.merge('ItemID' => item_id) request('GetShippingCosts', payload) end |
#get_single_item(item_id, payload = {}) ⇒ HTTP::Response
Gets publicly visible details about one listing
137 138 139 140 |
# File 'lib/ebay/shopping.rb', line 137 def get_single_item(item_id, payload = {}) payload = payload.merge('ItemID' => item_id) request('GetSingleItem', payload) end |
#get_user_profile(user_id, payload = {}) ⇒ HTTP::Response
Retrieves user information
147 148 149 150 |
# File 'lib/ebay/shopping.rb', line 147 def get_user_profile(user_id, payload = {}) payload = payload.merge('UserID' => user_id) request('GetUserProfile', payload) end |