addDeferredCharge()
addDeferredCharge(string usn, ChargeRequest charge)
This method adds item charges to an account, specifying a future date for when they will be charged.
Parameters
- usn
- Format: string
- charge
- Format: ChargeRequest XML
Example: Add a deferred charge
This example shows an ADSL item charge that will be applied to an account for the date range 01/01/2013 to 22/02/1013.
<ChargeRequest xmlns="http://xml.inomial.com/smile/2.xsd">
<USN>2142430129</USN>
<itemCode>adsl</itemCode>
<description></description>
<quantity>3</quantity>
<count>0</count>
<startDate>2013-01-01T00:00:00+11:00</startDate>
<endDate>2013-02-22T00:00:00+11:00</endDate>
<amount>22.22</amount>
<Object>
<String name="colour">Chartreuse</String>
</Object>
<location key="12"/>
</ChargeRequest>
Results
This method returns the created TransactionItem.
There are no messages defined by this method.
Example: A returned DeferredCharge XML document
This example shows a DeferredCharge XML document.
<DeferredCharge xmlns="http://xml.inomial.com/smile/2.xsd" xmlns="http://ws.inomial.com/smile.2">
<usn>1000000008</usn>
<lineNumber>0</lineNumber>
<itemCode>adsl</itemCode>
<chargeFrom>2013-12-31+10:00</chargeFrom>
<chargeTo>2014-02-21+10:00</chargeTo>
<description></description>
<quantity>3</quantity>
<currency>AUD</currency>
<amount>22.22</amount>
<isGst>false</isGst>
<chargeGst>true</chargeGst>
<discount>0</discount>
<count>0</count>
<gstAmount>2.22</gstAmount>
<salesReportCategory>hardware</salesReportCategory>
<Object formId="646" objectId="3435" displayName="ADSL2 Modem (Chartreuse)">
<String name="colour">Chartreuse</String>
</Object>
<location key="12">Greenfields store</location>
</DeferredCharge>
Faults
NoSuchItemExceptionThis fault is returned when the item being added does not exist.
InvalidRequestExceptionThis fault is returned when you submit a request with inconsistent information or missing required fields.
Java client syntax
java -cp build/smilewsv2-client.jar [options]
com.inomial.smile.client.v2.examples.AddDeferredCharge usn filename
- usn
- Purpose: Specifies the USN of the account to add the charge to.
- filename
- Purpose: Defines the filename of the ChargeRequest XML document.
Note: For more information about the Java client and the options it
accepts, see Java client syntax.