public void SaveCustomer() { var customer = new Customer { Name = "Mr. David R. Robinett", AcceptsElectronicInvoices = true, Active = true, AutoAllocateToOldestInvoice = true, ContactName = "Mr. David R. Robinett", DeliveryAddress01 = "Pappelallee 6667", DeliveryAddress02 = "Solingen", DeliveryAddress03 = "Nordrhein-Westfalen", DeliveryAddress04 = "42651", DeliveryAddress05 = "Germany", CommunicationMethod = 1, PostalAddress01 = "Pappelallee 6667", PostalAddress02 = "Solingen", PostalAddress03 = "Nordrhein-Westfalen", PostalAddress04 = "42651", PostalAddress05 = "Germany", Telephone = "238-555-0100", SalesRepresentativeId = null }; Api.CustomerRequest.Save(customer); }
public Customer Save(Customer customer) { var url = string.Format("Customer/Save?apikey={0}&companyid={1}", _apiKey, _companyId); var request = new RestRequest(url, Method.POST) { JsonSerializer = new JsonSerializer() }; request.RequestFormat = DataFormat.Json; request.AddBody(customer); var response = _client.Execute<Customer>(request); return response.Data; }