Skip to main content

Bank transactions

A bank transaction is made up of two elements in Twinfield:

  • General information (header), such as company, day book, transaction date, currency, etc.
  • Transaction lines (lines), of which there are three types:
    • Total line, with any relevant bank details.
    • Detail lines, which are an analysis of the total line.
    • VAT lines, with totals per VAT rate and the amounts on which the VAT was calculated.

A minimum of two transaction lines must be provided per day book.

Read

Web service type: XML Web Services

XML

This example reads the bank transaction of transaction type BNK and transaction number 202100001.

info

The used transaction type, in the example below BNK depends on the administration. It is possible that there are multiple bank day book codes in an administration.

<read>
<type>transaction</type>
<office>001</office>
<code>BNK</code>
<number>202100001</number>
</read>

If the bank transaction does not exist an empty transaction element is returned containing an error.

Create/Update

If the bank transaction is not found it will be automatically created, otherwise it is updated.

Multiple transactions can be created at once by enclosing them by the transactions element.

Root

XML structure
<transaction destiny="" autobalancevat="" raisewarning="">
<header></header>
<lines></lines>
</transaction>

Element name: transaction

NameDescription
@destinyAttribute to indicate the destiny of the bank transaction. Only used in the request XML.
temporary = bank transaction will be saved as provisional
final = bank transaction will be saved as final
@locationAttribute to indicate the destiny of the bank transaction. Only used in the response XML.
temporary = bank transaction is saved as provisional
final = bank transaction is saved as final
@autobalancevatShould VAT be rounded true or not false? Rounding will only be done with a maximum of two cents.
@raisewarningShould warnings be given true or not false? Default true.
headerContains information general to the bank transaction.
linesContains the bank transaction lines.
XML structure
<header>
<office></office>
<code></code>
<number></number>
<period></period>
<currency></currency>
<date raisewarning=""></date>
<statementnumber></statementnumber>
<startvalue></startvalue>
<closevalue></closevalue>
<freetext1></freetext1>
<freetext2></freetext2>
<freetext3></freetext3>
</header>

Element name: header

NameTypeDescription
officecodeOffice code.
codecodeTransaction type code.
numberintegerTransaction number.
When creating a new bank transaction, don't include this tag as the transaction number is determined by the system. When updating a bank transaction, the related transaction number should be provided.
periodstringPeriod in YYYY/PP format. If this tag is not included or if it is left empty, the period is determined by the system based on the provided transaction date.
currencycodeCurrency code.
datedateTransaction date.
Optionally, it is possible to suppress warnings about 'date out of range for the given period' by adding the raisewarning attribute and set its value to false. This overwrites the value of the raisewarning attribute as set on the root element.
statementnumberintegerNumber of the bank statement. Don't confuse this number with the transaction number.
origincodeThe bank transaction origin.
Read-only attribute.
startvaluemoneyOpening balance. If not provided, the opening balance is set to zero.
closevaluemoneyClosing balance. If not provided, the closing balance is set to zero.
modificationdatestringThe date/time on which the bank transaction was modified the last time.
Read-only attribute.
userstringThe user who created the bank transaction.
Read-only attribute.
inputdatestringThe date/time on which the transaction was created.
Read-only attribute.
freetext1textFree text field 1 as entered on the transaction type.
freetext2textFree text field 2 as entered on the transaction type.
freetext3textFree text field 3 as entered on the transaction type.

Bank transaction lines

XML structure
Total line
<line type="" id="">
<dim1></dim1>
<debitcredit></debitcredit>
<basevalue></basevalue>
<rate></rate>
<value></value>
<reprate></reprate>
<repvalue></repvalue>
<invoicenumber></invoicenumber>
<description></description>
<vatbasetotal></vatbasetotal>
<freechar></freechar>
<comment></comment>
</line>
Detail line
<line type="" id="">
<dim1></dim1>
<dim2></dim2>
<debitcredit></debitcredit>
<basevalue></basevalue>
<rate></rate>
<value></value>
<reprate></reprate>
<repvalue></repvalue>
<duedate></duedate>
<currencydate></currencydate>
<invoicenumber></invoicenumber>
<description></description>
<freechar></freechar>
<comment></comment>
</line>
VAT line
<line type="" id="">
<dim1></dim1>
<debitcredit></debitcredit>
<basevalue></basevalue>
<rate></rate>
<value></value>
<reprate></reprate>
<repvalue></repvalue>
<vatbaseturnover></vatbaseturnover>
<vatturnover></vatturnover>
<vatcode></vatcode>
<vatbasevalue></vatbasevalue>
<freechar></freechar>
<comment></comment>
</line>
info

The VAT line is not mandatory. If the VAT fields are used, the calculations are validated. If the VAT amounts in the XML file do not match the amounts calculated by Twinfield the transaction will be rejected. Refer also to VAT Calculation for more information.

