Post transaction
BetaChanges data
Posts a sales, purchase, journal, cash or bank transaction in Twinfield.
Settings
| Setting | What it is |
|---|---|
| ConnectionRequired | The Twinfield connection the step signs in with. |
| Company code | Leave empty to use the company code on the connection. |
| Day bookRequired | The Twinfield transaction type — VRK for sales, INK for purchase, MEMO for a journal entry. |
| Transaction number | Fill this in to CHANGE a provisional transaction. Leave it empty and Twinfield assigns a new number, which means a second run posts a second transaction. |
| Post as | Only a provisional transaction can still be changed or deleted. |
| Date | Twinfield writes dates as yyyymmdd. |
| Period | The bookkeeping period this entry lands in. |
| Currency | text |
| Invoice number | text |
| Due date | text |
| Payment reference | text |
| Free text 1 | text |
| Free text 2 | text |
| Free text 3 | text |
| Let Twinfield balance the VAT | true/false |
| Report Twinfield's warnings | Off, Twinfield keeps its warnings to itself and posts anyway. |
| Lines | The debit and credit sides have to balance, unless Twinfield balances the VAT for you. |
| Lines (JSON) | Lines an earlier node built, instead of the rows above — for example [{"@type":"total","dim1":"1300","debitcredit":"debit","value":"121.00"},{"@type":"detail","dim1":"8000","debitcredit":"credit","value":"100.00","vatcode":"VH"}] |
Technical details
| Key | Value |
|---|---|
connection | texta connection id from `requires.connections` (provider `twinfield`) |
office | text |
transactionCode | text |
transactionNumber | text |
destiny | "temporary" or "final", by default "temporary" |
date | text |
period | text |
currency | text |
invoiceNumber | text |
dueDate | text |
paymentReference | text |
freeText1 | text |
freeText2 | text |
freeText3 | text |
autoBalanceVat | true/false, by default true |
raiseWarning | true/false, by default false |
lines | list of {type?: "total" or "detail" or "vat", dim1?: text, dim2?: text, debitCredit?: "debit" or "credit", value?: text, vatCode?: text, description?: text}, by default [] |
linesJson | text |
Output
| Field | Type |
|---|---|
transaction | object |
transactionNumber | string |
resultTwinfield's own result marker | string |
Sample output, and the expression for each field
- result"1"
- transaction
- header
- [0]
- number
- [0]"202100095"
- number
- [0]
- result"1"
- header
- transactionNumber"202100095"
Errors
When a step of this node stops a run, the run page shows a code. Look it up:
Example step
The step as a flow file holds it. Replace each value in <…>.
{
"config": {
"autoBalanceVat": true,
"connection": "<connection id>",
"currency": "",
"date": "",
"destiny": "temporary",
"dueDate": "",
"freeText1": "",
"freeText2": "",
"freeText3": "",
"invoiceNumber": "",
"lines": [],
"linesJson": "",
"office": "",
"paymentReference": "",
"period": "",
"raiseWarning": false,
"transactionCode": "<day book>",
"transactionNumber": ""
},
"label": "Post transaction",
"type": "twinfield.postTransaction",
"version": 1
}