getTransaction()
TransactionDetail getTransaction(string transactionNumber)
This method searches by transaction number for a transaction and returns an XML document with detailed transaction information. If the transaction is an itemised transaction such as an invoice or itemised credit, the document also contains information about each transaction item.
Parameters
- transactionNumber
- Format: string
Results
This method returns a TransactionDetail XML document that contains information about the transaction, for example, currency, amount, date and sales report category. If the transaction is an itemised transaction, the document also contains information about each item in the transaction.
There are no messages defined by this method.
Example: A returned TransactionDetail XML document
This example shows a TransactionDetail XML document for an invoice, which is an itemised transaction. The document contains transaction information (for example, currency, amount, sales report category) and detailed information about each transaction item (for example, item code, quantity, amount and discount).
- If the transaction is a credit note, debit note, surcharge or surcharge reversal, the <salesReportCategory> element is nested in the <TransactionDetail> element.
- If the transaction is itemised, the <salesReportCategory> element is nested in the <transactionItem> element.
Because this example shows a TransactionDetail XML document for an invoice, the <salesReportCategory> element does not appear in the <TransactionDetail> element. However, because an invoice is an itemised transaction, the <salesReportCategory> element does appear in the <transactionItem> element.
<TransactionDetail xmlns="http://xml.inomial.com/smile/2.xsd">
<version>2.0</version>
<transactionType>Invoice</transactionType>
<company>1</company>
<usn>2142421391</usn>
<transactionNumber>21442058</transactionNumber>
<currency>AUD</currency>
<amount>25.00</amount>
<accountType>1</accountType>
<gstAmount>2.27</gstAmount>
<entryTimestamp>2011-11-16T15:37:42.742+11:00</entryTimestamp>
<formattedAmount currency="AUD" formatted="$25.00">25.00</formattedAmount>
<formattedGstAmount currency="AUD" formatted="$2.27">2.27</formattedGstAmount>
<unallocatedAmount>25.00</unallocatedAmount>
<enteredByUsn>2142421409</enteredByUsn>
<logTimestamp>2012-01-10T15:37:42.842+11:00</logTimestamp>
<formattedUnallocatedAmount currency="AUD" formatted="$25.00">25.00</formattedUnallocatedAmount>
<transactionDate>2011-11-16+11:00</transactionDate>
<dueDate>2011-11-30+11:00</dueDate>
<openDate>2011-11-16+11:00</openDate>
<closeDate>2012-01-10+11:00</closeDate>
<quoteNumber>21442058</quoteNumber>
<createdByUsn>2142421409</createdByUsn>
<discount>0.00</discount>
<transactionSource>Manual</transactionSource>
<transactionItem>
<usn>2142421391</usn>
<lineNumber>0</lineNumber>
<itemCode>000286</itemCode>
<chargeFrom>2011-11-16+11:00</chargeFrom>
<chargeTo>2011-11-16+11:00</chargeTo>
<description>Prepaid time purchased</description>
<quantity>1.000</quantity>
<currency>AUD</currency>
<amount>22.73</amount>
<isGst>false</isGst>
<chargeGst>true</chargeGst>
<discount>0.00</discount>
<count>0</count>
<gstAmount>2.270000</gstAmount>
<salesReportCategory>invoice</salesReportCategory>
</transactionItem>
<transactionItem>
<usn>2142421391</usn>
<lineNumber>1</lineNumber>
<itemCode>gst</itemCode>
<chargeFrom>2011-11-16+11:00</chargeFrom>
<chargeTo>2011-11-16+11:00</chargeTo>
<description>Includes 10% GST</description>
<quantity>1.000</quantity>
<currency>AUD</currency>
<amount>2.27</amount>
<isGst>true</isGst>
<chargeGst>false</chargeGst>
<discount>0.00</discount>
<count>0</count>
<gstAmount>0.000000</gstAmount>
<salesReportCategory>invoice</salesReportCategory>
</transactionItem>
</TransactionDetail>
Faults
AccountTransactionExceptionThis fault is returned when the specified transaction number does not exist or cannot be retrieved, or the caller does not have permission to retrieve the transaction.
Java client syntax
java -cp build/smilewsv2-client.jar [options] com.inomial.smile.client.v2.examples.GetTransaction transactionNumber
- transactionNumber
- Purpose: Specifies the transaction number of the transaction to retrieve.