Search code examples
phpebay-api

eBay API GetOrdersRequest not showing Items awaiting Payment


Here is the XML I'm calling into ebay. I get all completed items except for those completed without a payment (which I've read I should be getting back).

I'd much rather have a method that only calls "Awaiting Payment", "Awaiting Shipping", "Shipped". If that is possible, I'm not aware of it from my research. I'm currently gathering all Completed for n days and filtering them out myself

Endpoint:

https://api.ebay.com/ws/api.dll

XML:

<?xml version='1.0' encoding='utf-8'?>
<GetOrdersRequest xmlns='urn:ebay:apis:eBLBaseComponents'>
<RequesterCredentials>
<eBayAuthToken>$requestToken</eBayAuthToken>
</RequesterCredentials>
<OrderRole>Seller</OrderRole>
<OrderStatus>Completed</OrderStatus>
<Pagination>
<EntriesPerPage>100</EntriesPerPage>
<PageNumber>$page</PageNumber>
</Pagination>
<NumberOfDays>7</NumberOfDays>
<ErrorLanguage>en_US</ErrorLanguage>
<Version>823</Version>
<WarningLevel>High</WarningLevel>
</GetOrdersRequest>

Logic on sorting out:

foreach($orderArray as $order)
  {
    $paidTime = (isset($order['PaidTime']) ? $order['PaidTime'] : '');
    $shippedTime = (isset($order['ShippedTime']) ? $order['ShippedTime'] : '');
    if($paidTime != "" ){
      if($shippedTime == "")
        array_push($itemPaidNotShipped,$order);
      else
        array_push($itemPaidShipped,$order);
    }else{
      array_push($itemNotPaidNotShipped,$order);
    }
  }

Edit after accepted Answer, here is my sorting logic:

foreach($orderArray as $order){
    $paidTime = (isset($order['PaidTime']) ? $order['PaidTime'] : '');
    $shippedTime = (isset($order['ShippedTime']) ? $order['ShippedTime'] : '');
    $orderStatus = (isset($order['OrderStatus']) ? $order['OrderStatus'] : '');
    if($orderStatus != "" && $orderStatus != 'Cancelled'){
      if($paidTime != "" ){
        if($shippedTime == "")
          array_push($itemPaidNotShipped,$order);
        else
          array_push($itemPaidShipped,$order);
      }else{
        array_push($itemNotPaidNotShipped,$order);
      }
    }
  }

Solution

  • I believe OrderStatus of Completed returns paid orders. You can leave out OrderStatus to receive all orders regardless of status or request Active to get unpaid orders.

    If you are a Selling Manager Pro subscriber, you can use the GetSellingManagerSoldListings call

    http://developer.ebay.com/Devzone/xml/docs/Reference/ebay/GetSellingManagerSoldListings.html

    It has a filter field

    <Filter> SellingManagerSoldListingsPropertyTypeCodeType </Filter>
    

    You can find the values here

    http://developer.ebay.com/Devzone/xml/docs/Reference/ebay/extra/GtSllngMngrSldLstngsRqst.Fltr.html

    I use the GetOrders call; the GetSellingManagerSoldListings call includes the following:

    Note: This call is subject to change without notice; the deprecation process is inapplicable to this call.