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即可。
- public void InventoryChange(ApiContext context, string itemID, string SKU, int quantity)
- {
- try
- {
- var call = new ReviseInventoryStatusCall(context);
- var coll = new InventoryStatusTypeCollection();
- var status = new InventoryStatusType();
- status.ItemID = itemID;
- status.SKU = SKU;
- status.Quantity = quantity;
- //status.StartPrice = new AmountType(); 指定价格
- //status.StartPrice.Value = price;
- coll.Add(status);
- var result = call.ReviseInventoryStatus(coll);
- }
- catch (Exception ex)
- {
- throw new EbayAPIExpcetion(ex.Message, ex.InnerException == null ? ex : ex.InnerException);
- }
- }