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.
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:
Note: The interactive schema navigator for all request packets is available here: http://plesk.github.io/api-schemas/1.6.8.0/agent_input.svg.
- The gen_info node is required. Specifies the general
information about the new customer account. Data type:
clientAddGenInfo (
plesk_client.xsd
). See the structure of this node in topic General Customer Account Settings. - The add-packages-to-customer-pool is optional. Specifies the list of web application distributions that should be added to the customer pool (to be deployed to the customer’s subscriptions later). Data type: none. See the structure of this node below.
- The package_id node is required. It specifies the identifier of the distribution package to be added to the customer pool. Data type: integer.
Note: 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:
Note: The interactive schema navigator for all response packets is available here: http://plesk.github.io/api-schemas/1.6.8.0/agent_output.svg.
- The result node is required. It wraps the result of the
requested add operation. Data type: resultType
(
common.xsd
). - The status node is required. It returns the execution status of the add operation. Data type: string. Allowed values: ok | error.
- The errcode node is required if the add creation fails. Returns the error code. Data type: unsignedInt.
- The errtext nodeis required if the add creation fails. Returns the error message. Data type: string.
- The id node is required if the add operation succeeds. Returns the unique identifier of the customer account just added to Plesk. Data type: integer.
- The guid node is required if the add operation succeeds. Returns the global user ID of the customer account just added to Plesk. Data type: string.
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>