使用 API 更新 eBay 上的订单状态?

发布于 2024-12-25 01:52:05 字数 1886 浏览 1 评论 0原文

我使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

孤者何惧 2025-01-01 01:52:05

要将 eBay 订单状态从活动更改为已完成,您可以调用“ReviseCheckoutStatus”API,它对我有用:)

For changing ebay order status from active to completed you can call "ReviseCheckoutStatus" API, it worked for me :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文