NAME

eBay::API::Simple::Trading

SYNPOSIS

my $call = eBay::API::Simple::Trading->new();
$call->execute( 'GetSearchResults', { Query => 'shoe' } );

if ( $call->has_error() ) {
   die "Call Failed:" . $call->errors_as_string();
}

# getters for the response DOM or Hash
my $dom  = $call->response_dom();
my $hash = $call->response_hash();

print $call->nodeContent( 'Timestamp' );

my @nodes = $dom->findnodes(
  '//Item'
);

foreach my $n ( @nodes ) {
  print $n->findvalue('Title/text()') . "\n";
}

new

Constructor for the Trading API call

my $call = ebay::API::Simple::Trading->new();
$call->execute( 'GetSearchResults', { Query => 'shoe' } );

my $call = ebay::API::Simple::Trading->new( {
  siteid  => 0,              # custom site id
  uri     => '/ws/api.dll',  # custom uri
  appid   => 'myappid',
  devid   => 'mydevid',
  certid  => 'mycertid',
  version => '518',     # custom version
  https   => 1,         # 0 or 1
  domain  => 'open.api.ebay.com' # custom domain
} );

Defaults:

siteid  = 0
uri     = /ws/api.dll
domain  = open.api.ebay.com
version = 543
https   = 1

devid   = undef
appid   = undef
certid  = undef
token   = undef

ebay.ini

The constructor will fallback to the ebay.ini file to get any missing credentials. The following files will be checked, ./ebay.ini, ~/ebay.ini, /etc/ebay.ini which are in the order of precedence.

# your developer key
DeveloperKey=KLJHAKLJHLKJHLKJH

# your application key
ApplicationKey=LJKGHKLJGKJHG

# your certificate key
CertificateKey=SUYTYWTKWTYIUYTWIUTY

# your token (a very BIG string)
Token=JKHGHJGJHGKJHGKJHGkluhsdihdsriuhfwe87yr8wehIEWH9O78YWERF90HF9UHJESIPHJFV94Y4089734Y

execute( $verb, $call_data )

Calling this method will make build and execute the api request.

$verb      = call verb, i.e. GetSearchResults
$call_data = hashref of call_data that will be turned into xml.

$call->execute( 'GetSearchResults', { Query => 'shoe' } );

_validate_response

This is called from the base class. The method is suppose to provide the custom validation code and push to the error stack if the response isn't valid

_get_request_body

This method supplies the request body for the Shopping API call

_get_request_headers

This method supplies the headers for the Shopping API call

_get_request_object

This method creates the request object and returns to the parent class

AUTHOR

Tim Keefer <tim@timkeefer.com>

CONTRIBUTOR

Jyothi Krishnan