Import Documents
NodeJS Example File
DocumentApiExample.js
| Method | Description |
|---|---|
| createDoc | Imports and updates new or already existing temporary documents |
| issueDocument | Check issue and input the document to the permanent storage |
| delDocument | Delete document from tables |
| addLineDoc | Add a line or multiple to a temporary document |
| delLine | Delete a line or multiple from a temporary document |
| getDoc | Show document data |
| invoiceDecision | In case of error 460 Invoice Rejection from the Tax Authority |
| restoreDoc | Restore a specific document |
Creating Documents
Imports and updates new or already existing temporary documents. You may check for errors or issue and input the documents into the permanent storage (if no errors were found).
| REST API | invApi/createDoc |
| NodeJS | createDocument |
| Parameters | Description | Parameter Options/value | Default value |
|---|---|---|---|
| issueStock | issue the document | true / false | false |
| deleteTemp | if errors found, delete document or not | true / false | false |
| rows Required | document data object | See table below | |
| moves Required | sub-transactions array for each rows array | See table below | |
| matrix | sub-transactions array for each moves array | See table below |
JSON Body Example
{
...
"rows": {
...
"moves": [
{ ... },
{ ...
"matrix": [
{
...
}
]
}
]
}
}
FieldName-stock
The following parameters should be included in a rows object (see example below)
| FieldName-stock | Type | Description | תיאור | Default Value |
|---|---|---|---|---|
| StockID | Integer number | מזהה טבלת stock. כאשר מעדכנים מסמך, חייבים להעביר מזהה. i אם שולחים StockID אמצעי התשלום הקיימים ידרסו ע"י מה שנשלח בעדכון. | ID in the stock table. Required when updating an existing document. i When sending a StockID, the existing payment methods will be overwritten by what is sent in the update. | 0 |
| DocumentID Required | Integer number | סוג מסמך (לפי הגדרות בטבלת DocumentsDef) | Document type (according to the DocumentDef table) | |
| DocNumber | Integer number | מספר המסמך. הספרור של מסמכים בעלי ספרור קשיח נקבע בעת ההפקה | Document number. When the document numeration is unchangeable, the number is determined when the document is issued. | 1 |
| AccountKey Required | String (max 15) | מפתח חשבון (לקוח/ספק) | The customer or supplier account key |
Additional fields
| AccountName | String (max 50) | שם חשבון | Account name | null |
| Address | String (max 100) | כתובת | Address | null |
| City | String (max 50) | עיר | City | null |
| Phone | String (max 30) | טלפון | Phone | null |
| ValueDate | Date string – yyyy-mm-dd | תאריך | Date | null |
| DiscountPrc | Float number | אחוז הנחה כללית במסמך | % of general discount | null |
| Tftal | Float number | סכום כולל של מסמך | Total amount | null |
| SumDiscount | Float number | סכום ההנחה במסמך | The discount amount | null |
| Ref3 | Integer number | אסמכתא 3 | Reference-3 | 0 |
| Remarks | String (max 250) | הערות | Remarks | null |
| Details | String (max 250) | פרטים | details | null |
| Warehouse | Integer number | מחסן | Warehouse | null |
| Agent | Integer number | סוכן | Salesperson | null |
| CostCode | String (max 8) | קוד תמחיר קיים | Existing cost center code | null |
| Quantity | Float number | כמות | Quantity | 0 |
| Osek874 | String (max 9) | עוסק מורשה | VAT registration number | null |
| InterFlag | Integer number | קליטת נתונים בחנות וירטואלית | Import data for virtual store | 0 |
| String (max 45) |