NameTypeDescription
@typetotal
detail
vat
Line type.
@idintegerLine ID.
dim1string(16)If line type = total the bank balance account.
If line type = detail the customer or supplier balance account or profit and loss account.
If line type = vat the VAT balance account. When an empty dim1 is entered, by default the general ledger account will be taken as entered at the VAT code in Twinfield.
dim2string(16)If line type = total empty
If line type = detail the customer or supplier or the cost center or empty.
If line type = vat empty.
dim3string(16)If line type = total empty.
If line type = detail the project or asset or empty.
If line type = vat empty.
dim4string(16)Not in use.
dim5string(16)Not in use.
dim6string(16)Not in use.
debitcreditdebit
credit
If line type = total, based on the sum of the individual bank transaction lines. In case of a bank addition debit. In case of a bank withdrawal credit.
If line type = detail, credit in case money is received and debit in case money is paid.
If line type = vat, based on the sum of the vat amounts of the individual bank transaction lins. In case of a bank addition credit. In case of a bank withdrawal debit.
valuemoneyIf line type = total amount including VAT.
If line type = detail amount without VAT.
If line type = vat VAT amount.
basevaluemoneyAmount in the base currency.
ratedecimalThe exchange rate used for the calculation of the base amount.
repvaluemoneyAmount in the reporting currency.
repratedecimalThe exchange rate used for the calculation of the reporting amount.
descriptionstring(40)Description of the transaction line.
vattotalmoneyOnly if line type is total. The total VAT amount in the currency of the bank transaction.
vatbasetotalmoneyOnly if line type is total. The total VAT amount in base currency.
vatreptotalmoneyOnly if line type is total. The total VAT amount in reporting currency.
matchstatusavailable
matched
proposed
notmatchable
Payment status of the bank transaction.
If line type total or vat always notmatchable.
Read-only attribute.
matchlevelintegerOnly if line type is detail. The level of the matchable dimension.
Read-only attribute.
relationintegerOnly if line type is detail.
Read-only attribute.
basevalueopenmoneyOnly if line type is detail. The amount still owed in base currency.
Read-only attribute.
repvalueopenmoneyOnly if line type is detail. The amount still owed in reporting currency.
Read-only attribute.
vatcodecodeOnly if line type is detail or vat. VAT code.
vatvaluemoneyOnly if line type is detail. VAT amount in the currency of the bank transaction.
vatbasevaluemoneyOnly if line type is detail. VAT amount in base currency.
vatrepvaluemoneyOnly if line type is detail. VAT amount in reporting currency.
vatturnovermoneyOnly if line type is vat. Amount on which VAT was calculated in the currency of the bank transaction.
vatbaseturnovermoneyOnly if line type is vat. Amount on which VAT was calculated in base currency.
vatrepturnovermoneyOnly if line type is vat. Amount on which VAT was calculated in reporting currency.
performancetypeservices
goods
Only if line type is detail or vat. Mandatory in case of an ICT VAT code. The performance type.
performancecountrystring(2)Only if line type is detail or vat. Mandatory in case of an ICT VAT code. The ISO country codes are used. If not added to the request, by default the country code of the customer will be taken.
Note: For Greece use country code 'EL' and for Northern Ireland use 'XI'.
performancevatnumberstring(16)Only if line type is detail or vat. Mandatory in case of an ICT VAT code. If not added to the request, by default the VAT number of the customer will be taken.
performancedatedateOnly if line type is detail or vat. Mandatory in case of an ICT VAT code but only if performancetype is services.
destofficecodeOffice code. Used for inter company transactions – here you define in which company the transaction line should be posted.
currencydatedateOnly if line type is detail. The line date. Only allowed if the line date in the bank book is set to Allowed or Mandatory.
freecharstring(1)Free character field.
commentstring(255)Comment set on the transaction line.
matchesnodeContains matching information.

Matches

XML structure
<matches>
<set>
<matchdate></matchdate>
<lines>
<line>
<code></code>
<number></number>
<line></line>
<method></method>
<matchvalue></matchvalue>
</line>
</lines>
<matchvalue></matchvalue>
</set>
</matches>

Element name: matches

NameDescription
setContains information of the match set.

Set

Element name: set

NameTypeDescription
@statustemporary
final
Status of the transaction. temporary if the transaction is posted provisional. final if the transaction is posted final.
matchdatedateMatch date.
matchvaluemoneyMatch value.
linesnodeContains the financial transactions that will be matched.

Transaction lines

Element name: lines

NameTypeDescription
linenodeContains one single line of a financial transaction.

Transaction line

Element name: line

NameTypeDescription
codecodeDaybook code.
numberintegerTransaction number.
lineintegerTransaction line number.
methodpaymentFixed value.
matchvaluemoneyMatch value.

XML Example

<transaction destiny="temporary">
<header>
<office>001</office>
<code>BNK</code>
<currency>EUR</currency>
<date>20211104</date>
<statementnumber>4</statementnumber>
<startvalue>974.01</startvalue>
<closevalue>1409.56</closevalue>
</header>
<lines>
<line type="total" id="1">
<dim1>1010</dim1>
<debitcredit>debit</debitcredit>
<value>435.55</value>
</line>
<line type="detail" id="2">
<dim1>1300</dim1>
<dim2>1000</dim2>
<debitcredit>credit</debitcredit>
<value>435.55</value>
<invoicenumber>11001770</invoicenumber>
<description>Invoice paid</description>
</line>
</lines>
</transaction>

Post

Web service type: XML Web Services

XML

This example posts the bank transaction of transaction type BNK and transaction number 202100001.

info

Only bank transactions with status provisional can be posted.

info

The code, in the example below BNK depends on the administration.

<transaction action="post">
<office>001</office>
<code>BNK</code>
<number>202100001</number>
</transaction>

If the bank transaction does not exist a transaction element is returned containing an error.

Delete

Web service type: XML Web Services

XML

This example deletes the bank transaction of transaction type BNK and transaction number 202100001.

info

Only bank transactions with status provisional can be deleted.

info

The code, in the example below BNK depends on the administration.

<transaction action="delete" reason="Test bank transaction, can be deleted.">
<office>001</office>
<code>BNK</code>
<number>202100001</number>
</transaction>

If the bank transaction does not exist a transaction element is returned containing an error.