Skip to main content

Journal transactions

A journal 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 two types:
    • Detail lines.
    • 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.

It is possible to post several types of journal transactions:

  • Journal
  • Wage journal
  • Opening balance journal (can only be posted to period 0)
  • Year end journal (can only be posted to period 55)

Read

Web service type: XML Web Services

XML

This example reads the journal transaction of transaction type MEMO and transaction number 202100001.

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

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

Create/Update

If the journal 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 journal transaction. Only used in the request XML.
temporary = journal transaction will be saved as provisional
final = journal transaction will be saved as final
@locationAttribute to indicate the destiny of the journal transaction. Only used in the response XML.
temporary = journal transaction is saved as provisional
final = journal 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 journal transaction.
linesContains the journal transaction lines.
XML structure
<header>
<office></office>
<code></code>
<number></number>
<period></period>
<currency></currency>
<regime></regime>
<date raisewarning=""></date>
<freetext1></freetext1>
<freetext2></freetext2>
<freetext3></freetext3>
</header>

Element name: header

NameTypeDescription
officecodeOffice code.
codecodeTransaction type code.
numberintegerTransaction number.
When creating a new journal transaction, don't include this tag as the transaction number is determined by the system. When updating a journal 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.
regimestringType of regime. You can post transactions as 'Fiscal', 'Commercial', 'Economic' or 'Generic'. The default regime is 'Generic'. 'Generic' means that the transaction is visible for all regimes.
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.
origincodeThe journal transaction origin.
Read-only attribute.
modificationdatestringThe date/time on which the journal transaction was modified the last time.
Read-only attribute.
userstringThe user who created the journal 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.

Journal transaction lines

XML structure
Detail line
<line type="" id="">
<dim1></dim1>
<dim2></dim2>
<dim3></dim3>
<dim4></dim4>
<debitcredit></debitcredit>
<basevalue></basevalue>
<rate></rate>
<value></value>
<reprate></reprate>
<repvalue></repvalue>
<duedate></duedate>
<currencydate></currencydate>
<invoicenumber></invoicenumber>
<description></description>
<vatcode></vatcode>
<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>
<baseline></baseline>
<freechar></freechar>
<comment></comment>
</line>

Element name: lines

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
@typedetail
vat
Line type.
@idintegerLine ID.
dim1string(16)If line type = detail the journal 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 = detail the customer or supplier or the cost center or empty.
If line type = vat empty.
dim3string(16)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
The debit/credit indicator of the journal transaction line.
valuemoneyIf 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.
invoicenumberstring(40)Invoice number. Only if line type is detail.
matchstatusavailable
matched
proposed
notmatchable
Payment status of the journal transaction.
If line type 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 journal 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 journal 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.
baselineintegerOnly if line type is vat. The value of the baseline tag is a reference to the line ID of the VAT rate.
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 journal 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>MEMO</code>
<currency>EUR</currency>
<date>20211104</date>
</header>
<lines>
<line type="detail" id="1">
<dim1>4008</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 journal transaction of transaction type MEMO and transaction number 202100001.

info

Only journal transactions with status provisional can be posted.

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

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

Delete

Web service type: XML Web Services

XML

This example deletes the journal transaction of transaction type MEMO and transaction number 202100001.

info

Only journal transactions with status provisional can be deleted.

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

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