Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sample code for listing a FixedPriceItem with ebay

I'm working with Python 2.7 on a Linux environment, my app working with the ebay trading API with the sdk: ebaysdk-python. My goal is to list a fixedpriceitem, I didn't found a correct way to do it...

It seems the example on the ebay website for the developer isn't working also.

this is what i try :

def AddFixedPriceItem(log,country):

try:
    try:
        t = Connection(config_file='ebay.yaml',debug=True)
    except Exception:
        t = Connection(config_file='../ebay.yaml',debug=True)

    myitem = {
        'ErrorLanguage': 'en_US',
        'WarningLevel': 'High',
        'Item': {
            'PayPalEmailAddress': '[email protected]',
            'ShipToLocations': 'IT',
            'ReservePrice': '0.0',
            'Title': 'TEST AUCTION 1',
            'Description': 'TEST AuCTION 1',
            'ProxyItem': 'false',
            'HitCounter': 'NoHitCounter',
            'BuyerRequirementDetails': {
                'ShipToRegistrationCountry': 'true'
            },
            'Location': 'Lombardia',
            'ReturnPolicy': {
                'ReturnsWithin': '30 giorni',
                'Description': 'Puoi rendere il prodotto che non ti soddisfa entro e non oltre 30 giorni di calendario dalla data di consegna. Ti invitiamo a provare i prodotti senza rimuovere i cartellini e i sigilli oppure rompere la confezione poichè non potranno essere resi articoli che non siano nelle stesse condizioni in cui li hai ricevuti.\n\nVerranno rimborsati solo ed esclusivamente i prodotti effettivamente ricevuti dal magazzino. Nel caso in cui non venissero rispettate le condizioni appena descritte ed eventualmente accertato il difetto, ti informiamo che il pacco reso ti verrà restituito e il rimborso non verrà accreditato.\n\nPer tutte le richieste di autorizzazione al reso pervenute al nostro Servizio Clienti, il reso è gratuito. Nel caso in cui il pacco venga restituito al magazzino senza autorizzazione al reso e senza il tracking da noi fornito, non sarà effettuato alcun rimborso per le spese di reso sostenute.',
                'ShippingCostPaidBy': 'Buyer',
                'ReturnsWithinOption': 'Days_30',
                'ShippingCostPaidByOption': 'Buyer',
                'ReturnsAcceptedOption': 'ReturnsAccepted',
            },
            'BusinessSellerDetails': {
                'LegalInvoice': 'true',
                'Fax': '0',
                'Address': {
                    'FirstName': 'xxx',
                    'CompanyName': 'xxxxxxxxx',
                    'Street1': 'Via delle xxx 26',
                    'CityName': 'xxx della riviera',
                    'CountryName': 'Italia',
                    'Phone': '. .',
                    'LastName': 'xxx',
                    'PostalCode': '25080',
                    'StateOrProvince': 'MI'
                },
                'Email': '[email protected]',
                'VATDetails': {
                    'VATSite': 'IT',
                    'VATID': '0976543233'
                }
            },
            'ListingDuration': 'GTC',
            'PictureDetails': {
                'GalleryType': 'Plus',
                'PhotoDisplay': 'SuperSize',
                'ExternalPictureURL': 'http://ecx.images-amazon.com/images/I/41xZFac6ZsL.jpg'
            },
            'BuyerProtection': 'ItemEligible',
            'StartPrice': '28.99',
            'eBayPlusEligible': 'false',
            'BuyItNowPrice': '0.0',
            'PrimaryCategory': { 'CategoryID': '324' },
            'GetItFast': 'false',
            'ListingType': 'FixedPriceItem',
            'Country': 'IT',
            'HideFromSearch': 'true',
            'ConditionID': '1000',
            'PaymentMethods': 'PayPal',
            #'SecondaryCategory': { 'CategoryID': '324' },
            'AutoPay': 'true',
            'OutOfStockControl': 'true',
            'ReasonHideFromSearch': 'OutOfStock',
            'Quantity': '1',
            'eBayPlus': 'false',
            'DispatchTimeMax': '3',
            'GiftIcon': '0',
            'PostCheckoutExperienceEnabled': 'false',
            'Site': 'Italy',
            'BuyerGuaranteePrice': '20000.0',
            'Currency': 'EUR',
            'HitCount': '8',
            'ConditionDisplayName': 'Nuovo',
            'PrivateListing': 'false',
            'ShippingPackageDetails': {
                'ShippingIrregular': 'false',
                'ShippingPackage': 'None',
                'WeightMajor': '0',
                'WeightMinor': '0'
            },
            'ShippingDetails': {
                'InsuranceFee': '5.0',
                'InternationalShippingDiscountProfileID': '0',
                'ShippingServiceOptions': {
                    'ShippingTimeMax': '2',
                    'ShippingServiceCost': '0.0',
                    'ShippingServicePriority': '1',
                    'ShippingService': 'IT_ExpressCourier',
                    'ExpeditedService': 'true',
                    'ShippingTimeMin': '1'
                },
                'InsuranceDetails': {
                    'InsuranceFee': '5.0',
                    'InsuranceOption': 'Optional'
                },
                'InsuranceOption': 'Optional',
                'ShippingDiscountProfileID': '0',
                'CalculatedShippingRate': {
                    'WeightMinor': '0',
                    'WeightMajor': '0'
                },
                'SellerExcludeShipToLocationsPreference': 'true',
                'ShippingType': 'Flat',
                'SalesTax': {
                    'SalesTaxPercent': '0.0',
                    'ShippingIncludedInTax': 'false'
                },
                'ApplyShippingDiscount': 'false',
                'ThirdPartyCheckout': 'false'
            }
        }
    }

    t.execute('AddFixedPriceItem', myitem)
    #print t.response.dict()
    print t.response.content

