james_tookey
james_tookey

Reputation: 905

eBay API issues - cannot publish an offer

All of the following is being performed in eBay's API sandbox.

I am attempting to list an item by using the inventory API. Specifically, I have created an inventory item and a relevant offer for that item. When I make a POST request to the publish offer endpoint, I get the following error:

{
   "errors": [
     {
       "errorId": 25016,
       "domain": "API_INVENTORY",
       "subdomain": "Selling",
       "category": "REQUEST",
       "message": "The title value is invalid. Seller Provided Title Value is missing."
     },
     {
       "errorId": 25002,
       "domain": "API_INVENTORY",
       "subdomain": "Selling",
       "category": "REQUEST",
       "message": "A user error has occurred. The duration \"GTC\" day(s) is not available for this listing type, or invalid for category \"49996\".",
       "parameters": [
         {
           "name": "0",
           "value": "GTC"
         },
         {
           "name": "1",
           "value": "49996"
         }
       ]
     }
   ]
 }

I can't see any reference in any of the API documentation to a "Seller Provided Title". The duration error is also confusing as the API says it only supports "GTC" listings. The product has a title so it must be in reference to something else.

My inventory item is as follows:

{
   "sku": "13725",
   "product": {
     "title": "Harley Davidson bike",
     "aspects": {
       "Year": [
         "2016"
       ],
       "Model": [
         "Road Glide Special"
       ],
       "Manufacurer": [
         "Harley-Davidson®"
       ],
       "Type": [
         "Touring"
       ],
       "For Sale By": [
         "Dealer"
       ],
       "Vehicle Title": [
         "Clear"
       ],
       "Mileage": [
         "13393"
       ],
       "VIN (Vehicle Identification Number)": [
         "1HD1KTM10GB627264"
       ],
       "Color": [
         "Black Quartz"
       ]
     },
     "description": "Item description goes here",
     "imageUrls": [
"https://dw4i9za0jmiyk.cloudfront.net/2018/01/12/pre_ic60e5df584b870c3d2a55c86800eede_70618b24eb08.jpg"
     ]
   },
   "condition": "USED_EXCELLENT",
   "availability": {
     "pickupAtLocationAvailability": [
       {
         "quantity": 1,
         "merchantLocationKey": "425",
         "availabilityType": "IN_STOCK",
         "fulfillmentTime": {
           "value": 1,
           "unit": "DAY"
         }
       }
     ]
   }
 }

And my offer object is as follows:

{
   "offerId": "5852159010",
   "sku": "13725",
   "marketplaceId": "EBAY_MOTORS",
   "format": "FIXED_PRICE",
   "availableQuantity": 0,
   "pricingSummary": {
     "price": {
       "value": "18294.0",
       "currency": "USD"
     }
   },
   "listingPolicies": {
     "paymentPolicyId": "5807565000",
     "fulfillmentPolicyId": "5806186000"
   },
   "categoryId": "49996",
   "merchantLocationKey": "425",
   "tax": {
     "applyTax": false
   },
   "status": "UNPUBLISHED",
   "eBayPlusEligible": false
 }

Upvotes: 0

Views: 1851

Answers (1)

Alex Hellier
Alex Hellier

Reputation: 485

I had similar issues on sandbox, and came to the conculsion it was broken. They also have some limits on only certain categories working.

Have you tried it agains the live API, I have found this to be far more reliable, ignoring the fact doing development work live is dangerous!

For your info here is my working code offer:

    inventory_template = {
                "availability": {
                    "shipToLocationAvailability": {
                        "quantity": product.quantity_available
                    }
                },

                "condition": "NEW",
                "product": {
                    "aspects": {spec.name: [spec.value] for spec in product.specifics},
                    "brand": product.product_brand,
                    "description": product.product_description,
                    "imageUrls": [
                        "https://ebay.mydomain.co.uk/{}".format(img.image_link) for img in product.images],
                    "mpn": product.product_mpn,
                    "title": product.product_title,
                    "upc": [
                        product.product_upc,
                    ],
                    "ean": [
                        product.product_ean,
                    ],
                    # "epid": "string"
                },
                "sku": sku,
            }

    offer_body = {
            "availableQuantity": offer.available_quantity,
            "categoryId": offer.category_id,
            "listingDescription": html,
            "listingPolicies": {
                "paymentPolicyId": offer.payment_policy_id,
                "returnPolicyId": offer.return_policy_id,
                "fulfillmentPolicyId": offer.fulfillment_policy_id,
            },
            "merchantLocationKey": offer.merchant_location_key,
            "pricingSummary": {
                "price": {
                    "value": offer.summary_price_value,
                    "currency": offer.summary_price_currency
                }
            },
            "sku": offer.sku,
            "marketplaceId": offer.marketplace_id,
            "format": offer.format
        }

the offer.available_quantity etc are items from my database, its the structure I'm showing.

Upvotes: 2

Related Questions