Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
282 views
in Technique[技术] by (71.8m points)

python 3.x - GetMyeBaySelling API does not return Unsold items even though they exist

Please bear with me because I'm new to eBay APIs but basically I'm trying to:

  • Get a list of item IDs which are Active
  • Get a list of item IDs which are Unsold

So the problem is pretty straightforward and I'm currently using the GetMyeBaySelling API call with an XML input that looks like this:

<?xml version="1.0" encoding="utf-8"?>
<GetMyeBaySellingRequest xmlns="urn:ebay:apis:eBLBaseComponents">
    <RequesterCredentials>
        <eBayAuthToken>{eBayAuthToken}</eBayAuthToken>
    </RequesterCredentials>
    <DetailLevel>ReturnAll</DetailLevel>
</GetMyeBaySellingRequest> 

Again, very simple. I understand that I will get the list of all Active items, the list of all Unsold/Sold items, etc. because I've set the <DetailLevel> field to ReturnAll in the input XML above

The problem is that for some reason, for one account that I'm testing this call on, it doesn't return the list of unsold items, as in, it doesn't return the container in the XML response, I'm talking about this one:

<UnsoldList> .... </UnsoldList> 

This is weird because that one particular eBay account has more than 20 unsold items in it

Now this is where things get really weird, if I tested the API call on other eBay accounts, it works just fine and returns the list of all Unsold items with no problem ??

Did I do something wrong here or is there some kind of bug in this eBay API call?

question from:https://stackoverflow.com/questions/65951797/getmyebayselling-api-does-not-return-unsold-items-even-though-they-exist

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

SOLVED!

It turns out that we have to specify

<DurationInDays>{numberOfDays}</DurationInDays>

Where {numberOfDays} is an integer value which represents how far back in the past do the unsold listings we want to extract have to be?

In this case, we can specify 60, which is the maximum number of days accepted by the GetMyeBaySelling API to indicate that we want all unsold listings which ended within the past 60 days.

So what happened was that on this one particular account, all of the unsold listings ended on 5th of December 2020. Whatever the default {numberOfDays} for DurationInDays value set by eBay is, it's clearly not big enough to cover these listings which ended on 5th of December 2020. Hence, by specifying it to 60 days, I got all of the unsold listings just fine :)

So for whoever out there who's facing a similar problem, remember this field, it could very well fix the problem that you have (if it's anything similar to mine).


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...