/
C# SDK Sample: Create customer
C# SDK Sample: Create customer
using System; using System.Collections.Generic; using com.ultracart.admin.v2.Api; using com.ultracart.admin.v2.Model; using NUnit.Framework; namespace SdkSample { // This sample uses NUnit Framework [TestFixture] public class CreateCustomerTest { [Test] public void CreateCustomer() { // See https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/158597140/C+SDK+Sample+Initializing+Routine UltraCartInit.Init(); var api = new CustomerApi(); var random = new Random(); var i = random.Next(); Customer customer = new Customer { Email = "sample" + i + "@ultracart.com", Password = "change_me" }; var billing = new List<CustomerBilling>(); billing.Add(new CustomerBilling() { FirstName = "John" }); customer.Billing = billing; CustomerResponse response = api.InsertCustomer(customer); if (response.Success == true) { Console.WriteLine(response.Customer); } else { Console.WriteLine(response.Error.ErrorCode); Console.WriteLine(response.Error.DeveloperMessage); Console.WriteLine(response.Error.UserMessage); Console.WriteLine(response.Error.MoreInfo); } } } }
, multiple selections available,
Related content
C# SDK Sample: Initializing Routine
C# SDK Sample: Initializing Routine
More like this
C# SDK Sample: Edit Auto Order
C# SDK Sample: Edit Auto Order
More like this
C# SDK Sample: Update auto order item options
C# SDK Sample: Update auto order item options
More like this
PHP SDK Sample: Add item to order
PHP SDK Sample: Add item to order
More like this
PHP SDK Sample: Add externally created order
PHP SDK Sample: Add externally created order
More like this
PHP SDK Sample: Edit Auto Order
PHP SDK Sample: Edit Auto Order
More like this