-
Notifications
You must be signed in to change notification settings - Fork 4
Merchandising API Class
The Merchandising API provides developers with an easy way to surface available items and products on eBay that provide good value or are otherwise popular with eBay buyers. Shopping portals and widgets can use the API and create applications that engage users with contextually relevant products and items.
use eBay::API::Simple::Merchandising;
my $api = eBay::API::Simple::Merchandising->new( {
appid => 'YOUR_APPID',
} );
$api->execute(
'getMostWatchedItems', { maxResults => 1, categoryId => 267 }
);
if ( $api->has_error() ) {
die "Call Failed:" . $api->errors_as_string();
}
my $dom = $api->response_dom();
my $hash = $api->response_hash();
Place a YAML file in your home or /etc/ directory and reference that filename when constructing the object. The default YAML filename is "ebay.yaml". If you use this name it will automatically get picked up.
my $api = eBay::API::Simple::Merchandising->new( {
config_file => 'myebay.yaml',
} );
my $api = eBay::API::Simple::Merchandising->new( {
domain => 'svcs.sandbox.ebay.com',
appid => 'YOUR_APPID',
} );
Keyword arguments to Merchandising() constructor
domain -- API endpoint (default: svcs.ebay.com)
config_file -- YAML defaults (default: ebay.yaml)
debug -- debugging enabled (default: False)
warnings -- warnings enabled (default: False)
uri -- API endpoint uri (default: /services/search/MerchandisingService/v1)
appid -- eBay application id
siteid -- eBay country site id (default: EBAY-US)
compatibility -- version number (default: 1.0.0)
https -- execute of https (default: False)
proxy_host -- proxy hostname
proxy_port -- proxy port number
timeout -- HTTP request timeout (default: 20)
parallel -- ebaysdk parallel object
response_encoding -- API encoding (default: XML)
request_encoding -- API encoding (default: XML)
Execute the HTTP request.
$api->execute(
'getMostWatchedItems', { maxResults => 1, categoryId => 267 }
);
Returns a string of the HTTP call errors
if ( $api->error() ) {
print "has errors: " . $api->error()
}
Return a DOM object of the HTTP response content.
Return a dictionary of the HTTP response content.
Returns the string content from HTTP response call.
Returns the HTTP response code.
Returns the HTTP response status