eBay API Get Orders: To get the ebay sales order data from via api call. First you have an ebay developer account access. Get your ebay access token from ebay developer account and dev id, app id, cert id.
Wsdl for getting ebay order data : http://developer.ebay.com/webservices/latest/ebaySvc.wsdl
This api call belong to Ebay Trading section. Use “GetOrders“ ebay api method to gat order data.
Create Ebay API Get Orders API Call:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
<?php function print_d($array){ echo "<pre>\n"; print_r($array); echo "</pre>\n";} $mytoken = "Use ebay access token here"; $devId = "**********Use Dev Id Here**********"; $appId = "**********Use App Id here**********"; $certId = "********* Use Cert Id Here***********"; $wsdl_url = 'http://developer.ebay.com/webservices/latest/ebaySvc.wsdl'; $apiCall = "GetOrders"; $credentials = array('AppId' => $appId, 'DevID' => $devId, 'AuthCert' => $certId); $client = new SOAPClient($wsdl_url, array('trace' => 1, 'exceptions' => 0, 'location' => "https://api.ebay.com/wsapi?callname=$apiCall&appid=$appId&siteid=0&version=803&Routing=new")); $eBayAuth = array('eBayAuthToken' => new SoapVar($mytoken, XSD_STRING, NULL, NULL, NULL, 'urn:ebay:apis:eBLBaseComponents'), 'Credentials' => new SoapVar ($credentials, SOAP_ENC_OBJECT, NULL, NULL, NULL, 'urn:ebay:apis:eBLBaseComponents')); $header_body = new SoapVar($eBayAuth, SOAP_ENC_OBJECT); $header = array(new SOAPHeader('urn:ebay:apis:eBLBaseComponents', 'RequesterCredentials', $header_body)); //set the API call parameters $params = array('Version' => 803, 'CreateTimeFrom'=>'2014-03-18T01:01:02.768Z', 'CreateTimeTo'=>'2014-03-20T01:01:02.768Z', 'OrderRole'=>'Seller'); $request = $client->__soapCall($apiCall, array($params), NULL, $header); //make the actual API call print_d($request); |
In above code we get seller order data as API response. As you see in the parameter we put “OrderRole” to Seller. You can change as per requirement like Buyer.
We can fetch order on the basis of CreateTimeFrom to CreateTimeTo basis. Their are many other filtration parameters available on ebay trading api documentation.
Hi My question is how can i get $devId Dev Id $appId $certId by API have you any suggestion. please give me url
Hi Jitendra,
You must have ebay developer account to getting these keys. Follow this link, it will help you. https://developer.ebay.com/devzone/guides/ebayfeatures/Basics/Call-DevelopmentKeys.html
Thanks