getQuote()

ItemisedTransactionDetail getQuote(string usn, string prepaidCode, 
 string paymentTypeCode)

This method returns a quote for the cost of a prepaid block purchased with a specific payment method. The quote may differ from the value returned by the getPrepaidPaymentTypes() method, for example, if the subscription is entitled to a discount. The method also returns the information the customer must provide to purchase the prepaid.

Parameters

usn
Format: string
Purpose: Specifies the USN of the subscription to return the quote for.
prepaidCode
Format: string
Purpose: Specifies the code of the prepaid block.
paymentTypeCode
Format: string
Purpose: Specifies the code of the payment type.

Results

This method returns an ItemisedTransactionDetail XML document that lists the cost to purchase the prepaid block and the information the customer must provide to buy the block.

There are no messages defined by this method.

Example: A returned ItemisedTransactionDetail XML document

This example shows an ItemisedTransactionDetail XML document that lists the cost to buy a single prepaid block. The block costs $15 and there is an additional GST cost of $1.50, for a total cost of $16.50.

<ItemisedTransactionDetail xmlns="http://xml.inomial.com/smile/2.xsd">
  <version>2.0</version>
  <transactionType>Quote</transactionType>
  <company>1</company>
  <usn>2142420823</usn>
  <transactionNumber>21433586</transactionNumber>
  <currency>AUD</currency>
  <amount>16.50</amount>
  <accountType>1</accountType>
  <gstAmount>1.50</gstAmount>
  <salesReportCategory>invoice</salesReportCategory>
  <formattedAmount currency="AUD" formatted="$16.50">16.50</formattedAmount>
  <formattedGstAmount currency="AUD" formatted="$1.50">1.50</formattedGstAmount>
  <unallocatedAmount>16.50</unallocatedAmount>
  <formattedUnallocatedAmount currency="AUD" formatted="$16.50">16.50</formattedUnallocatedAmount>     
  <transactionDate>2012-06-28+10:00</transactionDate>
  <openDate>2012-06-28+10:00</openDate>
  <quoteNumber>21433586</quoteNumber>
  <createdByUsn>2142423595</createdByUsn>
  <transactionItem>
    <lineNumber>0</lineNumber>
    <itemCode>006100</itemCode>
    <description>Prepaid time purchased</description>
    <quantity>1</quantity>
    <amount>15.00</amount>
    <isGst>false</isGst>
    <chargeGst>false</chargeGst>
    <count>0</count>
    <gstAmount>1.50</gstAmount>
  </transactionItem>
  <transactionItem>
    <lineNumber>1</lineNumber>
    <itemCode>gst</itemCode>
    <description>Includes 10% GST</description>
    <quantity>1</quantity>
    <amount>1.50</amount>
    <isGst>false</isGst>
    <chargeGst>false</chargeGst>
    <count>0</count>
    <gstAmount>0.00</gstAmount>
  </transactionItem>
</ItemisedTransactionDetail>

Faults

PrepaidException

This fault is returned when the subscription does not support the prepaid block, the payment type is not available for the prepaid block or the caller does not have permission to perform this action.

Java client syntax

java -cp build/smilewsv2-client.jar [options] com.inomial.smile.client.v2.examples.GetQuote usn prepaidCode paymentTypeCode
usn
Purpose: Specifies the USN of the subscription to return the quote for.
prepaidCode
Purpose: Specifies the code of the prepaid block.
paymentTypeCode
Purpose: Specifies the code of the payment type.
Note: For more information about the Java client and the options it accepts, see Java client syntax.