Home > Cloud Cruiser 4 > REST API reference > Customers > Create a customer

Create a customer

Creates a new customer based on the provided information.

Resource URL

POST http://<ccServerURL>/rest/v2/customers

Request

Parameters

None 

Content-Type

application/xml

Body

The customer to create, as XML text with root element customer or JAXB type com.cloudcruiser.server.webservices.v2.dto.customer.Customer. The customer's id attribute must be empty.

Schema

Version 4.0
Version 4.1 and later

For Cloud Cruiser 4.1 and later, this XML schema describes a customer or list of customers.

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://www.cloudcruiser.com/webservices/v2/Common" xmlns:tns="http://www.cloudcruiser.com/webservices/v2/Customer" attributeFormDefault="unqualified"elementFormDefault="qualified" targetNamespace="http://www.cloudcruiser.com/webservices/v2/Customer">
  <xs:import namespace="http://www.cloudcruiser.com/webservices/v2/Common"/>
  <xs:import/>
  <xs:element name="customer" type="tns:Customer"/>
  <xs:element name="customerList">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" minOccurs="0" ref="tns:customer"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="customerSummaryList">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" minOccurs="0" name="customerSummary" type="tns:CustomerSummary"/>
      </xs:sequence>
      <xs:attribute name="totalCount" type="xs:int" use="required"/>
      <xs:attribute name="retrievedCount" type="xs:int" use="required"/>
    </xs:complexType>
  </xs:element>
  <xs:complexType name="CustomerSummary">
    <xs:sequence>
      <xs:element name="accountId" type="xs:string"/>
      <xs:element minOccurs="0" name="description" type="xs:string"/>
    </xs:sequence>
    <xs:attribute name="id" type="xs:int" use="required"/>
  </xs:complexType>
  <xs:complexType name="Customer">
    <xs:sequence>
      <xs:element name="accountId" type="xs:string"/>
      <xs:element name="active" type="xs:boolean"/>
      <xs:element default="1" name="accountingDay" type="xs:short"/>
      <xs:element default="1" name="fiscalStartMonth" type="xs:short"/>
      <xs:element minOccurs="0" name="altAccountId" type="xs:string"/>
      <xs:element minOccurs="0" name="description" type="xs:string"/>
      <xs:element minOccurs="0" name="flag1" type="xs:string"/>
      <xs:element minOccurs="0" name="flag2" type="xs:string"/>
      <xs:element minOccurs="0" name="flag3" type="xs:string"/>
      <xs:element minOccurs="0" name="flag4" type="xs:string"/>
      <xs:element minOccurs="0" name="flag5" type="xs:string"/>
      <xs:element name="ratePlan">
        <xs:complexType>
          <xs:sequence/>
          <xs:attribute name="name" type="xs:string" use="required"/>
          <xs:attribute name="id" type="xs:int"/>
        </xs:complexType>
      </xs:element>
      <xs:element minOccurs="0" name="transactions">
        <xs:complexType>
          <xs:sequence>
            <xs:element maxOccurs="unbounded" name="transaction" type="tns:Transaction"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element minOccurs="0" name="discountInstances">
        <xs:complexType>
          <xs:sequence>
            <xs:element maxOccurs="unbounded" name="discountInstance" type="tns:DiscountInstance"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element minOccurs="0" name="contacts" type="tns:Contacts"/>
    </xs:sequence>
    <xs:attribute name="id" type="xs:int"/>
  </xs:complexType>
  <xs:complexType abstract="true" name="Transaction">
    <xs:sequence>
      <xs:element name="service" type="ns1:Service"/>
      <xs:element default="true" name="active" type="xs:boolean"/>
      <xs:element minOccurs="0" name="description" type="xs:string"/>
      <xs:element default="MONEY_AMOUNT" name="amountType" type="xs:string"/>
      <xs:element name="amount" type="xs:double"/>
      <xs:element minOccurs="0" name="lastProcessedDate" type="ns1:Date"/>
    </xs:sequence>
    <xs:attribute name="id" type="xs:int"/>
  </xs:complexType>
  <xs:complexType name="NonRecurringTransaction">
    <xs:complexContent>
      <xs:extension base="tns:Transaction">
        <xs:sequence>
          <xs:element name="transactionDate" type="ns1:Date"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="RecurringTransaction">
    <xs:complexContent>
      <xs:extension base="tns:Transaction">
        <xs:sequence>
          <xs:element name="frequencyType" type="xs:string"/>
          <xs:element name="startDate" type="ns1:StartOfDay"/>
          <xs:element name="endDate" type="ns1:EndOfDay"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="DiscountInstance">
    <xs:sequence>
      <xs:element name="active" type="xs:boolean"/>
      <xs:element name="startDate" type="ns1:StartOfDay"/>
      <xs:element name="endDate" type="ns1:EndOfDay"/>
      <xs:element name="discount">
        <xs:complexType>
          <xs:sequence/>
          <xs:attribute name="name" type="xs:string" use="required"/>
          <xs:attribute name="id" type="xs:int"/>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
    <xs:attribute name="id" type="xs:int"/>
  </xs:complexType>
  <xs:complexType name="Contacts">
    <xs:sequence>
      <xs:element minOccurs="0" name="description" type="xs:string"/>
      <xs:element maxOccurs="unbounded" minOccurs="0" name="emailContact">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="emailAddress" type="xs:string"/>
            <xs:element minOccurs="0" name="description" type="xs:string"/>
            <xs:element default="false" name="receiveAlerts" type="xs:boolean"/>
          </xs:sequence>
          <xs:attribute name="id" type="xs:int"/>
        </xs:complexType>
      </xs:element>
      <xs:element maxOccurs="unbounded" minOccurs="0" name="postalContact">
        <xs:complexType>
          <xs:sequence>
            <xs:element minOccurs="0" name="description" type="xs:string"/>
            <xs:element name="address1" type="xs:string"/>
            <xs:element minOccurs="0" name="address2" type="xs:string"/>
            <xs:element minOccurs="0" name="address3" type="xs:string"/>
            <xs:element minOccurs="0" name="address4" type="xs:string"/>
            <xs:element minOccurs="0" name="address5" type="xs:string"/>
          </xs:sequence>
          <xs:attribute name="id" type="xs:int"/>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
    <xs:attribute name="id" type="xs:int"/>
  </xs:complexType>
</xs:schema>

Response

Content-Type

application/xml

Body

The new customer, as XML text with the root element customer or JAXB type com.cloudcruiser.server.webservices.v2.dto.customer.Customer.

Schema

Same as for the request, above.

Example

URL invocation

POST http://localhost:8080/rest/v2/customers​​

Java invocation
Request body
<customer xmlns="http://www.cloudcruiser.com/webservices/v2/Customer">
  <accountId>Enterprise Software|Marketing</accountId>
  <active>true</active>
  <accountingDay>1</accountingDay>
  <fiscalStartMonth>1</fiscalStartMonth>
  <description>ES Marketing department</description>
  <ratePlan name="Default"/>
  <contacts>
    <emailContact>
      <emailAddress>t_b1@big.org</emailAddress>
      <description>Email of ES Marketing</description>
      <receiveAlerts>true</receiveAlerts>
    </emailContact>
    <postalContact>
      <description>Postal Address of ES Marketing</description>
      <address1>102 Douglas Blvd</address1>
      <address2>Roseville</address2>
      <address3>CA</address3>
      <address4>95650</address4>
    </postalContact>
  </contacts>
</customer>
Response body
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<customer xmlns="http://www.cloudcruiser.com/webservices/v2/Customer" id="10004">
    <accountId>Enterprise Software|Marketing</accountId>
    <active>true</active>
    <accountingDay>1</accountingDay>
    <fiscalStartMonth>1</fiscalStartMonth>
    <description>ES Marketing department</description>
    <ratePlan name="Default" id="1"/>
    <contacts id="10000">
        <emailContact id="10000">
            <emailAddress>t_b1@big.org</emailAddress>
            <description>Email of ES Marketing</description>
            <receiveAlerts>true</receiveAlerts>
        </emailContact>
        <postalContact id="10001">
            <description>Postal Address of ES Marketing</description>
            <address1>102 Douglas Blvd</address1>
            <address2>Roseville</address2>
            <address3>CA</address3>
            <address4>95650</address4>
        </postalContact>
    </contacts>
</customer>
Last modified

Tags

Classifications

This page has no classifications.
© Copyright 2018 Hewlett Packard Enterprise Development LP