商品庫存更新

批量更新商品在當地倉庫或者其他區域倉庫的庫存資訊,一個區域只能有一個倉庫。

註:賣家的倉庫設置可在新蛋Seller Portal > 帳戶訊息> 商品運送設定中進行管理。

相關URL

Newegg.com: https://api.newegg.com/marketplace/datafeedmgmt/feeds/submitfeed?sellerid={sellerid}&requesttype={RequestType}

註:請確保您的請求URL全都是小寫(除Seller ID)並且不能包含任何空格或者分行符號。

參數

名稱 是否必填? 描述
sellerid 您在新蛋商城的商家編號
RequestType 值:INVENTORY_DATA

相關請求資訊

HTTP方式 是否需要認證? 請求格式 回覆格式 頻率限制
POST 需要 XML,Json XML,Json 10 請求/分鐘

註:每個文件最多可有10,000條請求記錄。每小時最多100,000條記錄。

請求文件主體

屬性 是否必填? 格式 描述
DocumentVersion Decimal 固定值:2.0
MessageType String 固定值:Inventory
SellerPartNumber String 商家為商品定義的唯一的識別字。包含字母和數位的字串,含空格最多40個字元
註:一旦商品被創建,該資訊是不能修改。
NeweggItemNumber String 新蛋為商品分配的唯一識別碼
WarehouseLocation String 你倉庫所在國家的國際標準3位元國家編碼。
完整國家代碼清單,請通過以下連結下載:International Country Guide
註:提交的請求中若有錯誤值,將會報錯。
FulfillmentOption String 有效值:
Seller 賣家配送
Inventory Integer 商品在賣家指定地點倉庫的庫存數量。

Schema: InventoryUpdate.xsd

示例:XML, Request

POST https://api.newegg.com/marketplace/datafeedmgmt/feeds/submitfeed?sellerid={sellerid}&requesttype=INVENTORY_DATA
Authorization: 720ddc067f4d115bd544aff46bc75634
SecretKey: 21EC2020-3AEA-1069-A2DD-08002B30309D
Content-Type: application/xml
Accept: application/xml

<?xml version="1.0" encoding="UTF-8"?>
<NeweggEnvelope>
    <Header>
        <DocumentVersion>2.0</DocumentVersion>
        <!--The identifier for the very of current feed; assigned by Newegg-->
    </Header>
    <MessageType>Inventory</MessageType>
    <Message>
        <Inventory>
            <Item>
                <SellerPartNumber>a006-test-001</SellerPartNumber>
                <!--A seller-defined unique identifier for an item. An alphanumeric string, max 40 characters including space-->
                <NeweggItemNumber>9SIAWE50008504</NeweggItemNumber>
                <!—Newegg’s unique identifier for an item-->
                <WarehouseLocation>USA</WarehouseLocation>
                <!--The ISO standard 3-digit codes of the country where your warehouse is located. If left blank, default value will be All. -->
                <FulfillmentOption>Seller</FulfillmentOption>
                <!--The shipped by seller inventory in your [xxx] warehouse. -->
                <Inventory>200</Inventory>
                <!--The inventory in seller’s warehouse. -->
            </Item>
        </Inventory>
    </Message>
</NeweggEnvelope>

示例:Json, Request

POST https://api.newegg.com/marketplace/datafeedmgmt/feeds/submitfeed?sellerid={sellerid}&requesttype=INVENTORY_DATA
Authorization: 720ddc067f4d115bd544aff46bc75634
SecretKey: 21EC2020-3AEA-1069-A2DD-08002B30309D
Content-Type: application/json
Accept: application/json

{
    "NeweggEnvelope": {
        "Header": {
            "DocumentVersion": "2.0"
        },
        "MessageType": "Inventory",
        "Message": {
            "Inventory": {
                "Item": {
                    "SellerPartNumber": "a006-test-001",
                    "NeweggItemNumber": "9SIAWE50008504",
                    "WarehouseLocation": "USA",
                    "FulfillmentOption": "Seller",
                    "Inventory": "200"
                }
            }
        }
    }
}

回覆文件主體

屬性 格式 描述
IsSuccess String 獲取文件狀態操作:
True:成功
False:失敗
OperationType String 固定值:SubmitFeedResponse
SellerID String 商家編號
RequestType String 值:INVENTORY_DATA
RequestDate String 文件提交的時間(太平洋標準時間)
RequestStatus String 文件提交的狀態:

SUBMITTED(已提交)

Memo String 附加資訊

Schema: SubmitFeedResponse.xsd

示例:XML, Response

<?xml version="1.0" encoding="utf-8"?>
<NeweggAPIResponse>
    <IsSuccess>true</IsSuccess>
    <OperationType>SubmitFeedResponse</OperationType>
    <SellerID>A006</SellerID>
    <ResponseBody>
        <ResponseList>
            <ResponseInfo>
                <RequestId>2291326430</RequestId>
                <RequestType>INVENTORY_DATA</RequestType>
                <RequestDate>2/16/2012 12:29:19</RequestDate>
                <RequestStatus>SUBMITTED</RequestStatus>
            </ResponseInfo>
        </ResponseList>
    </ResponseBody>
    <Memo />
</NeweggAPIResponse>

示例:Json, Response

{
    "IsSuccess": true,
    "OperationType": "SubmitFeedResponse",
    "ResponseBody": {
        "ResponseList": [
            {
                "RequestDate": "2/22/2012 17:24:35",
                "RequestId": "2PQCX3CMQ82MK",
                "RequestStatus": "SUBMITTED",
                "RequestType": "INVENTORY_DATA"
            }
        ]
    },
    "SellerID": "A006"
}

請求失敗錯誤資訊

常規HTTP錯誤回應,請參考回覆失敗錯誤代碼清單

錯誤代碼 描述
DF003 The MaxCount (maximum request records) CANNOT be over 30000.

最大請求數記錄不能超過30000

DF004 Unfortunately, we are unable to process your request at this time. We apologize for the inconvenience. Please try again later.

很抱歉,目前我們無法處理您的請求。請您稍後再試。

DF011 Your data feed request will not be processed during the scheduled data feed processing restriction from [{begin timestamp:hh:mm:ss, MM/DD/YYYY}] to [{end timestamp:hh:mm:ss, MM/DD/YYYY}]). Please contact datafeeds@newegg.com if you have any question or concern. Thank you for your patience.

在已定的資料處理限制期內,從[{begin timestamp:hh:mm:ss, MM/DD/YYYY}] 到 [{end timestamp:hh:mm:ss, MM/DD/YYYY}],您的資料請求將無法被處理。如您有任何問題或者疑問,請聯繫datafeeds@newegg.com。 感謝您的耐心等待。

示例:XML, Response

<?xml version="1.0" encoding="utf-8"?>
<Errors>
    <Error>
        <Code>DF003</Code>
        <Message>The MaxCount (maximum request records) CANNOT be over 30000</Message>
    </Error>
</Errors>

示例:Json, Response

[
    {
        "Code": "DF003",
        "Message": "The MaxCount (maximum request records) CANNOT be over 30000"
    }
]

更新日期:10/15/2018