Any best practice code snippets for creating an order through the api?
Developer forum
Best practice create order using API
Replies
You must be logged in to post in the forum
Any best practice code snippets for creating an order through the api?
Hi Martin
Not in particaluar - you do not have much about your use case or context, but simply create an order instance and save it:
Order newOrder = new order(currency); newOrder.ID = "Order1"; OrderService.Save(order);
Then call orderlineservice.Create() to add orderlines to the order.
BR Nicolai
Ok, thanks.
And there is not anything else that is "needed" in order for it to be a perfectly valid order in DW?
There are a lot of scenarios related to this - is it a cart, an order, is it complete, has it been payed, is it recurring, does it have RMA etc. etc.
So yes, the above is an order object - but in what state, and what context?
BR Nicolai
You must be logged in to post in the forum