我正在使用eBay SDK下的Trading API提取订单ID:
from ebaysdk.trading import Connection as Trading
from ebaysdk.exception import ConnectionError
myAppId = "myAppID"
myDevId = "myDevID"
myCertId = "myDertID"
username = "myusername"
authToken = "myauthtoken"
api = Trading(config_file=None, appid=myAppId, devid=myDevId, certid=myCertId)
order_days = 30
orderdata_levelone = api.execute('GetOrders',{'NumberOfDays': order_days })
SellingManagerSalesRecordNumber_allorders = []
i = 0
while i < len(orderdata_levelone.reply.OrderArray.Order):
SellingManagerSalesRecordNumber_allorders.append(orderdata_levelone.reply.OrderArray.Order[i].ShippingDetails.SellingManagerSalesRecordNumber)
i = i + 1
print ("The order numbers are")
for order_num in SellingManagerSalesRecordNumber_allorders:
print (order_num)
这将返回三个订单号; 1092、1097和1088。与此有关的有两个问题:
(1)我的理解是,从我执行API的那一行中,我将提取过去30天内的所有订单。但是最近30天内我的测试帐户没有任何销售。
(2)给出的订单号之间有订单(可以预期,因为上面的订单号不是连续的);但是执行上述API不会返回这些订单。
我的理解或代码有什么错误?