Newegg Developer Portal

更新商品库存

维护包括美国在内全球所有注册仓库商品的库存信息。

相关URL

Newegg.com: https://api.newegg.com/marketplace/contentmgmt/item/international/inventory?sellerid={sellerid}
Newegg.com: https://api.newegg.com/marketplace/contentmgmt/item/international/inventory?sellerid={sellerid}
Newegg.com: https://api.newegg.com/marketplace/contentmgmt/item/international/inventory?sellerid={sellerid}

注:请确保您的请求URL全都是小写(除Seller ID)并且不能包含任何空格或者换行符。

参数

名称 是否必填? 描述
sellerid 是 您在新蛋商城的商家编号

相关请求信息

HTTP方式 是否需要认证? 请求格式 回复格式 频率限制
POST 需要 XML,Json XML,Json 10,000 请求/小时

请求文件主体

属性 是否必填? 格式 描述
Type 是 Integer 有效值:

  • 0: NE Item#(新蛋商品编号)
  • 1: Seller Part#(商家商品编号)
  • 2: UPC Code(UPC编号)
Value 是 String 指定查询类型的字符串
Condition 否 Integer 有效值:

  • 1. New(全新的)
  • 2. Refurbished(翻新的)
  • 3. Used – Like New(二手-类似新品)
  • 4. Used – Very Good(二手-非常好)
  • 5. Used – Good(二手-好)
  • 6. Used – Acceptable(二手-尚可)

注:当type是[2-UPC code]时,当前值有效;当type不是[2-UPC code]时,当前值会被忽略

WarehouseLocation 是 String 您仓库所在国家的国际标准3位国家编码。
完整国家代码列表,请通过以下链接下载:International Country Guide
注:含有错误值的提交将会报错
AvailableQuantity 是 integer 卖家指定仓库里的商品数量

Schema: UpdateInventoryRequest.xsd

示例:XML,Request

POST https://api.newegg.com/marketplace/contentmgmt/item/international/inventory?sellerid={SellerID}
Authorization: 720ddc067f4d115bd544aff46bc75634
SecretKey: 21EC2020-3AEA-1069-A2DD-08002B30309D
Accept: application/xml
Content-Type: application/xml
<ItemInventoryInfo>
<Type>1</Type>
<Value>A006BSP3</Value>
<InventoryList>
<Inventory>
<WarehouseLocation>USA</WarehouseLocation>
<AvailableQuantity>107</AvailableQuantity>
</Inventory>
<Inventory>
<WarehouseLocation>AUS</WarehouseLocation>
<AvailableQuantity>0</AvailableQuantity>
</Inventory>
</InventoryList>
</ItemInventoryInfo>
POST https://api.newegg.com/marketplace/contentmgmt/item/international/inventory?sellerid={SellerID} Authorization: 720ddc067f4d115bd544aff46bc75634 SecretKey: 21EC2020-3AEA-1069-A2DD-08002B30309D Accept: application/xml Content-Type: application/xml <ItemInventoryInfo> <Type>1</Type> <Value>A006BSP3</Value> <InventoryList> <Inventory> <WarehouseLocation>USA</WarehouseLocation> <AvailableQuantity>107</AvailableQuantity> </Inventory> <Inventory> <WarehouseLocation>AUS</WarehouseLocation> <AvailableQuantity>0</AvailableQuantity> </Inventory> </InventoryList> </ItemInventoryInfo>
POST https://api.newegg.com/marketplace/contentmgmt/item/international/inventory?sellerid={SellerID}
Authorization: 720ddc067f4d115bd544aff46bc75634
SecretKey: 21EC2020-3AEA-1069-A2DD-08002B30309D
Accept: application/xml
Content-Type: application/xml

<ItemInventoryInfo>
    <Type>1</Type>
    <Value>A006BSP3</Value>
    <InventoryList>
        <Inventory>
            <WarehouseLocation>USA</WarehouseLocation>
            <AvailableQuantity>107</AvailableQuantity>
        </Inventory>
        <Inventory>
            <WarehouseLocation>AUS</WarehouseLocation>
            <AvailableQuantity>0</AvailableQuantity>
        </Inventory>
    </InventoryList>
