首页 > 解决方案 > eBay API 问题 - 无法发布报价

问题描述

以下所有操作都在 eBay 的 API 沙箱中执行。

我正在尝试使用库存 API 列出项目。具体来说,我创建了一个库存项目和该项目的相关报价。当我向发布提议端点发出 POST 请求时,我收到以下错误:

{
   "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"
         }
       ]
     }
   ]
 }

我在任何 API 文档中都看不到对“卖方提供的标题”的任何引用。持续时间错误也令人困惑,因为 API 说它只支持“GTC”列表。该产品有一个标题,所以它必须参考其他东西。

我的库存项目如下:

{
   "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"
         }
       }
     ]
   }
 }

而我的offer对象如下:

{
   "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
 }

标签: ebay-api

解决方案


我在沙盒上遇到了类似的问题,并得出结论它被打破了。他们也有一些限制只对某些类别起作用。

您是否再次尝试过实时 API,我发现这要可靠得多,忽略实时进行开发工作是危险的事实!

为了您的信息,这里是我的工作代码报价:

    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
        }

等是我数据库中的offer.available_quantity项目,它是我展示的结构。


推荐阅读