Page tree
Skip to end of metadata
Go to start of metadata

This function creates an order

Parameters

Used to call the function

  1. Order - TOrder

Returns

Returns the following

  • integer

 

Create Order Example
        public void CreateOrder()
        {
            IItemServiceservice service = new IItemServiceservice() { BasicSecurityValue = new BasicSecurity() { Username = "ws.demo", Password = "password" } };
            var order = new TOrder()
            {
                SalePerson = "2",
                OrderDate = DateTime.Now,
                Customer = new TCustomer() { Number = "test", Name = "Test Customer", Address1 = "Some Address"},
                Options = new TOrderOptions() { Customer = TActionMethod._ActionInsertMerge},                
                ReferenceNumber = "WEB-AB45EF",
                Text1 = "Example comment from customer",                
                Lines = new TOrderLine[]
                {
                    new TOrderLine()
                    {
                        ItemCode = "2005",
                        Quantity = 1,
                        UnitPriceWithTax = 1000,
                        DiscountPercent = 20                        
                    }
                },
            };
            service.CreateOrder(order);
        }