</ItemInventoryInfo>

示例:Json,Request

POST https://api.newegg.com/marketplace/contentmgmt/item/international/inventory?sellerid={SellerID}
Authorization: 720ddc067f4d115bd544aff46bc75634
SecretKey: 21EC2020-3AEA-1069-A2DD-08002B30309D
Accept: application/json
Content-Type: application/json
{
"Type": "1",
"Value": "A006BSP3",
"InventoryList": {
"Inventory": [
{
"WarehouseLocation": "USA",
"AvailableQuantity": "107"
},
{
"WarehouseLocation": "AUS",
"AvailableQuantity": "0"
}
]
}
}
POST https://api.newegg.com/marketplace/contentmgmt/item/international/inventory?sellerid={SellerID} Authorization: 720ddc067f4d115bd544aff46bc75634 SecretKey: 21EC2020-3AEA-1069-A2DD-08002B30309D Accept: application/json Content-Type: application/json { "Type": "1", "Value": "A006BSP3", "InventoryList": { "Inventory": [ { "WarehouseLocation": "USA", "AvailableQuantity": "107" }, { "WarehouseLocation": "AUS", "AvailableQuantity": "0" } ] } }
POST https://api.newegg.com/marketplace/contentmgmt/item/international/inventory?sellerid={SellerID}
Authorization: 720ddc067f4d115bd544aff46bc75634
SecretKey: 21EC2020-3AEA-1069-A2DD-08002B30309D
Accept: application/json
Content-Type: application/json

{
    "Type": "1",
    "Value": "A006BSP3",
    "InventoryList": {
        "Inventory": [
            {
                "WarehouseLocation": "USA",
                "AvailableQuantity": "107"
            },
            {
                "WarehouseLocation": "AUS",
                "AvailableQuantity": "0"
            }
        ]
    }
}

回复文件主体

属性 格式 描述
SellerID String 您的商家编号
ItemNumber String 新蛋分配的商家编号
SellerPartNumber String 商家商品编号
WarehouseLocation String 您仓库所在国家的国际标准3位国家编码。

完整国家代码列表,请通过以下链接下载:International Country Guide

AvailableQuantity Integer 该仓库当前的有效库存数量

Schema: UpdateInventoryResponse.xsd

示例:XML,Response

<?xml version="1.0" encoding="utf-8"?>
<UpdateInventoryResult>
<SellerID>A006</SellerID>
<ItemNumber>9SIA00607Y6476</ItemNumber>
<SellerPartNumber>A006BSP3</SellerPartNumber>
<InventoryList>
<Inventory>
<WarehouseLocation>USA</WarehouseLocation>
<AvailableQuantity>107</AvailableQuantity>
</Inventory>
<Inventory>
<WarehouseLocation>AUS</WarehouseLocation>
<AvailableQuantity>0</AvailableQuantity>
</Inventory>
</InventoryList>
</UpdateInventoryResult>
<?xml version="1.0" encoding="utf-8"?> <UpdateInventoryResult> <SellerID>A006</SellerID> <ItemNumber>9SIA00607Y6476</ItemNumber> <SellerPartNumber>A006BSP3</SellerPartNumber> <InventoryList> <Inventory> <WarehouseLocation>USA</WarehouseLocation> <AvailableQuantity>107</AvailableQuantity> </Inventory> <Inventory> <WarehouseLocation>AUS</WarehouseLocation> <AvailableQuantity>0</AvailableQuantity> </Inventory> </InventoryList> </UpdateInventoryResult>
<?xml version="1.0" encoding="utf-8"?>
<UpdateInventoryResult>
    <SellerID>A006</SellerID>
    <ItemNumber>9SIA00607Y6476</ItemNumber>
    <SellerPartNumber>A006BSP3</SellerPartNumber>
    <InventoryList>
        <Inventory>
            <WarehouseLocation>USA</WarehouseLocation>
            <AvailableQuantity>107</AvailableQuantity>
        </Inventory>
        <Inventory>
            <WarehouseLocation>AUS</WarehouseLocation>
            <AvailableQuantity>0</AvailableQuantity>
        </Inventory>
    </InventoryList>
</UpdateInventoryResult>

示例:Json,Response

{
"SellerID": "A006",
"ItemNumber": "9SIA00607Y6476",
"SellerPartNumber": "A006BSP3",
"InventoryList": {
"Inventory": [
{
"WarehouseLocation": "USA",
"AvailableQuantity": "107"
},
{
"WarehouseLocation": "AUS",
"AvailableQuantity": "0"
}
]
}
}
{ "SellerID": "A006", "ItemNumber": "9SIA00607Y6476", "SellerPartNumber": "A006BSP3", "InventoryList": { "Inventory": [ { "WarehouseLocation": "USA", "AvailableQuantity": "107" }, { "WarehouseLocation": "AUS", "AvailableQuantity": "0" } ] } }
{
    "SellerID": "A006",
    "ItemNumber": "9SIA00607Y6476",
    "SellerPartNumber": "A006BSP3",
    "InventoryList": {
        "Inventory": [
            {
                "WarehouseLocation": "USA",
                "AvailableQuantity": "107"
            },
            {
                "WarehouseLocation": "AUS",
                "AvailableQuantity": "0"
            }
        ]
    }
}

请求失败错误信息

常规HTTP错误回复,请参考回复失败错误代码列表。

错误代码 描述
CT001 Invalid ItemNumber

无效的商品编号

CT002 Invalid SellerPartNumber

无效的 Seller Part #

CT003 Invalid UPCCode

无效的 UPC 编码

CT005 Invalid Action Type. We only support: 0 – NE Item#, 1 – Seller Parts#, 2 – UPC Code

无效的 Action 类型。我们只支持:0 – NE Item#, 1 — Seller Parts#, 2 — UPC Code

CT010 Cannot find item with specified item condition.

找不到指定 condition 的商品

CT014 SellerItemNumber or SellerPartNumber does not exist

SellerItemNumber 或 SellerPartNumber 不存在

CT015 Item does not belong to this seller

该商品不属于这个商家

CT023 Inventory value must be between 0 and 999999

库存值必须在 0 至 999999 之间

CT025 This item is an approved promotion and its minimum inventory cannot be lower than {0}

这个商品正在促销,它的最小库存值不能低于{0}.

CT055 This is a duplicated request for Seller Part #: [seller part #]. This item does not exist in Newegg so we are not able to process your request. We will resume the process of price and inventory update for this item 8 hours after [last failed timestamp].

此请求为 Seller Part #: [seller part #]的重复请求。此商品不存在于 Newegg,因此我们无法处理您的请求。我们将会在[上一次失败的时间]的 8 小时之后重新处理该商品的价格和库存的更新请求。

CT073 The request for item: { SellerPart#} has been processed with error.Country: [country1,country2] Failed reason: The specified warehouse location has not been setup yet. Please set up your warehouse(s) then submit your request again.

商品{ SellerPart#}的请求已处理但有错误。错误原因:指定的仓库所在地没有被设置。请设置您的仓库然后重新提交请求。

示例:XML,Response

<?xml version="1.0" encoding="utf-8"?>
<Errors>
<Error>
<Code>CE003</Code>
<Message> The 'Type' element is invalid - The value 'a' is invalid according to its
datatype 'Int' - The string 'a' is not a valid Int32 value.</Message>
</Error>
</Errors>
<?xml version="1.0" encoding="utf-8"?> <Errors> <Error> <Code>CE003</Code> <Message> The 'Type' element is invalid - The value 'a' is invalid according to its datatype 'Int' - The string 'a' is not a valid Int32 value.</Message> </Error> </Errors>
<?xml version="1.0" encoding="utf-8"?>
<Errors>
    <Error>
        <Code>CE003</Code>
        <Message> The 'Type' element is invalid - The value 'a' is invalid according to its
datatype 'Int' - The string 'a' is not a valid Int32 value.</Message>
    </Error>
</Errors>

示例:Json,Response

{
"Code": "CT002",
"Message": "Invalid SellerPartNumber"
}
{ "Code": "CT002", "Message": "Invalid SellerPartNumber" }
{
    "Code": "CT002",
    "Message": "Invalid SellerPartNumber"
}

更新日期:10/15/2018