except Exception as e:
    pass

This is the error :

2016-07-03 09:20:19,763 ebaysdk [ERROR]:AddFixedPriceItem: Class: RequestError, Severity: Error, Code: 21919303, Manca la specifica delloggetto relativa a {0}. Manca la specifica delloggetto relativa a {0}. Aggiungi {0\} a questa inserzione, inserisci un valore valido e riprova., Class: RequestError, Severity: Error, Code: 21919301, Immetti un valore in \ {0 \} e riprova. In EAN manca un valore. Immetti un valore e riprova.

it looks like they want a EAN field but if i try to put in the json :

...
    'ProductListingDetails':{
                'BrandMPN':{
                    'Brand' : 'TEST BRAND',
                    'MPN' : 'U4162G04311_BLACKC9997'
                },
                'EAN': '8054241786423'
            },
 ...

 ...
    'ReturnPolicy': {
                'ReturnsWithin': '30 giorni',
                'Description': 'Puoi rendere il prodotto che non ti soddisfa entro e non oltre 30 giorni di calendario dalla data di consegna. Ti invitiamo a provare i prodotti senza rimuovere i cartellini e i sigilli oppure rompere la confezione poichè non potranno essere resi articoli che non siano nelle stesse condizioni in cui li hai ricevuti.\n\nVerranno rimborsati solo ed esclusivamente i prodotti effettivamente ricevuti dal magazzino. Nel caso in cui non venissero rispettate le condizioni appena descritte ed eventualmente accertato il difetto, ti informiamo che il pacco reso ti verrà restituito e il rimborso non verrà accreditato.\n\nPer tutte le richieste di autorizzazione al reso pervenute al nostro Servizio Clienti, il reso è gratuito. Nel caso in cui il pacco venga restituito al magazzino senza autorizzazione al reso e senza il tracking da noi fornito, non sarà effettuato alcun rimborso per le spese di reso sostenute.',
                'ShippingCostPaidBy': 'Buyer',
                'EAN': '8054241786423',
                'ReturnsWithinOption': 'Days_30',
                'ShippingCostPaidByOption': 'Buyer',
                'ReturnsAcceptedOption': 'ReturnsAccepted',
            },

Ebay answer with a generic error :

2016-07-03 09:28:26,325 ebaysdk [ERROR]:AddFixedPriceItem: Class: RequestError, Severity: Error, Code: 21919303, Manca la specifica delloggetto relativa a {0}. Manca la specifica delloggetto relativa a {0}. Aggiungi {0\} a questa inserzione, inserisci un valore valido e riprova.

Someone out there can post a full working code written in Python, to publish a fixedpriceitem with the ebaysdk-Python API?

UPDATE :

Based on the answer below i try to include items specifics but the error is still the same, i try also to use the example provided but the error is still the same :

