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

v2.0.0 2016-06-19 01:51 UTC


Build Status Latest Stable Version Latest Unstable Version License

PHP Client Library for the Ebay API.


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

// Call to the Trading's AddDispute call
$service = new Earley\Ebay\API\Trading('AddDispute');

// Call to the Trading's AddDispute call with the user token for authentication
$service = new Earley\Ebay\API\Trading('AddDispute','some long token string');

Add Element

Add element to the call.


The call above will produce the following XML document that will be passed to the Trading API.

<?xml version="1.0" encoding="UTF-8"?>
<AddDisputeRequest xmlns="urn:ebay:apis:eBLBaseComponents">

Add Element

This method will allow you to add an array of Elements and Values

$service = new \Earley\Ebay\API\Trading('AddDispute');

$call = array('CallElement' => 'CallValue');

This will produce the same result as above.

Sending API Call

// Send Request
$response = $service->send();

Working with the Response

The response object has a few methods to get the Ebay Response in a few different formats.

// Array
$object = $response->toArray();

// XML
$object = $response->toXml();

// String
$object = $response->toString();

You have a few other methods in order to get other basic information.

// Headers

// HTTP Code

// HTTP Response Phrase

Each service API has one required argument and a optional argument. The first argument is the API's call and the second is the user token that is required for certain calls to the trading API.


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