PDA

View Full Version : Has anyone used the V API to update order status



supercool
10-04-2012, 06:01 AM
I have custom service that uses the V API to retrieve orders that have been marked for ready to ship.
After downloading the orders and sending it to the warehouse, I need the order status to change to Pending Shipment. The generic update method to the orders table comes back with an error stating that the orders table only supports inserts. I don't want to insert but essentially update the status so that it will save me time to go to each order and update that plus it removes errors in the work flow. can anyone help or state their V API experience which has obscured documentation.
Here is the test snippet.

string[] orderNumbers = orderIds.Split(',');
string orderXML = "";
string APIURL = Utils.GetAPIPostURL(ImportMode.Update, chkPreProd.Checked);
XMLPostManager manager = new XMLPostManager();

StringBuilder sb = new StringBuilder();
sb.Append("<?xml version=\"1.0\" encoding=\"utf-8\" ?>");
sb.Append("<xmldata>");
foreach (string item in orderNumbers)
{

sb.Append("<Orders>");
sb.Append("<OrderID>" + item + "</OrderID>");
sb.Append("<OrderStatus>" + "Pending Shipment" + "</OrderStatus>");
sb.Append("</Orders>");

}

sb.Append("</xmldata>");

orderXML = sb.ToString();

string response = manager.SendXMLToURL(APIURL, orderXML);
MessageBox.Show(response);

Thanks.

Super :cool:

veronica_mp
12-12-2013, 12:55 PM
Was this ever resolved?

Marc_NY
07-05-2015, 06:04 PM
I realize this is close to 3 years old but I just want to state that this is possible but not in the manner in which the OP suggested. You would need to run an SQL update query via a custom ASP page.