Skip to main content

Import Journal transactions

NodeJS Example File

JurnalApiExample.js

MethodDescription
tmpBatchImports the transactions to a new or already existing temporary batch
chkBatchChecks if there are errors in the batch
newBatchOpens a new batch and returns the number
issueBatchChecks and inputs the temporary batch into the permanent storage

Import to Temp Batch

Imports the transactions to a new or already existing temporary batch. You can check for errors or input the batch into the permanent storage (if no errors were found).

REST APIjtransApi/tmpBatch
NodeJStmpJurnalBatch

ParametersDescriptionParameter Options/valueDefault
insertolastbInsert the transactions to the last open temporary batch.
If false, open a new batch.
true
false
false
batchNoInsert the transactions to the temporary batch having this number.
If no such temporary batch exists, open a new batch.
Batch numberNew batch
checkcheck the batch for errors and return the batch statustrue
false
false
issueinput the temporary batch into the permanent storage.true
false
false
rows
Required
trans object arraySee table below
moves
Required
sub-transactions array for each rows arraySee table below

JSON Body Example

{
...

"rows": [
{
...
"moves": [
{
...
},
{
...
}
]
},
{
...
"moves": [
{
...
}
]
}
]
}

FieldName-trans

The following parameters should be included in a rows array (see example below)

FieldName-transTypeתיאורDescriptionDefaults
TransDebID
Required
String (max 15)מפתח חשבון חובה ראשיMain debit account key
TransCredID
Required
String (max 15)מפתח חשבון זכות ראשיMain credit account key
DebNameString (max 50)שם חשבון חובה ראשיName of the main debit accountDebName of the TransDebID
CredNameString (max 50)שם חשבון זכות ראשיName of the main credit accountCredName of the TransCredID
DescriptionString (max 250)פרטיםDetailsEmpty value
Additional fields
ReferanceInteger numberאסמכתאReference0
Ref2Integer numberאסמכתא שנייהReference-20
TransTypeString (max 3)קוד סוג תנועהTransaction type codeEmpty value
CurrencyCodeString (max 5)
values
מטבעCurrencyCompanyEC i
ValueDateDate string –dd/mm/yyyyתאריך אסמכתאDateToday date
DueDateDate string – dd/mm/yyyyתאריך ערךDue dateToday date
CostCodeInteger numberקוד תמחיר (קוד קיים).Cost-center code (existing code)Empty value
SuFFloat numberסכום כולל חובה או זכותTotal NIS amount (credit or debit)0
SuFDlrFloat numberסכום כולל מט"חTotal amount in foreign currency0
Ref3Integer numberאסמכתא שלישיתReferenc-30
DatF3Date string – dd/mm/yyyyתאריך נוסףAdditional dateToday date
QuantFloat numberכמותQuantity0
BranchInteger numberסניףBranch8
DetailsString (max 50)הערותRemarksnull
Det2String (max 50)הערות נוספותAdditional remarksnull
Osek874String (max 9)מספר עוסק מורשהVAT registration numberEmpty value
TaxApiNumber String (max 250)מספר הקצאהAllocation numbernull

Sub-transactions for each transaction

The following parameters should be included in a moves array (see example below)

Sub-transactionsTypeDescriptionתיאור Defaults
AccountKey
Required
String (max 15)מפתח חשבוןAccount key
DebitCredit
Required
Debit=1, Credit=0חובה/זכותCredit/Debit
Suf Float numberסכוםNIS amount0

Either 'Suf' or 'SufDlr' is Required

SufDlrFloat numberסכום מט"חForeign currency amount0

JSON Example

{
"insertolastb": true,
"check": true,
"batchNo": 17,
"issue": true,
"rows": [
{
"TransDebID": "30000",
"TransCredID": "40001",
"Description": "חשבוניות חייבות במעמ",
"Referance": "36",
"Ref2": "13",
"Ref3": "13",
"TransType": "חל1",
"ValueDate": "13/12/2021",
"DueDate": "13/12/2021",
"SuF": 1803.97,
"moves": [
{
"AccountKey": "30000",
"DebitCredit": "1",
"SuF": 1803.97
},
{
"AccountKey": "40001",
"DebitCredit": "0",
"SuF": 1541.85
},
{
"AccountKey": "60001",
"DebitCredit": "0",
"SuF": 262.12
}
]
},
{
"TransDebID": "30005",
"TransCredID": "45001",
"Description": "חשבוניות פטורות ממעמ",
"Referance": "9",
"Ref2": "13",
"Ref3": "13",
"TransType": "חלפ",
"ValueDate": "13/12/2021",
"DueDate": "13/12/2021",
"SuF": 291.23,
"moves": [
{
"AccountKey": "30005",
"DebitCredit": "1",
"SuF": 291.23
},
{
"AccountKey": "45001",
"DebitCredit": "0",
"SuF": 291.23
}
]
},
{
"TransDebID": "15001",
"TransCredID": "30000",
"Description": "תקבולים לחשבון מזומן",
"Referance": " 31",
"Ref2": " 13",
"Ref3": " 13",
"ValueDate": "13/12/2021",
"DueDate": "13/12/2021",
"SuF": 1745.50,
"moves": [
{
"AccountKey": "15001",
"DebitCredit": "1",
"SuF": 1745.50
},
{
"AccountKey": "30000",
"DebitCredit": "0",
"SuF": 1745.50
}
]
}
]
}

Check Errors

Checks if there are errors in the batch

REST APIjtransApi/chkBatch
NodeJSchkJurnalBatch

ParametersDescriptionParameter Options/value
batchNo
Required
The batch number you want to check Batch number

JSON Example

{
batchNo: 626
}

Open New Batch

Opens a new batch and return the number

REST API jtransApi/newBatch
NodeJSnewJurnalBatch

Push to Permanent Storage

Checks and inputs the temporary batch into the permanent storage.

REST APIjtransApi/issueBatch
NodeJSissueJurnalBatch

ParametersDescriptionParameter Options/value
batchNo
Required
The batch number you want to push Batch number

JSON Example

{
batchNo: 626
}

Journal transactions OutputData

NameOptions
statusCode200 – OK / 500 - Errors
status
batchnoBatch number
batch_issueOK if issued
batch_checkOK / Errors
errorsOK / Errors: "error description" / No Permission