compileChargeList()

NewInvoiceRequest compileChargeList(string usn, ChargeListCompilationRequest chargeListCompilationRequest)

This method compiles a NewInvoiceRequest from the provided ChargeListCompilationRequest, taking the specified account's context into consideration. For example, for tax or discount purposes.

This method does not affect the account at all. It is provided as a way to estimate charges.

Parameters

usn
Format: string
Purpose: Specifies the USN of the account to compile the charge list against.
chargeListCompilationRequest
Format: ChargeListCompilationRequest XML
Purpose: Defines a ChargeListCompilationRequest XML document specifying the details of the charge list. 

Example: Request a compilation of charges

This example shows a request to compile a charge list for a single charge for internet access and computed GST to be applied to account 2142421532.

<ChargeListCompilationRequest xmlns="http://xml.inomial.com/smile/2.xsd">
  <ChargeList>
    <Charge>
      <ChargeID>DE8207D0-EB19-496C-978B-5048C096F4A1</ChargeID>
      <ItemDescriptionID>68</ItemDescriptionID>
      <Description>Internet Access $10/mo</Description>
      <ChargeStart>2014-03-12T00:00:00+11:00</ChargeStart>
      <ChargeEnd>2014-04-12T00:00:00+11:00</ChargeEnd>
      <Count>1</Count>
      <Charge>10.00</Charge>
      <ChargeGST>true</ChargeGST>
      <GSTIsPredetermined>true</GSTIsPredetermined>
      <GSTId>1</GSTId>
      <GSTAmount>1</GSTAmount>
      <USN>2142421532</USN>
    </Charge>
  </ChargeList>
</ChargeListCompilationRequest>

Results

This method returns a NewInvoiceRequest which may be used as a quote for the ChargeList. It can also be provided to raiseInvoice(), with possible modifications, to raise against the account.

There are no messages defined by this method.

Example: A returned NewInvoiceRequest XML document

This example shows a NewInvoiceRequest XML document that contains the compiled internet and GST charges as they would apply to the account, which also receives a 50% discount.

<NewInvoiceRequest xmlns="http://xml.inomial.com/smile/2.xsd" xmlns="http://ws.inomial.com/smile.2">
  <effectiveDate>2014-12-19+11:00</effectiveDate>
  <dueDate>2014-12-31+11:00</dueDate>
  <ChargeRequest>
    <USN>2142421532</USN>
    <itemCode>hfp</itemCode>
    <description>Internet Access $10/mo</description>
    <count>1</count>
    <startDate>2014-03-12+11:00</startDate>
    <endDate>2014-04-10+10:00</endDate>
    <amount>10.00</amount>
    <chargeGst>true</chargeGst>
    <gst gstId="1">
      <amount>1</amount>
    </gst>
    <chargeId>de8207d0-eb19-496c-978b-5048c096f4a1</chargeId>
    <discount discountID="458">
      <amount>5.00</amount>
    </discount>
  </ChargeRequest>
</NewInvoiceRequest>

Faults

NoSuchItemException

This fault is returned when the account does not exist.

InvalidRequestException

This fault is returned when the specified USN is an invalid account number.

Java client syntax

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