eBay 使用ReviseInventoryStatusCall调整库存和价格

 

 

1.简介

 

针对Fixed-Price的Item,其Inventory Revise和Price Revise可以使用接口ReviseInventoryStatusCall来完成。

其使用非常简单,ItemID为必填(如果使用SKU方式的话,见"参考帖子")。之后,只需指定了Quantity就可以修改库存,指定了StartPrice就可以修改价格,真的是轻量好用!

 

参考帖子:

http://community.ebay.cn/thread-1200162924-1-1.html#userconsent#

 

2.Usage

针对多SKU的Item,则需同时指定Item和SKU即可。

  1. public void InventoryChange(ApiContext context, string itemID, string SKU, int quantity)
  2. {
  3.     try
  4.     {
  5.         var call = new ReviseInventoryStatusCall(context);
  6.  
  7.         var coll = new InventoryStatusTypeCollection();
  8.         var status = new InventoryStatusType();
  9.         status.ItemID = itemID;
  10.         status.SKU = SKU;
  11.         status.Quantity = quantity;
  12. //status.StartPrice = new AmountType(); 指定价格
  13. //status.StartPrice.Value = price;
  14.         coll.Add(status);
  15.  
  16.         var result = call.ReviseInventoryStatus(coll);
  17.     }
  18.     catch (Exception ex)
  19.     {
  20.         throw new EbayAPIExpcetion(ex.Message, ex.InnerException == null ? ex : ex.InnerException);
  21.     }
  22. }

 

 

 

posted @ 2015-06-17 14:50  _DN  阅读(824)  评论(0编辑  收藏  举报