dangdang.custom.stock.update

通过商家标识符更新库存

  • 此接口用于修改一个商品的库存

    支持的数据格式:XML

    HTTP请求方式:POST

  • 系统级输入参数:

    请参考系统级输入参数

    应用级输入参数:

    参数名称
    参数类型
    是否必填
    示例值
    参数说明
    gShopID Number 489 店铺ID
    out_id String as23s 商品外部编码
    stock Number 123 库存:0-999999

  • XML数据格式:

    01 <?xml version="1.0" encoding="GBK"?>
    02 <response>
    03 <result>true</result>
    04 <resultCode>0</ resultCode>
    05 <resultMessage>请求成功</resultMessage>
    06 <item>   
    07     <item_id>1012284020</item_id>
    08     <stock>1</stock >
    09 </item>
    10 <response>

    JSON数据格式:

    01 {
    02   "response": {
    03     "result""true",
    04     "resultCode""0",
    05     "resultMessage""请求成功",
    06     "item": {
    07       "item_id""1012284020",
    08       "stock""1"
    09     }
    10   }
    11 }

  • java版

    SdkClient sdkClient= new SdkClient(appKey, appSecret, session, version) ;
    PublicationCustomStockUpdateRequest request=new PublicationCustomStockUpdateRequest();
    PublicationCustomStockUpdate stockUpdateReq=new PublicationCustomStockUpdate();
    stockUpdateReq.setOut_id("1234abc");
    stockUpdateReq.setStock(11L);
    request.setStockUpdateReq(stockUpdateReq);
    PublicationItemStockUpdateResponse response =sdkClient.excute(request);
    System.out.println(response.toString());


    php版
    $sdkClient = new DDHttpClient(appKey,appSecret,session)
    $PublicationCustomStockUpdateRequest = new PublicationCustomStockUpdateRequest();
    $PublicationCustomStockUpdateRequest->setOutId("98765");
    $sdkResponse = $sdkClient->execute($PublicationCustomStockUpdateRequest);