Import Indexes
NodeJS Example File
IndexApiExample.js
Import or Update Records
Imports or updates records to the selected index
| REST API | IndexApi/importIndex |
| NodeJS | importIndexRecords |
| Parameters | Description | Parameter Options/value | Default |
|---|---|---|---|
| myindex Required | acc- for accounts itm- for items | 'acc' 'itm' | |
| insertnew | If true, allow inserting new records. If false (and if updexist='true') only update is allowed | true false | false |
| updexist | If true, allow updates to the records value | true false | false |
| rows Required | items/accounts object array | for 'acc' - see table below for 'itm' - see table below |
JSON Body Example
{
...
"rows": [
{
...
},
{
...
}
]
}
Accounts Data
The following parameters should be included in a rows array when "myindex": "acc" (see example below)
| FieldName-trans | Type | תיאור | Description | Defaults |
|---|---|---|---|---|
| AccountKey Required | String (max 15) | מפתח חשבון | Account key | |
| FullName | String (max 50) | שם | Name | null |
| SortGroup | Integer number | מיון | Sorting code | 0 |
| Address | String (max 50) | כתובת | Address | null |
| City | String (max 20) | עיר | City | null |
Additional fields
| Zip | String (max 10) | מיקוד | Zip code | null |
| Country | String (max 20) | מדינה | Country | null |
| Phone | String (max 30) | טלפון | Phone | null |
| Fax | String (max 30) | פקס | Fax | null |
| BalanceCode | Integer number values | קוד מאזן | Code for the balance and profit and loss report | 68 |
| CreditTermsCode | Integer number | קוד פיצול תשלומים | Split payment code | 1 |
| TFtalDiscount | Float number | % הנחה ללקוח | % customer discount | 0 |
| VatExampt | 0 - Not Exempt 1 - Exempt | פטור ממע"מ | VAT exempt | 0 |
| Filter | String (5) | חתך | Filtering | ^^^^^ |
| WorF | String (max 15) | עיסוק | Occupation | null |
| Details | String (max 50) | הערות | Remarks | null |
| AvgLatePay | Integer number | ממוצע איחור תשלומים | Average delay of payments | 0 |
| MaxCredit | Float number | תקרת אשראי | Credit limit | 0 |
| MaxCreditCurrency | String (max 5) values | מטבע אשראי | Credit currency | CompanyMC i |
| MaxObligo | Float number | תקרת אובליגו | Credit risk limit | 0 |
| MaxObligoCurrency | String (max 5) values | מטבע אובליגו | Credit risk currency | CompanyMC i |
| CustomerNote | String (max 250) | הודעת לקוח | Message for the customer | null |
| AssignKey | String (max 15) | מפתח חשבון מרכז (מפתח קיים) | Central account key (existing account) | null |
| Agent | Integer number | סוכן | Salesperson | 0 |
| DeductionPrc | Float number | % ניכוי במקור | % withholding tax | 0 |
| DeductionValid | Date string – dd/mm/yyyy | תוקף ניכוי במקור | Validity date of the % withholding tax | 1991/01/01 |
| BankCode | String (max 2) | קוד בנק | Bank code | null |
| BranchCode | String (max 5) | סניף בנק | Bank branch code | null |
| BankAccount | String (max 20) | מספר חשבון בנק | Bank account # | null |
| TaxFileNum | String (max 9) | מספר עוסק מורשה | VAT registration number | null |
| MainAccount | Integer number values | קוד חשבון ראשי | Code of the main account | 26 |
| FixedOrderCost | Float number | מחיר הזמנה קבוע | Fix cost of order | 0 |
| AverageSupplyPeriod | Float number | זמן אספקה ממוצע | Average supply time | 0 |
| CostCode | String (max 8) | קוד תמחיר (חייב להיות קיים) | Code of cost center (existing code) | null |
| DifferAcc | String (max 15) | חשבון הפרשים ( חשבון קיים) | Account key for small differences (existing account) | null |
| MatchCurr | String (max 5) values | מטבע ההתאמה במקרה של מט"ח | Currency for reconciliation (when the price is in foreign currency) | CompanyMC i |
| String (max 50) | כתובת דוא"ל | E-Mail address | null | |
| DeductFile | String (max 20) | מספר תיק מס הכנסה | Income file number | null |
| DocCurr | String (max 5) values | מטבע ברירת מחדל למסמכי מט"ח | Default value for foreign currency | CompanyEC i |
| WebSite | String (max 250) | אתר | Web site | null |
| DeductType | Integer number values | סוג ניכוי במקור | Deduct Type | 0 |
| TaxRepCode | Integer number values | סעיף חשבונאי (6111) | Tax Rep Code | 99990 |
| Computerized | 0/1/2 | שליחה חשבוניות דיגיטלית 0 = הפקה לא דיגיטלית (הדפסה) 1 = שליחת חשבוניות מקור דיגיטליות והזמנות בדוא"ל, ללא תצוגה לפני השליחה 2 = שליחת חשבוניות מקור דיגיטליות והזמנות בדוא"ל, לאחר תצוגה לפני השליחה (הפקת חשבונית דרך הapi ישלח בתגובה url לתצוגה.) | Sending a digital invoice 0 - Non-digital (print) 1 - Email digital invoices and orders, without preview 2 - Email digital invoices and orders, after a preview (Generating an invoice through the api will return a display url.) | 0 |
| MailReceipt | 0/1/2 | שליחת קב לות דיגיטלית 0 = הפקה לא דיגיטלית (הדפסה) 1 = שליחת קבלות מקור דיגיטליות בדוא"ל, ללא תצוגה לפני השליחה 2 = שליחת קבלות מקור דיגיטליות בדוא"ל, לאחר תצוגה לפני השליחה (הפקת קבלה דרך הapi ישלח בתגובה url לתצוגה.) | Sending a digital receipts 0 - Non-digital (print) 1 - Email digital receipts, without preview 2 - Email digital receipts, after a preview (Generating a receipt through the api will return a display url.) | 0 |
| BooksPermission | 0/1 | אישור ניהול ספרים | Bookkeeping authorization | 0 |
| b2bflag | 0/1 | לקוח עסקי | b2b | 0 |
| StockPerUnit | 0/1 | לקוח עסקי | b2b | 0 |
JSON Example
{
"myindex": "acc",
"insertnew": "true",
"rows": [
{
"AccountKey": "acc123",
"FullName": "name of acc123",
"SortGroup": "258",
"CostCode": "22",
"AssignKey": "777",
"DeductionPrc": 10.5,
"DeductionValid": "28/02/2019"
},
{
"AccountKey": "8888123664",
"FullName": "8888 name new",
"SortGroup": "1234",
"CostCode": "1"
}
]
}
Items Data
The following parameters should be included in a rows array when "myindex": "itm"
| FieldName-trans | Type | תיאור | Description | Default |
|---|---|---|---|---|
| ItemKey Required | String (max 20) | מפתח פריט | Item key | |
| ItemName | String (max 100) | שם פריט | Item name | null |
| ForignName | String (max 100) | שם לועזי | Item name for export documents | null |
| SortGroup | Integer number | מיון | Sorting code | 0 |
| Filter | String (10) | חתך | Filtering | ^^^^^^^^^^ |
| Price | Float number | מחיר מכירה | List price | 0 |
Additional fields
| Currency | String (max 5) values | מטבע מכירה | List price currency | CompanyMC i |
| CostCode | String (max 8) | קוד תמחיר (חייב להיות קיים) | Code of cost center (existing code) | null |
| Quantity | Float number | יתרה במלאי | Inventory balance | 0 |
| VatExampt | 0 - Not Exempt 1 - Exempt | פטור ממע"מ | VAT exempt | 0 |
| DiscountCode | String (max 5) | קוד הנחה | Discount code | null |
| DiscountPrc | Float number | % הנחת מבצע | % of sale promotion discount | 0 |
| SalesUnit | String (max 5) | יחידת מידה מכירות | Unit measure for sales | null |
| PurchaseUnit | String (max 5) | יחידת מידה רכש | Unit measure for purchase | null |
| Localization | String (max 50) | איתור | Localization (in the storehouse) | null |
| BarCode | String (max 20) | ברקוד | Barcode | null |
| Weight | Float number | משקל | Weight | 0 |
| Volume | Float number | נפח | Volume | 0 |
| DutyPrc | Float number | % מכס | % customs | 0 |
| StockLevel | Float number | רמת מלאי | Inventory level | 0 |
| ReorderQuant | Float number | נקודת הזמנה | Point of order | 0 |
| DefaultWarehouse | Integer number | מחסן | Warehouse | 1 |
| DemandPerDay | Float number | צריכה יומית | Average demand per day | 0 |
| DemandPerMonth | Float number | צריכה חודשית | Average demand per month | 0 |
| StorageCost | Float number | עלות אחסנה | Cost of storage | 0 |
| MaxStoragePeriod | Float number | זמן אחסנה מקסימלי | Maximum storage period | 0 |
| CostOfShortage | Float number | עלות חוסר | Cost of shortage | 0 |
| SalesAcc | String (max 15) | חשבון הכנסות (חייב להיות קיים במערכת) | Sales account (existing account key) | null |
| PurchAcc | String (max 15) | חשבון הוצאות (חייב להיות קיים במערכת) | Expense account (existing account key) | null |
| VatFreeSalesAcc | String (max 15) | חשבון הכנסות פטור ממע"מ (חייב להיות קיים) | VAT exempt sales account (existing account) | null |
| WeightItem | 0/1 | דגל לציון פריט שקיל-1 =שקיל | Weightable item (1- positive) | 0 |
| StockPerUnit | numeric (0-8) | סוג פריט: 0 = פריט רגיל, 1 = פריט טבוע, 2 = פריט מונה, 3 = פריט מכפלה, 4 = פריט אצווה, 5 = פריט איתור, 6 = פריט תוקף, 7 = פריט אב מטריצה, 8 = בן מטריצה | Item type: 0 = Regular item 1 = Serial item 2 = Counter item 3 = Calculated quantity item 4 = Batch item 5 = Localization item 6 = Expirattion date item 7 = Matrix item 8 = Sub-component in matrix | 0 |
Indexs OutputData
| Name | Options |
|---|---|
| statusCode | 200 – OK / 500 - Errors |
| status | |
| errors | OK / Errors: "error description" / No Permission |