commitContractTermination()
SubscriptionContractTerminationResponse commitContractTermination(string usn, SubscriptionContractTerminationOffer subscriptionContractTerminationOffer)
This method is used to terminate a contract. This method accepts an offer previously provided by Smile to the client. The offer includes details about when the contract is to be terminated as well as the charges to be raised. If the charges are not present then no termination charges are raised. If the offer ID is present in the offer document, Smile checks that the offer is still valid. If the offer is no longer valid an OfferExpiredException is thrown.
Parameters
- usn
- Format: string
- subscriptionContractTerminationOffer
- Format: SubscriptionContractTerminationOffer XML
Example: Request a contract termination
This example submits contract termination offer 46488a01-e97c-3a6d-a354-115ae954fa1d for processing.
<SubscriptionContractTerminationOffer>
<OfferId>46488a01-e97c-3a6d-a354-115ae954fa1d</OfferId>
<SubscriptionContractId>557</SubscriptionContractId>
<USN>2142422431</USN>
<TerminationDate>2032-12-28+11:00</TerminationDate>
<NewInvoiceRequest>
<effectiveDate>2015-02-09+11:00</effectiveDate>
<dueDate>2015-02-21+11:00</dueDate>
<ChargeRequest>
<USN>2142422431</USN>
<itemCode>002595</itemCode>
<description>Early termination charge</description>
<count>1</count>
<startDate>2032-12-28+11:00</startDate>
<endDate>2032-12-29+11:00</endDate>
<amount>460.30</amount>
<chargeGst>true</chargeGst>
<chargeId>46488a01-e97c-3a6d-a354-115ae954fa1d</chargeId>
</ChargeRequest>
</NewInvoiceRequest>
</SubscriptionContractTerminationOffer>
Results
This method returns a SubscriptionContractTerminationResponse XML document that contains information about the contract termination.
Smile emits the ItemisedTransactionClosed message when the termination has been processed.
Example: A returned SubscriptionContractTerminationResponse XML document
This example shows a SubscriptionContractTerminationResponse XML document.
<SubscriptionContractTerminationResponse xmlns="http://xml.inomial.com/smile/2.xsd" xmlns="http://ws.inomial.com/smile.2">
<SubscriptionContractId>557</SubscriptionContractId>
<USN>2142422431</USN>
<TerminationDate>2032-12-28+11:00</TerminationDate>
<Invoice>
<version>2.0</version>
<transactionType>Invoice</transactionType>
<company>1</company>
<usn>2142422423</usn>
<transactionNumber>45040516</transactionNumber>
<currency>AUD</currency>
<amount>506.33</amount>
<accountType>1</accountType>
<gstAmount>46.03</gstAmount>
<entryTimestamp>2015-02-09T14:47:03.771+11:00</entryTimestamp>
<salesReportCategory>invoice</salesReportCategory>
<formattedAmount currency="AUD" formatted="$506.33">506.33</formattedAmount>
<formattedGstAmount currency="AUD" formatted="$46.03">46.03</formattedGstAmount>
<unallocatedAmount>506.33</unallocatedAmount>
<enteredByUsn>2142422415</enteredByUsn>
<logTimestamp>2015-02-09T14:47:03.794+11:00</logTimestamp>
<formattedUnallocatedAmount currency="AUD" formatted="$506.33">506.33</formattedUnallocatedAmount>
<transactionDate>2015-02-09+11:00</transactionDate>
<dueDate>2015-02-21+11:00</dueDate>
<openDate>2015-02-09+11:00</openDate>
<closeDate>2015-02-09+11:00</closeDate>
<quoteNumber>45040516</quoteNumber>
<createdByUsn>2142422415</createdByUsn>
<discount>0.00</discount>
<transactionSource>Manual</transactionSource>
<transactionItem>
<usn>2142422431</usn>
<lineNumber>0</lineNumber>
<itemCode>002595</itemCode>
<chargeFrom>2032-12-28+11:00</chargeFrom>
<chargeTo>2032-12-29+11:00</chargeTo>
<description>Early termination charge</description>
<quantity>1.000</quantity>
<currency>AUD</currency>
<amount>460.30</amount>
<isGst>false</isGst>
<chargeGst>true</chargeGst>
<discount>0.00</discount>
<count>1</count>
<gstAmount>46.030000</gstAmount>
<salesReportCategory>unknown</salesReportCategory>
</transactionItem>
<transactionItem>
<usn>2142422431</usn>
<lineNumber>1</lineNumber>
<itemCode>gst</itemCode>
<chargeFrom>2015-02-09+11:00</chargeFrom>
<chargeTo>2015-02-09+11:00</chargeTo>
<description>Includes 10% GST</description>
<quantity>1.000</quantity>
<currency>AUD</currency>
<amount>46.03</amount>
<isGst>true</isGst>
<chargeGst>false</chargeGst>
<discount>0.00</discount>
<count>0</count>
<gstAmount>0.000000</gstAmount>
<salesReportCategory>gst</salesReportCategory>
</transactionItem>
</Invoice>
</SubscriptionContractTerminationResponse>
Faults
NoSuchItemExceptionThis fault is returned when the subscription or contract is not found.
InvalidRequestExceptionThis fault is returned when the request is invalid.
OfferExpiredExceptionThis fault is returned when the offer ID was provided and a change made to the subscription, or its contract since the offer was generated has invalidated the offer, or the contract is already terminated.
Java client syntax
java -cp build/smilewsv2-client.jar [options] com.inomial.smile.client.v2.examples.CommitContractTermination usn
filename
- usn
- Purpose: Specifies the USN of the subscription for which to terminate the contract.
- filename
- Purpose: Defines the filename of the SubscriptionContractTerminationOffer XML document.