Creating Customer Accounts

Customer account presents some general information about customer and a collection of various settings. The general information is always specified when creating a customer account, while settings can be specified later.

In this chapter:

Request Packet Structure

Response Packet Structure

Samples

 

Request Packet Structure

A request XML packet adding a new customer account to Plesk includes the add operation node:

<packet>
<customer>
   <add>
   ...
   </add>
</customer>
</packet>

 

The add node does not have a separate type, it is nested within the ClientTypeRequest complex type (client_input.xsd). The add node has the following graphics representation:

client_add

Important: When creating request packets, put nodes and elements in the order they follow in the packet structure.

 

Response Packet Structure

The add node of the response packet is structured as follows:

When adding the customer with already existing login, the error with error code 1007 occurs.

 

Samples

Creating a customer account

The following packet creates a customer account and sets the collection of settings for it:

<packet version="1.6.7.0">
<customer>
<add>
   <gen_info>
       <cname>LogicSoft Ltd.</cname>
       <pname>Stephen Lowell</pname>
       <login>stevelow</login>
       <passwd>Jhtr66fBB</passwd>
       <status>0</status>
       <phone>416 907 9944</phone>
       <fax>928 752 3905</fax>
       <email>host@logicsoft.net</email>
       <address>105 Brisbane Road, Unit 2</address>
       <city>Toronto</city>
       <state/>
       <pcode/>
       <country>CA</country>
   </gen_info>
</add>
</customer>
</packet>

Response:

<packet version="1.6.7.0">
  <customer>
    <add>
      <result>
        <status>ok</status>
        <id>3</id>
        <guid>d7914f79-d089-4db1-b506-4fac617ebd60</guid>
      </result>
    </add>
  </customer>
</packet>
Creating multiple customer accounts

To create multiple customer accounts, use a different add operations for each:

<packet version="1.6.7.0">
<customer>
<add>
   <gen_info>
       <cname>LogicSoft Ltd.</cname>
       <pname>Stephen Lowell</pname>
       <login>stevelow</login>
       <passwd>Jhtr66fBB</passwd>
       <status>0</status>
       <phone>416 907 9944</phone>
       <fax>928 752 3905</fax>
       <email>host@logicsoft.net</email>
       <address>105 Brisbane Road, Unit 2</address>
       <city>Toronto</city>
       <state/>
       <pcode/>
       <country>CA</country>
   </gen_info>
</add>
<add>
   <gen_info>
       <cname>TechnoSoft Ltd.</cname>
       <pname>James Hardy</pname>
       <login>jhard</login>
       <passwd>Jk8Dhh6fBB</passwd>
       <status>0</status>
       <phone>416 907 3366</phone>
       <fax>928 752 3377</fax>
       <email>james@technosoft.net</email>
       <address>122 Greenroad Valley, Unit 1</address>
       <city>Toronto</city>
       <state/>
       <pcode/>
       <country>CA</country>
   </gen_info>
</add>
</customer>
</packet>

Response:

<packet version="1.6.3.0">
  <customer>
    <add>
      <result>
        <status>ok</status>
        <id>4</id>
        <guid>0e35bf3c-5eb0-4006-98c6-5ce4ef4a08a7</guid>
      </result>
    </add>
    <add>
      <result>
        <status>ok</status>
        <id>5</id>
        <guid>331f196c-2eff-4819-91ea-3ad7c489ec3d</guid>
      </result>
    </add>
  </customer>
</packet>