commitPlanChange()

PlanChangeResponse commitPlanChange(string usn, PlanChangeOffer planChangeOffer)

This method performs a plan change based on a previously acquired PlanChangeOffer.

Any changes made to the offer will be honoured by this method, however charges are identified by their chargeId. Any charges not present in the quote will be raised as deferred charges. This means that if you want to cancel a charge, you must leave it in the quote and set its value to $0.

Some fields such as GST may be removed in order to have Smile calculate charges.

Parameters

usn
Format: string
Purpose: Specifies the USN of the subscription of the plan to be changed.
planChangeOffer
Format: PlanChangeOffer XML
Purpose: Defines a PlanChangeOffer XML document that defines the plan change and any charges that should be raised as a result of the plan change. 

Example: A PlanChangeOffer XML document

This example shows a PlanChangeOffer XML document that contains information about the cost of the new plan and options and a credit for the subscription's current plan. The plan schedule item also overrides the flagfall for China cellular calls and overrides some charging rules with new limits.

<PlanChangeOffer xmlns:="http://xml.inomial.com/smile/2.xsd" xmlns:="http://ws.inomial.com/smile.2">
  <USN>2142421144</USN>
  <PlanChangeProposal>
    <PlanScheduleItem>
      <PlanCode>plan2</PlanCode>
      <PlanScheduleType>1</PlanScheduleType>
      <Start>2014-04-16T00:00:00</Start>
      <Options>
        <Object>
          <Integer name="op1">2</Integer>
        </Object>
      </Options>
      <TariffOverrides>
        <TariffOverride>
          <Destination key="69751">China cellular</Destination>
          <TariffType key="1541">Local</TariffType>
          <Flagfall>2</Flagfall>
          <Rate>1</Rate>
          <Units>1</Units>
          <Increment>1</Increment>
          <MinimumCharge>5</MinimumCharge>
          <MaximumCharge>20</MaximumCharge>
          <OverrideDescription>Updated from API</OverrideDescription>
          <RoundingMode>HalfUp</RoundingMode>
          <DecimalPlaces>2</DecimalPlaces>
          <CallType>Voice</CallType>
        </TariffOverride>
      </TariffOverrides>
      <ChargingRuleOverrides>
        <ChargingRuleOverride>
          <ChargingRule key="1119" />
          <Rate>1</Rate>
          <MaximumUnits>10</MaximumUnits>
          <MaximumUnitsPerSession>100</MaximumUnitsPerSession>
          <Comment>SOAP</Comment>
        </ChargingRuleOverride>
        <ChargingRuleOverride>
          <ChargingRule key="1118" />
          <RetailMarkup>50</RetailMarkup>
          <MaximumUnits>10</MaximumUnits>
          <MaximumUnitsPerSession>100</MaximumUnitsPerSession>
          <Comment>SOAP</Comment>
        </ChargingRuleOverride>
      </ChargingRuleOverrides>
    </PlanScheduleItem>
    <OfferId>e34ab133-f570-3779-8695-3387ea20d21d</OfferId>
  </PlanChangeProposal>
  <NewInvoiceRequest>
    <effectiveDate>2014-04-16+10:00</effectiveDate>
    <dueDate>2014-04-28+10:00</dueDate>
    <ChargeRequest>
      <USN>2142421144</USN>
      <itemCode>001336</itemCode>
      <description>Plan 2 (16/04/2014 - 30/04/2014)</description>
      <quantity>1</quantity>
      <startDate>2014-04-16+10:00</startDate>
      <endDate>2014-05-01+10:00</endDate>
      <amount>7.49</amount>
      <chargeGst>true</chargeGst>
      <gst gstId="2">
        <amount>0.75</amount>
      </gst>
      <chargeId>c33d170a-855d-3b3e-a2dd-3b3cbea01c42</chargeId>
    </ChargeRequest>
    <ChargeRequest>
      <USN>2142421144</USN>
      <itemCode>001337</itemCode>
      <description>Option 1 (16/04/2014 - 30/04/2014)</description>
      <quantity>2</quantity>
      <startDate>2014-04-16+10:00</startDate>
      <endDate>2014-05-01+10:00</endDate>
      <amount>1.00</amount>
      <chargeGst>true</chargeGst>
      <gst gstId="2">
        <amount>0.10</amount>
      </gst>
      <chargeId>01e85a99-8e2e-3a9e-85e0-87b7a2d40f3b</chargeId>
    </ChargeRequest>
    <ChargeRequest>
      <USN>2142421144</USN>
      <itemCode>001335</itemCode>
      <description>Retraction for Plan 1 (16/04/2014 - 30/04/2014)</description>
      <quantity>1.000</quantity>
      <startDate>2014-04-16+10:00</startDate>
      <endDate>2014-05-01+10:00</endDate>
      <amount>-4.99</amount>
      <chargeGst>true</chargeGst>
      <gst gstId="2">
        <amount>-0.50</amount>
      </gst>
      <chargeId>8ccb6f3f-4a5d-35bc-a41f-0d7a3280a269</chargeId>
      <retractChargeId>afd075b6-b7af-4438-99ef-848a8c9c890c</retractChargeId>
    </ChargeRequest>
  </NewInvoiceRequest>
