eBay API - GerOrders not giving any results

125 views Asked by At

I'm trying to figure out why my GetOrders function for the eBay API isn't working. Below are the headers I'm passing (this is in Perl):

$objHeader->push_header('X-EBAY-API-COMPATIBILITY-LEVEL' => $compatabilityLevel);
$objHeader->push_header('X-EBAY-API-DEV-NAME' => $devID);
$objHeader->push_header('X-EBAY-API-APP-NAME' => $appID);
$objHeader->push_header('X-EBAY-API-CERT-NAME' => $certID);
$objHeader->push_header('X-EBAY-API-CALL-NAME' => 'GetOrders');
$objHeader->push_header('X-EBAY-API-SITEID' => '3');
$objHeader->push_header('Content-Type' => 'text/xml');

...and the XML I'm passing is as follows:

<?xml version="1.0" encoding="utf-8" ?>
    <GetOrdersRequest xmlns="urn:ebay:apis:eBLBaseComponents">
    <DetailLevel>ReturnAll</DetailLevel>
    <NumberOfDays>3</NumberOfDays>
    <OrderRole>Seller</OrderRole><OrderStatus>Active</OrderStatus>
    <RequesterCredentials><eBayAuthToken>$userToken</eBayAuthToken></RequesterCredentials>
    </GetOrdersRequest>

(obviously $userToken is replaced with my actual user token)

I get a return from it:

$VAR1 = {
          'xmlns' => 'urn:ebay:apis:eBLBaseComponents',
          'Build' => 'E929_CORE_APIXO_17568878_R1',
          'PageNumber' => '1',
          'PaginationResult' => {
                                'TotalNumberOfPages' => '0',
                                'TotalNumberOfEntries' => '0'
                              },
          'OrderArray' => {},
          'Ack' => 'Success',
          'HasMoreOrders' => 'false',
          'Timestamp' => '2015-06-29T09:49:25.963Z',
          'Version' => '929',
          'ReturnedOrderCountActual' => '0',
          'OrdersPerPage' => '100'
        };

..but as you can see, no results. I know for a fact there are results (I've had it working with the PHP API already using the same kind of values as far as I can tell). Worst case scenario, I could create a basic PHP script to grab the results, and then pipe into the Perl script. Obviously this isn't ideal though (I would much prefer to have it all in one programming language)

Anyone got any ideas? I'm drawing a blank on it :/

1

There are 1 answers

1
Andrew Newby On BEST ANSWER

Ok, I knew this would happen. 2 days of battling with this, and then as soon as I post something - I find the solution :)

The issue was that I was passing the following in the XML:

<OrderStatus>Active</OrderStatus>

It in fact needed to be:

<OrderStatus>Completed</OrderStatus>

That is now grabbing them perfectly :)