orderAccount()

OrderDetails orderAccount(Order order)

This method orders a package that contains an account and that may contain one or more subscriptions. The package specifies the configuration information for the account and subscriptions, and also specifies if the order requires approval.

Before you call this method, call getOrderForm() to get the package order form.

Parameters

order
Format: Order XML
Purpose: Defines an Order XML document that specifies the package to order and contains the completed package order form. If the package contains plans, this document also specifies the plan to order.

Example: Order an account

This example orders package 192 with plan 812. The package order form has seven fields (username, given name, family name, email address, company name, number of phone lines and secondary contact). Secondary contact is a compound custom field type, with sub-fields of secondary contact name and secondary contact number.

<Order xmlns="http://xml.inomial.com/smile/2.xsd">
  <Package>192</Package>
  <PackagePlan>812</PackagePlan>
  <OrderForm>
    <Object>
      <String name="username">+61355501256</String>
      <String name="contactGiven">Joe</String>
      <String name="contactFamily">Smith</String>
      <String name="emailAddress">joe@example.com</String>
      <String name="companyName">Example Telecom Ltd</String>
      <Integer name="phoneLines">12</Integer>
      <Object name="secondaryContact">
        <String name="secondaryContactName">John Smith</String>
        <String name="secondaryContactNo">+61395505665</String>
      </Object>
    </Object>
  </OrderForm>
</Order>

Results

This method returns an OrderDetails XML document that contains the status of the order, the order number and information about the ordered account and any ordered subscriptions.

Smile emits the OrderEntered message after the order is entered.

A returned OrderDetails XML document

This example shows an OrderDetails XML document for an account and two subscriptions. The document contains the order number (O12492318), specifies that the order has been approved (RequiresApproval is false), and contains the USN, SID and status information (provisioned, activated and enabled) for the account and subscriptions.

<OrderDetails xmlns="http://xml.inomial.com/smile/2.xsd">
  <OrderNumber>O12492318</OrderNumber>
  <Order>
    <Package>192</Package>
    <RequiresApproval>false</RequiresApproval>
    <AccountUSN>1204921324</AccountUSN>
    <PackagePlan>812</PackagePlan>
    <OrderForm>
      <Object>
        <String name="username">+61355501256</String>
        <String name="contactGiven">Joe</String>
        <String name="contactFamily">Smith</String>
        <String name="emailAddress">joe@example.com</String>
        <String name="companyName">Example Telecom Ltd</String>
        <Integer name="phoneLines">12</Integer>
        <Object name="secondaryContact">
          <String name="secondaryContactName">John Smith</String>
          <String name="secondaryContactNo">+61395505665</String>
        </Object>
      </Object>
    </OrderForm>
  </Order>
  <OrderedComponents>
    <Account>
      <USN>1204921324</USN>
      <ProvisionStatus>Provisioned</ProvisionStatus>
      <ActivateStatus>Activated</ActivateStatus>
      <EnableStatus>Enabled</EnableStatus>
    </Account>
    <Subscription>
      <USN>120398123</USN>
      <ProvisionStatus>Provisioned</ProvisionStatus>
      <ActivateStatus>Activated</ActivateStatus>
      <EnableStatus>Enabled</EnableStatus>
      <SID>15</SID>
    </Subscription>
    <Subscription>
      <USN>120398131</USN>
      <ProvisionStatus>Provisioned</ProvisionStatus>
      <ActivateStatus>Activated</ActivateStatus>
      <EnableStatus>Enabled</EnableStatus>
      <SID>1</SID>
    </Subscription>
  </OrderedComponents>
</OrderDetails>

Faults

OrderException

This fault is returned when Smile cannot process the order, or the <Order> element is not specified or is in the wrong namespace.

Java client syntax

java -cp build/smilewsv2-client.jar [options] com.inomial.smile.client.v2.examples.OrderAccount filename
filename
Purpose: Defines the filename of the Order XML document.
Note: For more information about the Java client and the options it accepts, see Java client syntax.