Ebay api请求错误代码10009

时间:2018-01-19 22:47:57

标签: python ebay-api

我正在使用Ebay Python SDK 当我运行这段代码时,它会输出错误:

ConnectionError:' VerifyAddFixedPriceItem:Class:RequestError,Severity:Error,Code:10009,No< Item.Currency>存在或< Item.Currency>被指定为空标记。不是< Item.Currency>存在或< Item.Currency>在请求中指定为空标记。,Class:RequestError,Severity:Error,Code:10009,No< Item.Country>存在或< Item.Country>被指定为空标记。不是< Item.Country>存在或< Item.Country>在请求中指定为空标记。,Class:RequestError,Severity:Error,Code:10009,No< Item.ListingDuration>存在或< Item.ListingDuration>被指定为空标记。不是< Item.ListingDuration>存在或< Item.ListingDuration>在请求中指定为空标记。'

我相当肯定我指定了所需的参数,所以不明白为什么我会收到错误。

从代码中: '国家':'美国', '货币':' USD', ' ListingDuration':' GTC',

from ebaysdk.trading import Connection as Trading
api = Trading(domain='api.sandbox.ebay.com', config_file='ebay.yaml')

item = {
        'Title':   'Item Title',
        'Description': ' This is the description for the Item',
        'PrimaryCategory': {'CategoryID': '377'},
        'PrivateListing':     'True',
        'ConditionID':        '1000',
        'Country':            'US',
        'Currency':           'USD',
        'DispatchTimeMax':    '5',
        'ListingDuration':    'GTC',
        'ListingType':        'FixedPriceItem',
        'PaymentMethods':     'PayPal',
        'PayPalEmailAddress': 'xxx@gmail.com',
        'PictureDetails':     {
                                'PictureURL': 'picture_url',
                                'PhotoDisplay': 'SuperSize',
                              },
        'Location':           'Melbourne',
        'ReturnPolicy':     {
                                'ReturnsAcceptedOption': 'ReturnsAccepted',
                                'RefundOption': 'MoneyBack',
                                'ReturnsWithinOption': 'Days_30',
                                'Description': 'If you change your mind, please return your item within 30 days of recieving it for refund.',
                                'ShippingCostPaidByOption': 'Buyer'
                            },

        'ShippingDetails':    {

                            'ShippingType': 'Flat',
                            'ShippingServiceOptions':
                                {
                                    'FreeShipping': 'True',
                                    'ShippingService': 'AU_FastwayCouriers',
                                    'ShippingServiceCost': '0',
                                },
                            'InternationalShippingServiceOption': {
                                'FreeShipping': 'True',
                                'ShippingServiceCost': '0',
                                'ShippingService': 'AU_StandardInternational',
                                'ShippingServiceAdditionalCost': '0',
                                'ShippingServicePriority': '1',
                                'ShipToLocation': 'Worldwide',
                                }
                            }
   }

response = api.execute('VerifyAddFixedPriceItem', item)

print(response.reply)

1 个答案:

答案 0 :(得分:0)

VerifyAddFixedPriceItem的参数应指定为字典,即

response = api.execute('VerifyAddFixedPriceItem', {'item': item})