TransactionClosed

Smile emits this message when a transaction is closed and the transaction value is added to the account balance.

Transactions may be open for some time before they are closed, for example, quotes or credit card payments pending bank approval. Other transactions are closed immediately, for example, invoices, receipts for cash payments and adjustments.

Message header

The following table lists the parameters in the TransactionClosed message header.

Table 1. TransactionClosed header parameters
Parameter Type Values
version string "2.0"
usn string The unique subscription number for the account that the transaction applies to
company integer The company ID this account belongs to
currency string The ISO 4217 currency code of this account and transaction
amount decimal The value of this transaction
accountType integer The ID of the account type, as defined in Smile
transactionNumber string The transaction number that Smile generates to identify the transaction
transactionType string "CreditNote", "CreditTransferCredit", "CreditTransferDebit", "DebitNote", "Invoice", "InvoiceReversal", "ItemisedCredit", "ItemisedCreditReversal", "ItemisedDebit", "ItemisedDebitReversal", "Quote", "Receipt", "ReceiptReversal", "RecipientCreatedTaxInvoice", "RecipientCreatedTaxInvoiceReversal", "Surcharge", "SurchageReversal", "TransferredCredit" or "TransferredDebit"
smileMessageType string "TransactionClosed"
eventType string "TransactionClosed"

Message body

For itemised transactions (invoices, RCTIs and itemised credits and debits), the message body contains the <ItemisedTransactionDetailEvent> element and has the following format:
{http://xml.inomial.com/smile/2.xsd}ItemisedTransactionDetailEvent
For all other transactions, the message body contains the <TransactionDetailEvent> element and has the following format:
{http://xml.inomial.com/smile/2.xsd}TransactionDetailEvent

Example: The <TransactionDetailEvent> element

This example shows a TransactionDetailEvent XML document that contains the <TransactionDetailEvent> element. This example is for a non-itemised (receipt) transaction.

<TransactionDetailEvent xmlns="http://xml.inomial.com/smile/2.xsd">
  <transactionEventType>TransactionClosed</transactionEventType>
  <transaction>
    <version>2.0</version>
    <transactionType>Receipt</transactionType>
    <company>1</company>
    <usn>1000000008</usn>
    <transactionNumber>RCPT1000265</transactionNumber>
    <currency>AUD</currency>
    <amount>-221.55</amount>
    <accountType>1</accountType>
    <gstAmount>0</gstAmount>
    <entryTimestamp>2012-08-09T14:17:19.683+10:00</entryTimestamp>
    <salesReportCategory>receipt</salesReportCategory>
    <formattedAmount currency="AUD" formatted="$(221.55)">-221.55</formattedAmount>
    <formattedGstAmount currency="AUD" formatted="$0.00">0</formattedGstAmount>            
    <unallocatedAmount>-221.55</unallocatedAmount>
    <enteredByUsn>1000000016</enteredByUsn>
    <logTimestamp>2012-08-09T14:17:19.685+10:00</logTimestamp>
    <formattedUnallocatedAmount currency="AUD" formatted="$(221.55)">-221.55</formattedUnallocatedAmount>     
  </transaction>
</TransactionDetailEvent>