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/v2/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.
| 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) | כתובת דוא"ל | E-Mail address | null | |
| TransAgent | number | העברה בין מחסנים: סוכן מקור | Transfer between warehouses: Source agent | 0 |
| TransStore | number | העברה בין מחסנים: מחסן מקור | Transfer between warehouses: Source warehouse | 1 |
| CurrencyCode | string(5) values | מטבע | currency | null |
| MainRate | number | שער למטבע המסמך | currency rate | null |
| EvalCurrencyCode | string(5) values | מטבע לשערוך | The revaluation currency | null |
| Rate | number | שער לשערוך בהנהח"ש | Rate for revaluation | null |
| ExtraText1 | String(max 50) | הערה נוספת 1 | Extra text 1 | null |
| ExtraText2 | String(max 50) | הערה נוספת 2 | Extra text 2 | null |
| ExtraText3 | String(max 50) | הערה נוספת 3 | Extra text 3 | null |
| ExtraText4 | String(max 50) | הערה נוספת 4 | Extra text 4 | null |
| ExtraText5 | String(max 50) | הערה נוספת 5 | Extra text 5 | null |
| ExtraSum1 | Float number | סכום נוסף 1 | Extra sum 1 | null |
| ExtraSum2 | Float number | סכום נוסף 2 | Extra sum 2 | null |
| ExtraSum3 | Float number | סכום נוסף 3 | Extra sum 3 | null |
| ExtraDate1 | Date string – yyyy-mm-dd | תאריך נוסף 1 | Extra date 1 | null |
| ExtraDate2 | Date string – yyyy-mm-dd | תאריך נוסף 2 | Extra date 2 | null |
| ExtraNum1 | Integer number | מספר נוסף 1 | Extra number 1 | null |
| ExtraNum2 | Integer number | מספר נוסף 2 | Extra number 2 | null |
| Copies | Integer number | מספר עותקים להדפסה | Number of print copies | From company definition |
| PrintStyle | Integer number | מזהה פורמט הדפסה | Print format ID | From company definition |
| taxnum | Integer number | מספר הקצאה (חשבונית רכש, חשבונית שריון ספק וחשבונית סוכן) | Allocation number (Purchase invoice, supplier reserve invoice and agent invoice) | null |
| cancelvat | boolean | ביטול מע"מ | Cancel VAT | 0 |
| new_round | numeric (0-3) | שיטת העיגול במסמך: 0 - ללא עיגול 1 - עיגול לעשרות אגורות 2 - עיגול לשקלים 3 - עיגול לעשרות שקלים | Rounding method in document: 0 – No rounding 1 – Round to the nearest tenth of a monetary unit 2 – Round to the nearest whole monetary unit 3 – Round to the nearest ten monetary units | 0 |
| change_t | numeric (1-3) | 1-מחשב סה"כ לפי %הנחה. 2-מחשב סה"כ לפי סכום הנחה. 3-מעדכן % הנחה לפי סה"כ במסך(Tftal). | 1-Calculate total by % discount. 2-Calculate total by discount amount. 3-Updates % discount by total on screen(Tftal). | 1 |
Sub-transactions for each StockID
The following parameters should be included in a moves array.
| Sub-transactions | Type | Description | תיאור | Default Value |
|---|---|---|---|---|
| StockID | Integer number |