Import Journal transactions
NodeJS Example File
JurnalApiExample.js
| Method | Description |
|---|---|
| tmpBatch | Imports the transactions to a new or already existing temporary batch |
| chkBatch | Checks if there are errors in the batch |
| newBatch | Opens a new batch and returns the number |
| issueBatch | Checks 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 API | jtransApi/tmpBatch |
| NodeJS | tmpJurnalBatch |
| Parameters | Description | Parameter Options/value | Default |
|---|---|---|---|
| insertolastb | Insert the transactions to the last open temporary batch. If false, open a new batch. | true false | false |
| batchNo | Insert the transactions to the temporary batch having this number. If no such temporary batch exists, open a new batch. | Batch number | New batch |
| check | check the batch for errors and return the batch status | true false | false |
| issue | input the temporary batch into the permanent storage. | true false | false |
| rows Required | trans object array | See table below | |
| moves Required | sub-transactions array for each rows array | See table below |
JSON Body Example
{
...
"rows": [
{
...
"moves": [
{
...
},
{
...
}
]
},
{
...
"moves": [
{
...
}
]
}
]
}
FieldName-trans
The following parameters should be included in a rows array (see example below)
| FieldName-trans | Type | תיאור | Description | Defaults |
|---|---|---|---|---|
| TransDebID Required | String (max 15) | מפתח חשבון חובה ראשי | Main debit account key | |
| TransCredID Required | String (max 15) | מפתח חשב ון זכות ראשי | Main credit account key | |
| DebName | String (max 50) | שם חשבון חובה ראשי | Name of the main debit account | DebName of the TransDebID |
| CredName | String (max 50) | שם חשבון זכות ראשי | Name of the main credit account | CredName of the TransCredID |
| Description | String (max 250) | פרטים | Details | Empty value |
Additional fields
| Referance | Integer number | אסמכתא | Reference | null |
| Ref2 | Integer number | אסמכתא שנייה | Reference-2 | null |
| TransType | String (max 3) | קוד סוג תנועה | Transaction type code | Empty value |
| CurrencyCode | String (max 5) values | מטבע | Currency | CompanyEC i |
| ValueDate | Date string –dd/mm/yyyy | תאריך אסמכתא | Date | Today date |
| DueDate | Date string – dd/mm/yyyy | תאריך ערך | Due date | Today date |
| CostCode | Integer number | קוד תמחיר (קוד קיים). | Cost-center code (existing code) | Empty value |
| SuF | Float number | סכום כולל חובה או זכות | Total NIS amount (credit or debit) | 0 |
| SuFDlr | Float number | סכום כולל מט"ח | Total amount in foreign currency | 0 |
| Ref3 | Integer number | אסמכתא שלישית | Referenc-3 | null |
| DatF3 | Date string – dd/mm/yyyy | תאריך נוסף | Additional date | Today date |
| Quant | Float number | כמות | Quantity | 0 |
| Branch | Integer number | סניף | Branch | 8 |
| Details | String (max 50) | הערות | Remarks | null |
| Det2 | String (max 50) | הערות נוספות | Additional remarks | null |
| Osek874 | String (max 9) | מספר עוסק מורשה | VAT registration number | Empty value |
| TaxApiNumber | String (max 250) | מספר הקצאה | Allocation number | null |
| PdfFileUrl | String (max 2048) | קישור חיצוני לחשבונית (PDF) | Link to an external invoice (PDF) | null |
Sub-transactions for each transaction
The following parameters should be included in a moves array (see example below)
| Sub-transactions | Type | Description | תיאור | Defaults |
|---|---|---|---|---|
| AccountKey | String (max 15) | מפתח חשבון | Account key | |
| DebitCredit | Debit=1, Credit=0 | חובה/זכות | Credit/Debit | |
| Suf | Float number | סכום | NIS amount | 0 |
| SufDlr | Float number | סכום מט"ח | Foreign currency amount | 0 |
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 API | jtransApi/chkBatch |
| NodeJS | chkJurnalBatch |
| Parameters | Description | Parameter 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 |
| NodeJS | newJurnalBatch |
Push to Permanent Storage
Checks and inputs the temporary batch into the permanent storage.
| REST API | jtransApi/issueBatch |
| NodeJS | issueJurnalBatch |
| Parameters | Description | Parameter Options/value |
|---|---|---|
| batchNo Required | The batch number you want to push | Batch number |
JSON Example
{
"batchNo": 626
}
Journal transactions OutputData
| Name | Options |
|---|---|
| statusCode | 200 – OK / 500 - Errors |
| status | |
| batchno | Batch number |
| batch_issue | OK if issued |
| batch_check | OK / Errors |
| errors | OK / Errors: "error description" / No Permission |