createCostCentre()

CostCentre createCostCentre(NewCostCentre newCostCentre)

This method creates a new cost centre on an account. The cost centre limit of an account is 500.

Parameters

newCostCentre
Format: NewCostCentre XML
Purpose: Defines a NewCostCentre XML document specifying a new cost centre for an account.

Example: Parameter title

This example shows a NewCostCentre XML document to create a new cost centre on account 2142420930.

<NewCostCentre>
  <AccountUSN>2142420930</AccountUSN>
  <Name>Melbourne Office</Name>
</NewCostCentre>

Results

This method returns a CostCentre XML document containing information about the new cost centre.

There are no messages defined by this method.

Example: A returned CostCentre XML document

This example shows a CostCentre XML document containing cost centre information for CostCentreId 794.

<CostCentre>
   <CostCentreId>794</CostCentreId>
   <AccountUSN>2142420930</AccountUSN>
   <Name>Melbourne Office</Name>
</CostCentre>

Faults

NoSuchItemException

This fault is returned when given account USN does not exist.

InvalidRequestException
This fault is returned when:
  • there are 500 existing cost centres in the account
  • the name is already in use on the given account

Java client syntax

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