使用 API 更新 eBay 上的订单状态?
我使用 eBay getorder API 获取订单列表,但现在我想选择一个订单并更新其状态。
我怎样才能做到这一点?请提供任何帮助,我将不胜感激,
我正在使用互联网上的一些代码,它显示更改状态“成功”。但是当我再次加载订单列表时(或者如果我在 API 中使用 shipped=false
),它仍然是“完整”的。
代码:
//create the context
ApiContext context = new ApiContext();
//set the User token
context.ApiCredential.eBayToken = "token";
//set the server url
// context.SoapApiServerUrl = "https://api.sandbox.ebay.com/wsapi";
context.SoapApiServerUrl = "https://api.ebay.com/wsapi";
//enable logging
context.ApiLogManager = new ApiLogManager();
context.ApiLogManager.ApiLoggerList.Add(new FileLogger("log.txt", true, true, true));
context.ApiLogManager.EnableLogging = true;
//set the version
context.Version = "705";
context.Site = SiteCodeType.UK;
//Create the call and set the fields
CompleteSaleCall apicall = new CompleteSaleCall(context);
//Either ItemID-TransactionID or OrderLineItemID or OrderID is required. If item is part of an order, specify OrderID.
apicall.OrderLineItemID = "123467585959-0";
apicall.Shipped = true;
//apicall.Shipment = new ShipmentType();
//apicall.Shipment.ShipmentTrackingDetails = new ShipmentTrackingDetailsTypeCollection();
//ShipmentTrackingDetailsType shpmnt = new ShipmentTrackingDetailsType();
//shpmnt.ShipmentTrackingNumber = "VZ9478668";
//shpmnt.ShippingCarrierUsed = "YourCarrier";
//apicall.Shipment.ShipmentTrackingDetails.Add(shpmnt);
//Specify time in GMT. This is an optional field
//If you don't specify a value for the ShippedTime, it will be defaulted to the time at which the call was made
// apicall.Shipment.ShippedTime = new DateTime(2011, 3, 5, 10, 0, 0).ToUniversalTime();
//call the Execute method
apicall.Execute();
Console.WriteLine(apicall.ApiResponse.Ack);
谢谢
I get a list of orders using eBay getorder API, but now I want to select an order and update its status.
How can I do that? Please, any help would be appreciated
I am using some code off the internet, and it shows "success" on changing the status. But when I load the order list again (or if I use shipped=false
in API) it's still "complete".
Code:
//create the context
ApiContext context = new ApiContext();
//set the User token
context.ApiCredential.eBayToken = "token";
//set the server url
// context.SoapApiServerUrl = "https://api.sandbox.ebay.com/wsapi";
context.SoapApiServerUrl = "https://api.ebay.com/wsapi";
//enable logging
context.ApiLogManager = new ApiLogManager();
context.ApiLogManager.ApiLoggerList.Add(new FileLogger("log.txt", true, true, true));
context.ApiLogManager.EnableLogging = true;
//set the version
context.Version = "705";
context.Site = SiteCodeType.UK;
//Create the call and set the fields
CompleteSaleCall apicall = new CompleteSaleCall(context);
//Either ItemID-TransactionID or OrderLineItemID or OrderID is required. If item is part of an order, specify OrderID.
apicall.OrderLineItemID = "123467585959-0";
apicall.Shipped = true;
//apicall.Shipment = new ShipmentType();
//apicall.Shipment.ShipmentTrackingDetails = new ShipmentTrackingDetailsTypeCollection();
//ShipmentTrackingDetailsType shpmnt = new ShipmentTrackingDetailsType();
//shpmnt.ShipmentTrackingNumber = "VZ9478668";
//shpmnt.ShippingCarrierUsed = "YourCarrier";
//apicall.Shipment.ShipmentTrackingDetails.Add(shpmnt);
//Specify time in GMT. This is an optional field
//If you don't specify a value for the ShippedTime, it will be defaulted to the time at which the call was made
// apicall.Shipment.ShippedTime = new DateTime(2011, 3, 5, 10, 0, 0).ToUniversalTime();
//call the Execute method
apicall.Execute();
Console.WriteLine(apicall.ApiResponse.Ack);
Thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这应该有效:交易 AP 中的 CompleteSaleI
This should work: CompleteSale in Trading API
要将 eBay 订单状态从活动更改为已完成,您可以调用“ReviseCheckoutStatus”API,它对我有用:)
For changing ebay order status from active to completed you can call "ReviseCheckoutStatus" API, it worked for me :)