skip to Main Content

Below eBay API call always fails and gives an error

Sorry, the start date or end date was missing or invalid date time
range.

The date format is correct. Any idea why it fails? Request is below

<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
 <S:Header>
  <ebl:RequesterCredentials xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ebl="urn:ebay:apis:eBLBaseComponents" SOAP-ENV:mustUnderstand="0">
   <ebl:eBayAuthToken>my token</ebl:eBayAuthToken>
  </ebl:RequesterCredentials>
 </S:Header>
 <S:Body>
  <GetSellingManagerSoldListingsRequest xmlns="urn:ebay:apis:eBLBaseComponents">
   <Version>921</Version>
   <Archived>true</Archived>
   <Pagination>
    <EntriesPerPage>50</EntriesPerPage>
   </Pagination>
   <SaleDateRange>
    <TimeFrom>2015-02-26T07:05:40.027Z</TimeFrom>
    <TimeTo>2015-03-23T07:05:40.031Z</TimeTo>
   </SaleDateRange>
  </GetSellingManagerSoldListingsRequest>
 </S:Body>
</S:Envelope>

2

Answers


  1. Using this API call, you can fetch records only within 120 days old.

    Your date range is greater than 120 days.You should use Archived flag = true in the api call

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

    Login or Signup to reply.
  2. I think the problem is “TimeTo”
    It can’t be now and have to be in the past. When I tried it it was 2 hours. So maybe it have somthing to do with the time zones.

    This is a full working example with the python api showing me the sales of the last 7 days:

        def get_unshipped(self, days_back=7):
            logger.debug("run get_unshipped()")
            date_from   = "{}.000Z".format(datetime.today() - timedelta(days_back))
            date_to     = "{}.000Z".format(datetime.today() - timedelta(minutes=120))
            api = Trading(config_file=os.path.join(os.path.expanduser("~"), CONFIG_FILE), siteid=EBAY_SITE_ID)
            response = api.execute("GetSellingManagerSoldListings",
                {
                "Archived" : "false",
                "SaleDateRange" : {
                    "TimeFrom" : str(date_from),
                    "TimeTo"   : str(date_to)
                    },
                }
            )
            print "sales found:", len(response.dict()["SaleRecord"])
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search