Create details of orders
The order detail contains information about a product that is part of the order. A single order can have many order details.
To create an order detail, you must perform the following:
- Get the orders manager.
Get an instance of the OrdersManager object.
- Get the order.
Get the order that the detail will be associated with. For more information, see For developers: Query orders.
- Create a new order detail.
Create an instance of the OrderDetail class by calling the CreateOrderDetail method of the manager.
- Set the properties.
Set the properties of the instance to the specified values.
- Associate the detail with the order.
Set the Parent property of the OrderDetail instance to the Order instance. Add the order detail to the Details collection of the order.
- Save the changes.
Save the changes to the manager.
Use the following code sample: