addSubscriptionContract()

SubscriptionContract addSubscriptionContract(string usn, int contractId, dateTime startDate, dateTime endDate)

This method adds a contract to a subscription.

Parameters

usn
Format: string
Purpose: Specifies the USN of the subscription.
contractId
Format: integer
Purpose: Specifies the ID of the contract to add.
startDate
Format: dateTime
Purpose: Specifies the start date and time of the contract.
endDate
Format: dateTime
Purpose: (Optional) Specifies the end date, and therefore duration, of the contract. The contract will end at the end of the specified day (not the start).

Results

This method returns a SubscriptionContract XML document that contains information about the contract.

There are no messages defined by this method.

Example: A returned SubscriptionContract XML document

This example shows a SubscriptionContract XML document. Contract ID 557 has been added to subscription 2142422431.

<SubscriptionContract xmlns="http://xml.inomial.com/smile/2.xsd" xmlns="http://ws.inomial.com/smile.2">
  <SubscriptionContractId>557</SubscriptionContractId>
  <Contract key="465">24 Months</Contract> 
  <USN>2142422431</USN>
  <EarlyTerminationCharge currency="AUD" formatted="$50.00">50</EarlyTerminationCharge> 
  <StartDate>2032-08-20+10:00</StartDate> 
  <EndDate>2034-08-19+10:00</EndDate>
  <ContractValue currency="AUD" formatted="$500.00">500</ContractValue>
  <MinimumTerminationCharge currency="AUD" formatted="$0.00">0</MinimumTerminationCharge>
  <MaximumTerminationCharge currency="AUD" formatted="$0.00">0</MaximumTerminationCharge> 
  <ContractedPlanScheduleItem>1201</ContractedPlanScheduleItem>  
</SubscriptionContract> 

Faults

NoSuchItemException

This fault is returned when the USN or contract ID do not exist.

InvalidContractException

This fault is returned when the subscription's plan does not support the contract or if the contract start date overlaps another contract.

InvalidRequestException

This fault is returned when the request is invalid.

Java client syntax

java -cp build/smilewsv2-client.jar [options] com.inomial.smile.client.v2.examples.AddSubscriptionContract usn contractId startDate
usn
Purpose: Specifies the USN of the subscription.
contractId
Purpose: Specifies the ID of the contract to add.
startDate
Purpose: Specifies the start date and time of the contract.
endDate
Purpose: (Optional) Specifies the end date of the contract.
Note: For more information about the Java client and the options it accepts, see Java client syntax.