NodeJS CreateOrder - Register_Domain

Registers a domain. Please look at the TLD-Kit for special rules.

Response CreateOrder(string sessionId,Order order)

Response codes

ResultCodeMessageValue
200Order validated
200Order received
400Order not validatedMessages
401Authorization failed
405Access denied

CreateOrder request

PropertyDescription
sessionIdExample: o58t9fjgw9bjarp6q7byv13e
order

CreateOrderResponse

Property
CreateOrderResult
order

NodeJS example

var soap = require("soap");

var register_DomainExample = function(callback) {

	//Registrant
	registrant =  {};
	registrant.Name="John Doe";
	registrant.Address1="Address1Test";
	registrant.City="CityTest";
	registrant.PostalCode="888349";
	registrant.CountryCode="DK";
	registrant.Email="test@gmail.com";
	registrant.Phone="+45.123456789";

	//Contact
	adminContact =  {};
	adminContact.FirstName="John";
	adminContact.LastName="Doe";
	adminContact.Address1="Address1Test";
	adminContact.PostalCode="888349";
	adminContact.City="CityTest";
	adminContact.CountryCode="DK";
	adminContact.Email="test@gmail.com";
	adminContact.Phone="+45.123456789";

	//Contact
	techContact =  {};
	techContact.FirstName="John";
	techContact.LastName="Doe";
	techContact.Address1="Address1Test";
	techContact.PostalCode="888349";
	techContact.City="CityTest";
	techContact.CountryCode="DK";
	techContact.Email="test@gmail.com";
	techContact.Phone="+45.123456789";

	//Contact
	billingContact =  {};
	billingContact.FirstName="John";
	billingContact.LastName="Doe";
	billingContact.Address1="Address1Test";
	billingContact.PostalCode="888349";
	billingContact.City="CityTest";
	billingContact.CountryCode="DK";
	billingContact.Email="test@gmail.com";
	billingContact.Phone="+45.123456789";

	//NameServer
	nameServer1 =  {};
	nameServer1.HostName="ns1.ascio.com";

	//NameServer
	nameServer2 =  {};
	nameServer2.HostName="ns2.ascio.com";

	//NameServers
	nameServers =  {};
	nameServers.NameServer1=nameServer1;
	nameServers.NameServer2=nameServer2;

	//Domain
	domain =  {};
	domain.DomainName="ascio-test-domain"+Math.floor(Date.now() / 1000)+".com";
	domain.Registrant=registrant;
	domain.AdminContact=adminContact;
	domain.TechContact=techContact;
	domain.BillingContact=billingContact;
	domain.NameServers=nameServers;

	//Order
	order =  {};
	order.Type="Register_Domain";
	order.Domain=domain;	
	soap.createClient("../AscioServiceTest.wsdl", function(err, client) {
		if(err) {
			callback(err);
		} 
		else {
			var request = {sessionId: "sessionId", order: order};
			client.CreateOrder(request, function(err,result) {
				if(err) {
					callback({error: err.root.Envelope.Body.Fault.faultstring.$value, request : result.request.body});
				} else {
					if(result.CreateOrderResult.ResultCode == 200) {
						callback(null,result);	
					} else {
						callback({error: result.CreateOrderResult,request : request});
					}	
				}
			});

		};
	});
};
register_DomainExample(function(err,result) {
	if(err) {
		console.log("\n\n Request \n\n",err.request, "\n\n Response \n\n" ,err.error,"\n");
	}
	else {
		console.log(result);
	}
});
WSDL for AWS v2
https://aws.demo.ascio.com/2012/01/01/AscioService.wsdl (OTE)
https://aws.ascio.com/2012/01/01/AscioService.wsdl (Live)