myitem = {
            "Item": {
            'Title': 'Apple MacBook Pro MB990LL/A 13.3 in. Notebook NEW',
            'Description': 'Brand New Apple MacBook Pro MB990LL/A 13.3 in. Notebook!',
            'PrimaryCategory': {'CategoryID' : 111422},
            'StartPrice':3200.0,
            'CategoryMappingAllowed': 'true',
            'ConditionID':1000,

            'Country':'IT',
            'Currency':'EUR',
            'DispatchTimeMax':3,
            'ListingDuration':'Days_7',
            'ListingType':'FixedPriceItem',
            'PaymentMethods':'PayPal',
            'PayPalEmailAddress':'[email protected]',

                'PictureDetails': {
                    'GalleryType': 'Plus',
                    'PhotoDisplay': 'SuperSize',
                    'ExternalPictureURL': 'http://yolo.com/images/I/41xZFac6ZsL.jpg'
                },

                "ItemSpecifics": {
                    "NameValueList": [
                        {"Name": "manufacturer",
                         "Value": info_container["manufacturer"]},
                        {"Name": "manufacturer number",
                         "Value": info_container["manufacturer_part_number"]}]},

            'PostalCode':95125,

            'ProductListingDetails': {
                'BrandMPN': {
                    'Brand': 'TEST BRAND',
                    'MPN': 'U4162G04311_BLACKC9997'
                },
                'EAN': '8054241786423',
                'UPC':885909298594,
                'IncludeStockPhotoURL':'true',
                'IncludeeBayProductDetails':'true',
                'UseFirstProduct':'true',
                'UseStockPhotoURLAsGallery':'true',
                'ReturnSearchResultOnDuplicates':'true'
            },
            'Quantity':6,
            'ReturnPolicy' :{
              'ReturnsAcceptedOption':'ReturnsAccepted',
              'RefundOption':'MoneyBack',
              'ReturnsWithinOption':'Days_30',
              'Description':'If you are not satisfied, return the item for refund.',
              'ShippingCostPaidByOption':'Buyer'
            },
            'ShippingDetails':{
              'ShippingType':'Flat',
              'ShippingServiceOptions':{
                'ShippingServicePriority':1,
                'ShippingService':'IT_ExpressCourier',
                'FreeShipping':'true',
                'ShippingServiceAdditionalCost':0.00
              }
            },
            'Site':'Italy'
        }
    }

ERROR :

2016-07-08 10:46:09,030 ebaysdk [ERROR]:AddFixedPriceItem: Class: RequestError, Severity: Error, Code: 21919303, Manca la specifica delloggetto relativa a {0}. Manca la specifica delloggetto relativa a {0}. Aggiungi {0\} a questa inserzione, inserisci un valore valido e riprova., Class: RequestError, Severity: Error, Code: 21919303, Manca la specifica delloggetto relativa a {0}. Manca la specifica delloggetto relativa a {0}. Aggiungi {0\} a questa inserzione, inserisci un valore valido e riprova.

UPDATE 11-07-2016 :

Unfortunately my bounty (50 points) is ended and not awarded to anyone because there isn't a good answer yet ... at this time i can't do a bounty again because i don't have enough points (to bounty) unfortunately.

I purchase 1 hour on the ebay Premium support (75$ 1 hour ...) , so i will update my question when they will answer ... and i hope to solve the problem ... This question takes many upvote , i am proud of it.

Thanks for your support.

like image 771
ilmetu Avatar asked Jun 30 '16 13:06

ilmetu


People also ask

How do I create a Fixed Price listing on eBay?

The first page of the Sell Your Item form will ask you to choose a format for your item. If you would like to list the item in the new Fixed Price format, just select the "Sell at a Fixed Price" option. You'll specify the Buy It Now price for your item later in the process.

How much does a Fixed Price listing cost on eBay?

There is a non-refundable fee of 5 cents. No additional fees apply for Fixed Price listings. No additional fees apply for Store Items. * For auctions with a Buy It Now price, you can only list one item per auction.

What is the difference between auction and Fixed Price on eBay?

Fixed Price: One Number, One Buyer Just as with auction listings, there's also a final value fee associated with fixed price listings that's set at the same amount. But unlike auction listings, you can bundle multiple items under one listing at a set price.


1 Answers

finally ebay answer to the question and solve the problem.

The call was failing because the mandatory ItemSpecifics Brand(Marca for Italy site) & MPN was missing. It'll work fine if you use the following parameters.

<ItemSpecifics>
  <NameValueList> 
    <Name>Marca</Name>
    <Value>TEST</Value>
  </NameValueList>
  <NameValueList>
    <Name>MPN</Name>
    <Value>00000</Value>
  </NameValueList>
</ItemSpecifics> 

The problem was about the name of the variable , for the italian site the name of the variable "Brand" is "Marca" ...

so for python dictionary in the request:

"ItemSpecifics": {
                    "NameValueList": [
                        {"Name": "Marca",
                         "Value": "TEST"},
                        {"Name": "MPN",
                         "Value": "0000"}
                    ]
                  }

The ebay support team at the moment doesn't have an expert in python but if you can provide the xml for the request they can help. To obtain the real XML with a python sdk you can include in the connection debug = true, example below:

t = Connection(config_file='ebay.yaml',debug=False)

Thanks to everybody for the support.

like image 191
ilmetu Avatar answered Sep 18 '22 20:09

ilmetu