2012-01-02 31 views
5

我使用eBay getorder API獲取訂單列表,但現在我想選擇訂單並更新其狀態。使用API​​在ebay上更新訂單狀態?

我該怎麼做?請,任何幫助,將不勝感激

我使用一些代碼在互聯網上,它顯示「成功」更改狀態。但是,當我再次加載訂單時,它仍然是「完整的」(或者如果我在api中使用shipment = 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); 

謝謝

+0

你試過API的completeSale方法嗎? – 2012-01-03 05:51:54

+0

嗨,是的,謝謝你,我使用completessale方法:)我可以改變訂單狀態付費,並批量發貨now.But一件事爲什麼仍然當我getorder usingapi orderstatus =活動?它不應該改變爲運輸或支付等? – ehsankayani 2012-01-03 10:07:01

+0

它應該返回最新狀態。你是否得到了應對完成的緊急情況? – 2012-01-04 05:14:09

回答

1

從Active改變eBay的訂單狀態來完成,你可以稱之爲 「ReviseCheckoutStatus」 API,它爲我工作:)