rearley/ebay

Provides a method to communicate with eBay's Finding, Shopping and Trading API.

Installs: 5

Dependents: 0

Stars: 2

Watches: 2

Open Issues: 1

Language: PHP

v1.01 2014-06-02 20:15 UTC

README

Build Status Latest Stable Version Latest Unstable Version License

PHP Client Library for the Ebay API.

Services

The client library currently supports the Finding, Shopping and Trading APIs.

// Call a Service
$finding = new \Ebay\Service\Finding();

$shopping = new \Ebay\Service\Shopping();

$trading = new \Ebay\Service\Trading();

// Configure Service
$service
        ->setAppId($appID)
        ->setCallVersion('869')
        ->setCertId($certID)
        ->setDebugMode(true)
        ->setDevId($devID)
        ->setSiteId(0)
        ->setUserToken($userToken);

Request

Once you have configured a service, the next step is to initiate a request. We will use the Trading API GeteBayDetails call as our example.

// Basic Request
$request = new Ebay\Common\Request('GeteBayDetails');

Fields

Each request is made of of one or more fields. A field can have a name, value and attributes.

// Single Field
$request->addField(
        new \Ebay\Common\Field('DetailName','BuyerRequirementDetails')
        );

// Multiple Fields
$request->addFields(array(
        new \Ebay\Common\Field('DetailName','BuyerRequirementDetails')
        ));

Send Request

The last step to sending a request is the service's makeRequest method.

$response = $service->makeRequest($request);

TODO

  • More detailed documentation
  • Unit Testing Completion
  • Other Ebay API Calls