Search code examples
phpebay-api

eBay API call to get all sold articles


I'm reading a little bit about the eBay API, but I can't find anything about getting a list with all "open and finished articles" that I am selling.

Is it in the buying API or trading? Could someone help me a little bit where to look? Or some lines of code?

I logged in with

$request = "<?xml version='1.0' encoding='iso-8859-1'?><request>"
   . "<RequestUserId>" . $EBAY_UID . "</RequestUserId>"
   . "<RequestPassword>" . $EBAY_PWD . "</RequestPassword>"
   . "<ErrorLevel>0</ErrorLevel>"
   . "<DetailLevel>0</DetailLevel>"
   . "<SiteId>0</SiteId>"
   . "<Verb>GeteBayOfficialTime</Verb></request>";

$headers[] = "X-EBAY-API-COMPATIBILITY-LEVEL: 305";
$headers[] = "X-EBAY-API-SESSION-CERTIFICATE: ".DEVID.";".APPID.";".CERTID;
$headers[] = "X-EBAY-API-DEV-NAME: ".DEVID;
$headers[] = "X-EBAY-API-APP-NAME: ".APPID;
$headers[] = "X-EBAY-API-CERT-NAME: ".CERTID;
$headers[] = "X-EBAY-API-CALL-NAME: GeteBayOfficialTime";
$headers[] = "X-EBAY-API-SITEID: 0";
$headers[] = "X-EBAY-API-DETAIL-LEVEL: 0";
$headers[] = "Content-Type: text/xml";
$headers[] = "Content-Length: " . strlen($request);

var_dump($header);

$curl = curl_init("https://api.sandbox.ebay.com/ws/api.dll");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_POSTFIELDS, $request);
$result = curl_exec($curl);

to get the eBay time but now I want to get a list with details like my product x was paid on the xx and I received the money on the xx and the price is xx and the person who got the article is called...


Solution

  • To get details about your item sold on eBay:

    You need to get the Trading API and specifically getOrders() operation.