API Support Forum
OEC API > API Support > ModifyOrder help
Author Topic: ModifyOrder help
(3 messages, Page 1 of 1)
Moderators: VPfau
bouldermelton
Posts: 2
Joined: Mar 06, 2009


Posted: Mar 06, 2009 @ 12:25 PM             Msg. 1 of 3
I'm trying to use the modifyOrder feature of the API, but can't figure out how this is tied to the "existing" order in any way. There does not seem to be an example of this either in the 2 online examples, does it work? Could someone post a snippet of code that uses modifyOrder?
SergeK
-Developer-
Posts: 475
Joined: Jan 26, 2007


Posted: Mar 06, 2009 @ 12:39 PM             Msg. 2 of 3
using OEC.API;
OECClient client;
// initialization and log in skipped
Order order = client.Orders["your order id is here"];
ModifyOrderDraft draft = client.CreateDraft(order);
draft.Quantity=2;
client.ModifyOrder(draft);
bouldermelton
Posts: 2
Joined: Mar 06, 2009


Posted: Mar 06, 2009 @ 03:22 PM             Msg. 3 of 3
Thank you Serge,

that was exactly the snippet I needed, it works now.