</PlanChangeOffer>

Results

This method returns a PlanChangeReponse XML document containing information for the invoice resulting from the plan change.

There are no messages defined by this method.

Example: A returned PlanChangeResponse XML document

This example shows a returned PlanChangeResponse XML document. It shows that some of the fields were modified, including the GST value for the "Retraction for Plan 1", so that Smile's rules (10% GST) are not used.

<PlanChangeResponse xmlns:="http://xml.inomial.com/smile/2.xsd" xmlns:="http://ws.inomial.com/smile.2">
  <Invoice>
    <version>2.0</version>
    <transactionType>Invoice</transactionType>
    <company>1</company>
    <usn>1000000008</usn>
    <transactionNumber>21460407</transactionNumber>
    <currency>AUD</currency>
    <amount>9.15</amount>
    <accountType>1</accountType>
    <gstAmount>1.65</gstAmount>
    <entryTimestamp>2014-04-15T10:58:32.454+10:00</entryTimestamp>
    <salesReportCategory>invoice</salesReportCategory>
    <formattedAmount currency="AUD" formatted="$9.15">9.15</formattedAmount>
    <formattedGstAmount currency="AUD" formatted="$1.65">1.65</formattedGstAmount>  
    <unallocatedAmount>9.15</unallocatedAmount>
    <enteredByUsn>2142420807</enteredByUsn>
    <logTimestamp>2014-04-16T10:58:32.456+10:00</logTimestamp>
    <formattedUnallocatedAmount currency="AUD" formatted="$9.15">9.15</formattedUnallocatedAmount>
    <transactionDate>2014-04-15+10:00</transactionDate>
    <dueDate>2014-04-30+10:00</dueDate>
    <openDate>2014-04-16+10:00</openDate>
    <closeDate>2014-04-16+10:00</closeDate>
    <quoteNumber>21460407</quoteNumber>
    <createdByUsn>2142420807</createdByUsn>
    <discount>0.00</discount>
    <transactionSource>Manual</transactionSource>
    <transactionItem>
      <usn>1000000008</usn>
      <lineNumber>0</lineNumber>
      <itemCode>001337</itemCode>
      <chargeFrom>2014-04-16+10:00</chargeFrom>
      <chargeTo>2014-05-01+10:00</chargeTo>
      <description>Option 1 (16/04/2014 - 30/04/2014)</description>
      <quantity>2.000</quantity>
      <currency>AUD</currency>
      <amount>1.50</amount>
      <isGst>false</isGst>
      <chargeGst>true</chargeGst>
      <discount>0.00</discount>
      <count>0</count>
      <gstAmount>0.150000</gstAmount>
      <salesReportCategory>unknown</salesReportCategory>
    </transactionItem>
    <transactionItem>
      <usn>2142421144</usn>
      <lineNumber>1</lineNumber>
      <itemCode>001335</itemCode>
      <chargeFrom>2014-04-16+10:00</chargeFrom>
      <chargeTo>2014-05-01+10:00</chargeTo>
      <description>Retraction for Plan 1 (16/04/2014 - 30/04/2014)</description>
      <quantity>1.000</quantity>
      <currency>AUD</currency>
      <amount>-3.99</amount>
      <isGst>false</isGst>
      <chargeGst>true</chargeGst>
      <discount>0.00</discount>
      <count>0</count>
      <gstAmount>-0.500000</gstAmount>
      <salesReportCategory>unknown</salesReportCategory>
    </transactionItem>
    <transactionItem>
      <usn>2142421144</usn>
      <lineNumber>2</lineNumber>
      <itemCode>001335</itemCode>
      <chargeFrom>2014-04-16+10:00</chargeFrom>
      <chargeTo>2014-05-01+10:00</chargeTo>
      <description>New charge</description>
      <quantity>1.000</quantity>
      <currency>AUD</currency>
      <amount>10.00</amount>
      <isGst>false</isGst>
      <chargeGst>true</chargeGst>
      <discount>0.00</discount>
      <count>0</count>
      <gstAmount>2.000000</gstAmount>
      <salesReportCategory>unknown</salesReportCategory>
    </transactionItem>
    <transactionItem>
      <usn>1000000008</usn>
      <lineNumber>3</lineNumber>
      <itemCode>round</itemCode>
      <chargeFrom>2014-04-15+10:00</chargeFrom>
      <chargeTo>2014-04-15+10:00</chargeTo>
      <description>Rounding adjustment</description>
      <quantity>1.000</quantity>
      <currency>AUD</currency>
      <amount>-0.01</amount>
      <isGst>false</isGst>
      <chargeGst>true</chargeGst>
      <discount>0.00</discount>
      <count>0</count>
      <gstAmount>0.000000</gstAmount>
      <salesReportCategory>round</salesReportCategory>
    </transactionItem>
    <transactionItem>
      <usn>1000000008</usn>
      <lineNumber>4</lineNumber>
      <itemCode>gst</itemCode>
      <chargeFrom>2014-04-15+10:00</chargeFrom>
      <chargeTo>2014-04-15+10:00</chargeTo>
      <description>Includes 10% GST</description>
      <quantity>1.000</quantity>
      <currency>AUD</currency>
      <amount>0.15</amount>
      <isGst>true</isGst>
      <chargeGst>false</chargeGst>
      <discount>0.00</discount>
      <count>0</count>
      <gstAmount>0.000000</gstAmount>
      <salesReportCategory>gst</salesReportCategory>
    </transactionItem>
    <transactionItem>
      <usn>2142421144</usn>
      <lineNumber>5</lineNumber>
      <itemCode>gst</itemCode>
      <chargeFrom>2014-04-15+10:00</chargeFrom>
      <chargeTo>2014-04-15+10:00</chargeTo>
      <description>Includes 10% GST</description>
      <quantity>1.000</quantity>
      <currency>AUD</currency>
      <amount>1.50</amount>
      <isGst>true</isGst>
      <chargeGst>false</chargeGst>
      <discount>0.00</discount>
      <count>0</count>
      <gstAmount>0.000000</gstAmount>
      <salesReportCategory>gst</salesReportCategory>
    </transactionItem>
  </Invoice>
</PlanChangeResponse>

Faults

NoSuchItemException

This fault is returned when the subscription or another object referred to in the request does not exist.

InvalidRequestException

This fault is returned when the request is invalid.

OfferExpiredException

This fault is returned when changes have been made to any of the affected plans, or the subscription since the quote was produced. A new quote is required from proposePlanChange() before proceeding.

Java client syntax

java -cp build/smilewsv2-client.jar [options]
 com.inomial.smile.client.v2.examples.CommitPlanChange usn filename
usn
Purpose: Specifies the USN of the subscription of the plan to be changed.
filename
Purpose: Defines the filename of the PlanChangeOffer XML document.
Note: For more information about the Java client and the options it accepts, see Java client syntax.