@ipt-solution/n8n-nodes-ipt-restapi2 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +21 -0
- package/README.md +350 -2
- package/dist/credentials/IptRestApi2Api.credentials.d.ts +10 -0
- package/dist/credentials/IptRestApi2Api.credentials.js +88 -0
- package/dist/credentials/IptRestApi2Api.credentials.js.map +1 -0
- package/dist/nodes/IptRestApi2/IptRestApi2.node.d.ts +9 -0
- package/dist/nodes/IptRestApi2/IptRestApi2.node.js +120 -0
- package/dist/nodes/IptRestApi2/IptRestApi2.node.js.map +1 -0
- package/dist/nodes/IptRestApi2/IptRestApi2.node.json +18 -0
- package/dist/nodes/IptRestApi2/iptRestApi2.dark.svg +1 -0
- package/dist/nodes/IptRestApi2/iptRestApi2.svg +1 -0
- package/dist/nodes/IptRestApi2/resources/address/create.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/address/create.js +8 -0
- package/dist/nodes/IptRestApi2/resources/address/create.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/address/delete.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/address/delete.js +7 -0
- package/dist/nodes/IptRestApi2/resources/address/delete.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/address/get.d.ts +6 -0
- package/dist/nodes/IptRestApi2/resources/address/get.js +31 -0
- package/dist/nodes/IptRestApi2/resources/address/get.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/address/getAll.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/address/getAll.js +12 -0
- package/dist/nodes/IptRestApi2/resources/address/getAll.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/address/index.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/address/index.js +18 -0
- package/dist/nodes/IptRestApi2/resources/address/index.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/address/update.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/address/update.js +8 -0
- package/dist/nodes/IptRestApi2/resources/address/update.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/customer/create.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/customer/create.js +8 -0
- package/dist/nodes/IptRestApi2/resources/customer/create.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/customer/delete.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/customer/delete.js +7 -0
- package/dist/nodes/IptRestApi2/resources/customer/delete.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/customer/get.d.ts +6 -0
- package/dist/nodes/IptRestApi2/resources/customer/get.js +31 -0
- package/dist/nodes/IptRestApi2/resources/customer/get.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/customer/getAll.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/customer/getAll.js +12 -0
- package/dist/nodes/IptRestApi2/resources/customer/getAll.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/customer/index.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/customer/index.js +20 -0
- package/dist/nodes/IptRestApi2/resources/customer/index.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/customer/update.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/customer/update.js +8 -0
- package/dist/nodes/IptRestApi2/resources/customer/update.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/product/create.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/product/create.js +8 -0
- package/dist/nodes/IptRestApi2/resources/product/create.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/product/delete.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/product/delete.js +7 -0
- package/dist/nodes/IptRestApi2/resources/product/delete.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/product/get.d.ts +6 -0
- package/dist/nodes/IptRestApi2/resources/product/get.js +33 -0
- package/dist/nodes/IptRestApi2/resources/product/get.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/product/getAll.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/product/getAll.js +12 -0
- package/dist/nodes/IptRestApi2/resources/product/getAll.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/product/index.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/product/index.js +18 -0
- package/dist/nodes/IptRestApi2/resources/product/index.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/product/update.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/product/update.js +8 -0
- package/dist/nodes/IptRestApi2/resources/product/update.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrder/actions.d.ts +3 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrder/actions.js +149 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrder/actions.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrder/create.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrder/create.js +9 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrder/create.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrder/delete.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrder/delete.js +7 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrder/delete.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrder/get.d.ts +6 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrder/get.js +38 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrder/get.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrder/getAll.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrder/getAll.js +12 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrder/getAll.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrder/index.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrder/index.js +23 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrder/index.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrder/update.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrder/update.js +8 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrder/update.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrderPosition/create.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrderPosition/create.js +20 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrderPosition/create.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrderPosition/delete.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrderPosition/delete.js +7 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrderPosition/delete.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrderPosition/get.d.ts +6 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrderPosition/get.js +31 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrderPosition/get.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrderPosition/getAll.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrderPosition/getAll.js +12 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrderPosition/getAll.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrderPosition/index.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrderPosition/index.js +20 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrderPosition/index.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrderPosition/update.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrderPosition/update.js +8 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrderPosition/update.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/salesOrder/actions.d.ts +3 -0
- package/dist/nodes/IptRestApi2/resources/salesOrder/actions.js +197 -0
- package/dist/nodes/IptRestApi2/resources/salesOrder/actions.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/salesOrder/create.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/salesOrder/create.js +9 -0
- package/dist/nodes/IptRestApi2/resources/salesOrder/create.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/salesOrder/delete.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/salesOrder/delete.js +7 -0
- package/dist/nodes/IptRestApi2/resources/salesOrder/delete.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/salesOrder/get.d.ts +6 -0
- package/dist/nodes/IptRestApi2/resources/salesOrder/get.js +38 -0
- package/dist/nodes/IptRestApi2/resources/salesOrder/get.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/salesOrder/getAll.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/salesOrder/getAll.js +12 -0
- package/dist/nodes/IptRestApi2/resources/salesOrder/getAll.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/salesOrder/index.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/salesOrder/index.js +23 -0
- package/dist/nodes/IptRestApi2/resources/salesOrder/index.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/salesOrder/update.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/salesOrder/update.js +8 -0
- package/dist/nodes/IptRestApi2/resources/salesOrder/update.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/salesOrderPosition/create.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/salesOrderPosition/create.js +20 -0
- package/dist/nodes/IptRestApi2/resources/salesOrderPosition/create.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/salesOrderPosition/delete.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/salesOrderPosition/delete.js +7 -0
- package/dist/nodes/IptRestApi2/resources/salesOrderPosition/delete.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/salesOrderPosition/get.d.ts +6 -0
- package/dist/nodes/IptRestApi2/resources/salesOrderPosition/get.js +31 -0
- package/dist/nodes/IptRestApi2/resources/salesOrderPosition/get.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/salesOrderPosition/getAll.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/salesOrderPosition/getAll.js +12 -0
- package/dist/nodes/IptRestApi2/resources/salesOrderPosition/getAll.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/salesOrderPosition/index.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/salesOrderPosition/index.js +20 -0
- package/dist/nodes/IptRestApi2/resources/salesOrderPosition/index.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/salesOrderPosition/update.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/salesOrderPosition/update.js +8 -0
- package/dist/nodes/IptRestApi2/resources/salesOrderPosition/update.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/supplier/create.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/supplier/create.js +8 -0
- package/dist/nodes/IptRestApi2/resources/supplier/create.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/supplier/delete.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/supplier/delete.js +7 -0
- package/dist/nodes/IptRestApi2/resources/supplier/delete.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/supplier/get.d.ts +6 -0
- package/dist/nodes/IptRestApi2/resources/supplier/get.js +31 -0
- package/dist/nodes/IptRestApi2/resources/supplier/get.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/supplier/getAll.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/supplier/getAll.js +12 -0
- package/dist/nodes/IptRestApi2/resources/supplier/getAll.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/supplier/index.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/supplier/index.js +20 -0
- package/dist/nodes/IptRestApi2/resources/supplier/index.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/supplier/update.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/supplier/update.js +8 -0
- package/dist/nodes/IptRestApi2/resources/supplier/update.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/tableData/getAll.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/tableData/getAll.js +68 -0
- package/dist/nodes/IptRestApi2/resources/tableData/getAll.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/tableData/index.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/tableData/index.js +43 -0
- package/dist/nodes/IptRestApi2/resources/tableData/index.js.map +1 -0
- package/dist/nodes/IptRestApi2/shared/actions.d.ts +15 -0
- package/dist/nodes/IptRestApi2/shared/actions.js +171 -0
- package/dist/nodes/IptRestApi2/shared/actions.js.map +1 -0
- package/dist/nodes/IptRestApi2/shared/delete.d.ts +4 -0
- package/dist/nodes/IptRestApi2/shared/delete.js +115 -0
- package/dist/nodes/IptRestApi2/shared/delete.js.map +1 -0
- package/dist/nodes/IptRestApi2/shared/filters.d.ts +3 -0
- package/dist/nodes/IptRestApi2/shared/filters.js +116 -0
- package/dist/nodes/IptRestApi2/shared/filters.js.map +1 -0
- package/dist/nodes/IptRestApi2/shared/operations.d.ts +7 -0
- package/dist/nodes/IptRestApi2/shared/operations.js +76 -0
- package/dist/nodes/IptRestApi2/shared/operations.js.map +1 -0
- package/dist/nodes/IptRestApi2/shared/read.d.ts +16 -0
- package/dist/nodes/IptRestApi2/shared/read.js +276 -0
- package/dist/nodes/IptRestApi2/shared/read.js.map +1 -0
- package/dist/nodes/IptRestApi2/shared/resource.d.ts +11 -0
- package/dist/nodes/IptRestApi2/shared/resource.js +21 -0
- package/dist/nodes/IptRestApi2/shared/resource.js.map +1 -0
- package/dist/nodes/IptRestApi2/shared/response.d.ts +4 -0
- package/dist/nodes/IptRestApi2/shared/response.js +45 -0
- package/dist/nodes/IptRestApi2/shared/response.js.map +1 -0
- package/dist/nodes/IptRestApi2/shared/write.d.ts +6 -0
- package/dist/nodes/IptRestApi2/shared/write.js +194 -0
- package/dist/nodes/IptRestApi2/shared/write.js.map +1 -0
- package/dist/package.json +41 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +39 -4
package/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 ipt solution GmbH
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
6
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
7
|
+
the Software without restriction, including without limitation the rights to
|
|
8
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
9
|
+
of the Software, and to permit persons to whom the Software is furnished to do
|
|
10
|
+
so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,351 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @ipt-solution/n8n-nodes-ipt-restapi2
|
|
2
2
|
|
|
3
|
-
This
|
|
3
|
+
> **Status: beta.** This node is under active development. Operations, parameters and outputs may still change before version 1.0. Test it on a test client before you use it with production data, especially Delete and the actions of sales and purchase orders.
|
|
4
|
+
|
|
5
|
+
This is an n8n community node. It lets you use ipt RestApi2 in your n8n workflows.
|
|
6
|
+
|
|
7
|
+
ipt RestApi2 is a REST interface for the myfactory ERP, provided as a myfactory add-in by ipt solution GmbH. It gives access to master data and documents such as products, customers and sales orders.
|
|
8
|
+
|
|
9
|
+
[n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/sustainable-use-license/) workflow automation platform.
|
|
10
|
+
|
|
11
|
+
[Installation](#installation)
|
|
12
|
+
[Operations](#operations)
|
|
13
|
+
[Credentials](#credentials)
|
|
14
|
+
[Compatibility](#compatibility)
|
|
15
|
+
[Usage](#usage)
|
|
16
|
+
[Resources](#resources)
|
|
17
|
+
[Version history](#version-history)
|
|
18
|
+
|
|
19
|
+
## Installation
|
|
20
|
+
|
|
21
|
+
In n8n, open **Settings > Community Nodes**, select **Install** and enter the package name `@ipt-solution/n8n-nodes-ipt-restapi2`.
|
|
22
|
+
|
|
23
|
+
For details, follow the [installation guide](https://docs.n8n.io/integrations/community-nodes/installation/) in the n8n community nodes documentation.
|
|
24
|
+
|
|
25
|
+
## Operations
|
|
26
|
+
|
|
27
|
+
The node offers the resources Address, Customer, Product, Purchase Order, Purchase Order Position, Sales Order, Sales Order Position and Supplier. Each resource has the operations Create, Delete, Get, Get Many and Update. Sales Order and Purchase Order also have actions such as Copy, Transform or Recalculate. Product is described in full below. The other resources work the same way, their sections list only what differs. In the API documentation (Swagger UI) these endpoints are listed under Products, Addresses & Contacts, Customers & Suppliers, Sales and Purchase. The resource Table Data reads any table or view of the client database and has only Get Many.
|
|
28
|
+
|
|
29
|
+
**Product**
|
|
30
|
+
|
|
31
|
+
- **Create:** create a product (`POST /products`).
|
|
32
|
+
- **Data** holds the fields of the new product as a JSON object. `Matchcode`, `BaseUnit`, `BaseDecimals` and `ProductGroup` are required, unless the access point has a template product in the API configuration. In that case the API takes every missing field except `ProductID` and `ProductNumber` from the template product. Without `ProductNumber` the API takes the next number from the number range in myfactory.
|
|
33
|
+
- `BaseUnit` and `ProductGroup` must exist in myfactory. Replace `Stk` and `Allg.` in the minimal example with a unit and a product group of your installation:
|
|
34
|
+
|
|
35
|
+
```json
|
|
36
|
+
{ "Matchcode": "Sample product", "BaseUnit": "Stk", "BaseDecimals": 0, "ProductGroup": "Allg." }
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
- Above Data, a notice shows a minimal example for Create and an example for Update of each resource.
|
|
40
|
+
- **Fields** below Data lets you pick single fields and enter their values, as an alternative or in addition to Data. Create and Update of every resource have it.
|
|
41
|
+
- The list starts empty. Add each field you need with **Add field to send**. The node loads the field list from `openapi.json` of your installation, so it matches its version.
|
|
42
|
+
- Data is the base of the request body. A field set in Fields replaces the same field from Data.
|
|
43
|
+
- Empty fields are not sent. A field set to `false` or `0` is sent. To clear a field on purpose, use Data, for example `{"Name2": ""}`.
|
|
44
|
+
- An added field of type date, list or boolean with a fixed empty value stops n8n before the workflow starts, for example "'ValidTo' expects a dateTime but we got ''". Remove fields you do not need instead of leaving them empty. An expression that resolves to an empty value is not sent, like an empty field.
|
|
45
|
+
- For Update the field list leaves out the ID field of the record, because the ID comes from its own parameter. Lists such as sales order positions are not part of the field list, use Data for them.
|
|
46
|
+
- **All Data** (off by default) exists for Create of every resource. When it is off, the parameter is not sent and the response has only a few fields. Turn it on to get the full record: the node then sends `alldata=true` and the API returns all fields of the new record. For products the API returns only the sent fields and the `ProductID`, with or without All Data. Use Get to read all fields of the new product.
|
|
47
|
+
|
|
48
|
+
- **Delete:** delete a product by its numeric ID (`DELETE /products/{id}`). Returns one item `{"deleted": true, "ProductID": 1234}`.
|
|
49
|
+
- Deleting is permanent. myfactory removes the product together with its dependent data.
|
|
50
|
+
- If the product is still in use, for example in sales or purchase documents, bills of materials, production orders or bookings, myfactory refuses the delete. The API answers with status 409 and the node fails with the reason from myfactory.
|
|
51
|
+
- If rights are set for the access point in the API configuration, deleting needs the delete right for products. Without it the API answers with status 403.
|
|
52
|
+
- **Delete Multiple** (off by default) deletes every product that matches all **Filters** (`DELETE /products?<field>=<value>&multidelete=true`). Each filter is a field name and a value, and the field must equal the value exactly. Several filters are combined with AND. Returns one item `{"deleted": true, "ProductIDs": [1234, 1235]}`. If no product matches the filters, the API answers with status 404 and the node fails.
|
|
53
|
+
- **Warning:** Delete Multiple can delete many products in one step. Check the filters with Get Many first. The node refuses to send the request if there is no filter, a filter has no value, a field is used twice or a name is not a field name (for example `page`, `sort` or `clause`), because the API would ignore such a filter and delete every product.
|
|
54
|
+
- With Delete Multiple the API deletes one product after the other and stops at the first product that other records still refer to (status 409). Products deleted before that stay deleted.
|
|
55
|
+
- The list `ProductIDs` holds at most the first 1000 deleted products, because the API reports only one page of records. All matching products are deleted.
|
|
56
|
+
- **Get:** get a single product by its numeric ID (`GET /products/{id}`). A single product always has all fields.
|
|
57
|
+
- **Simplify** returns only these fields: `ProductID`, `ProductNumber`, `Matchcode`, `Name1`, `ProductGroup`, `BaseUnit`, `EANNumber`, `InActive`, `ProductState`, `ChangeDate`. Off by default.
|
|
58
|
+
- **Options > Include** loads additional data: attributes, history, multiple EANs, variants.
|
|
59
|
+
- **Get Many:** get a list of products (`GET /products`).
|
|
60
|
+
- **Return All** reads every page. The node requests pages of 1000 products, the largest page size the API allows.
|
|
61
|
+
- **Limit** returns at most the given number of products (1 to 1000).
|
|
62
|
+
- **Simplify** returns the same fields as for Get. Off by default.
|
|
63
|
+
- **Options > All Data** returns all fields of each product. Without it the list has the base fields only (`ProductID`, `ProductNumber`, `Matchcode`, `EANNumber`).
|
|
64
|
+
- **Options > Fields** limits the response to the listed fields, for example `ProductID,ProductNumber,Matchcode`. The node then also sends `alldata=true`, so fields other than the base fields are returned too. If Fields is set, it wins over Simplify.
|
|
65
|
+
- **Options > Include** loads additional data, as for Get.
|
|
66
|
+
- **Options > Sort** sorts the list, for example `-ChangeDate,Matchcode`. A leading minus sorts in descending order.
|
|
67
|
+
- **Options > Filters** and **Options > Clause** search the list, see [All resources](#all-resources).
|
|
68
|
+
- **Update:** change a product by its numeric ID (`PUT /products/{id}`).
|
|
69
|
+
- **Data** holds the fields to change as a JSON object, for example `{"Matchcode": "New name"}`. Fields that are not listed stay unchanged.
|
|
70
|
+
- **Fields** works as for Create.
|
|
71
|
+
- Installations that require an `If-Match` header for every write are not supported yet. There the API rejects the update with status 428.
|
|
72
|
+
|
|
73
|
+
**Address**
|
|
74
|
+
|
|
75
|
+
- **Create** (`POST /addresses`): `Name1` and `Matchcode` are required. The API rejects a new address if an address with the same `Name1` and `Matchcode` exists. Without `AddressNumber` the API takes the next number from the number range in myfactory, without `Country` and `Language` the defaults of the installation. With All Data the response has all fields of the new address, without it only a few. Minimal example:
|
|
76
|
+
|
|
77
|
+
```json
|
|
78
|
+
{ "Matchcode": "SAMPLE", "Name1": "Sample Ltd" }
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
- **Delete** (`DELETE /addresses/{id}`): returns `{"deleted": true, "AddressID": 1234}`. **Delete Multiple** works as for products and returns `AddressIDs`. As for products, deleting is permanent and an address that is still in use is refused with status 409 and the reason from myfactory, for example an address that is still a customer or supplier.
|
|
82
|
+
- **Get** and **Get Many** (`GET /addresses`): **Simplify** returns `AddressID`, `AddressNumber`, `Matchcode`, `Name1`, `Street`, `PostalCode`, `City`, `Country`, `EMail`, `PhoneNr`. Without All Data a list has the base fields `AddressID`, `AddressNumber`, `Matchcode`, `Name1`. **Include** loads attributes and history.
|
|
83
|
+
- **Update** (`PUT /addresses/{id}`): as for products.
|
|
84
|
+
|
|
85
|
+
**Customer**
|
|
86
|
+
|
|
87
|
+
- **Create** (`POST /customers`): a customer belongs to an address. Create the address first and pass its ID: `AddressID` is required. Without `CustomerNumber` the API takes the next number from the number range in myfactory. Without `CustomerGroup` it takes the first customer group in alphabetical order, without `CurrencyUnit` the internal currency. With All Data the response has all fields of the new customer, without it only a few. Minimal example, with `1234` standing for the `AddressID` of an existing address:
|
|
88
|
+
|
|
89
|
+
```json
|
|
90
|
+
{ "AddressID": 1234 }
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
- **Delete** (`DELETE /customers/{id}`): returns `{"deleted": true, "CustomerID": 1234}`. **Delete Multiple** works as for products and returns `CustomerIDs`. As for products, deleting is permanent and a customer that is still in use is refused with status 409 and the reason from myfactory, for example a customer that still has sales documents. If the myfactory setting to delete unused addresses is on, the address of a deleted customer is deleted too, unless another record such as a supplier or prospect still uses it. A later Delete of that address then fails with status 404.
|
|
94
|
+
- **Get** and **Get Many** (`GET /customers`): **Simplify** returns `CustomerID`, `CustomerNumber`, `AddressID`, `MatchcodeAdd`, `CustomerGroup`, `CurrencyUnit`, `PaymentConditions`, `IsFreezed`, `InActive`, `ChangeDate`. Name and postal address are fields of the address (`AddressID`). Without All Data a list has the base fields `CustomerID`, `AddressID`, `CustomerNumber`, `MatchcodeAdd`. **Include** loads attributes and history.
|
|
95
|
+
- **Update** (`PUT /customers/{id}`): as for products.
|
|
96
|
+
|
|
97
|
+
**Supplier**
|
|
98
|
+
|
|
99
|
+
- **Create** (`POST /suppliers`): a supplier belongs to an address. Create the address first and pass its ID: `AddressID` is required. `SupplierGroup` is required too: the short name of a supplier group of your installation, not its description. An empty `SupplierGroup` takes the first supplier group in alphabetical order. Without `SupplierNumber` the API takes the next number from the number range in myfactory, without `CurrencyUnit` the internal currency. A purchase order needs a payment condition: set `PaymentConditions` to the `ConditionID` of a payment condition of your installation. Without it, myfactory takes the payment condition of the supplier group or of one of its parent groups. If none of them has one, Create of a purchase order for this supplier fails with status 400 and a message from myfactory that no payment condition is given. With All Data the response has all fields of the new supplier, without it only a few. Minimal example, with `1234` standing for the `AddressID` of an existing address, `HL` for the short name of a supplier group and `1` for the `ConditionID` of a payment condition:
|
|
100
|
+
|
|
101
|
+
```json
|
|
102
|
+
{ "AddressID": 1234, "SupplierGroup": "HL", "PaymentConditions": 1 }
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
An empty value in **Fields** is not sent. To pass an empty `SupplierGroup`, use Data.
|
|
106
|
+
|
|
107
|
+
- **Delete** (`DELETE /suppliers/{id}`): returns `{"deleted": true, "SupplierID": 1234}`. **Delete Multiple** works as for products and returns `SupplierIDs`. Deleting is permanent and also removes the bank details and product supplier entries of the supplier. myfactory refuses to delete a supplier that is used in purchase documents, in accounting or for devices, with status 409 and the reason. If the myfactory setting to delete unused addresses is on, the address of a deleted supplier is deleted too, unless another record such as a customer or prospect still uses it.
|
|
108
|
+
- **Get** and **Get Many** (`GET /suppliers`): **Simplify** returns `SupplierID`, `SupplierNumber`, `AddressID`, `MatchcodeAdd`, `SupplierGroup`, `CurrencyUnit`, `PaymentConditions`, `IsFreezed`, `InActive`, `ChangeDate`. Name and postal address are fields of the address (`AddressID`). Without All Data a list has the base fields `SupplierID`, `AddressID`, `SupplierNumber`, `SupplierGroup`. **Include** loads attributes and history.
|
|
109
|
+
- **Update** (`PUT /suppliers/{id}`): as for products.
|
|
110
|
+
|
|
111
|
+
**Sales Order**
|
|
112
|
+
|
|
113
|
+
- **Create** (`POST /salesorders`): `OrderType` (the number of the order type in myfactory, for example of an order confirmation or an invoice) and the customer (`CustomerID` or `CustomerNumber`) are required. The positions go into the array `Positions` of the same request, each with `ProductNumber` or `ProductID` and `Quantity`. Positions are optional. The response always contains the positions of the new sales order, each with its `OrderPosID`. All Data decides only about the header fields: with All Data the response has all of them, without it only a few. Minimal example with one position, where `2` stands for the number of an order type and `10001` and `1000` for the numbers of an existing customer and product:
|
|
114
|
+
|
|
115
|
+
```json
|
|
116
|
+
{
|
|
117
|
+
"OrderType": 2,
|
|
118
|
+
"CustomerNumber": "10001",
|
|
119
|
+
"Positions": [{ "ProductNumber": "1000", "Quantity": 2 }]
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
- **Delete** (`DELETE /salesorders/{id}`): deletes one sales order and returns `{"deleted": true, "OrderID": 1234}`. There is no Delete Multiple. Deleting is permanent. myfactory refuses to delete a processed sales order if its number range does not allow deleting or the user lacks the delete right, and a sales order that is the template of a contract or is linked to time billing or a time quota. The API then answers with status 409 and only the message "Order could not be deleted", without the reason.
|
|
124
|
+
- **Get** (`GET /salesorders/{id}`): a single sales order always comes with its positions, taxes and payments. **Include** loads attributes and history.
|
|
125
|
+
- **Get Many** (`GET /salesorders`): without All Data a list has the base fields `OrderID`, `OrderTypeDesc`, `OrderNumber`, `BookingDate`, `CustomerID`, `CustomerNumber`, `RepresentativeID`, `RepresentativeGroup`, `Matchcode`, `OrderSum`, `DeliveryDate`, `SalesDistrictID`. **Include** loads attributes, history, payments, positions and taxes.
|
|
126
|
+
- **Simplify** for Get and Get Many returns `OrderID`, `OrderNumber`, `OrderType`, `OrderTypeDesc`, `BookingDate`, `CustomerID`, `CustomerNumber`, `Name1`, `OrderSum`, `CurrUnit`, without positions.
|
|
127
|
+
- **Get Many with Simplify, Fields or All Data is expensive.** For these, the API loads the positions, taxes and payments of every sales order on the page, even though the response leaves them out. Keep **Limit** small for large lists.
|
|
128
|
+
- **Update** (`PUT /salesorders/{id}`): changes the given header fields. Entries in `Positions` change existing positions and need their `OrderPosID`, for example `{"Positions": [{"OrderPosID": 5678, "Quantity": 3}]}`. Entries without `OrderPosID` are ignored, so Update does not add positions. Use the resource Sales Order Position for that. Returns the sales order with its positions.
|
|
129
|
+
|
|
130
|
+
**Sales Order actions**
|
|
131
|
+
|
|
132
|
+
Each action works on one sales order, given by its `OrderID` (not the order number, get it from Sales Order > Get Many). A notice at the top of each action says what it changes. Required parameters are shown directly, optional ones are under **Additional Fields**. The output is what the API returns, as one item. Errors of the API (for example status 404 for an unknown sales order or 409 if myfactory refuses the action) appear as the node error message.
|
|
133
|
+
|
|
134
|
+
| Operation | Request | Output |
|
|
135
|
+
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
136
|
+
| Change Currency | `POST /salesorders/{id}/changecurrency` with **Currency** and the optional **Exchange Rate** (0 uses the daily rate) | The sales order with its positions |
|
|
137
|
+
| Change Customer | `POST /salesorders/{id}/changecustomer` with **New Customer ID** and the optional Prospect ID, Change Conditions, Keep Credit Card, Keep Documents, Refresh Commissions | The sales order under its new ID. myfactory copies the order to the new customer, keeps the order number and deletes the old order, so the old `OrderID` no longer exists. |
|
|
138
|
+
| Check Credit | `POST /salesorders/{id}/checkcredit` | `orderId`, `customerId`, `withinLimit`, `creditLimit`, `currentExposure`, `remaining`. Changes nothing. |
|
|
139
|
+
| Complete | `POST /salesorders/{id}/complete` | `orderId`, `completed` |
|
|
140
|
+
| Copy | `POST /salesorders/{id}/copy` with the optional Customer ID, Prospect ID, Order Type and switches. Without them the copy gets the customer and the order type of the source. | The new sales order with its positions |
|
|
141
|
+
| Create Purchase Order | `POST /salesorders/{id}/createpurchaseorder` with **Supplier ID**, **Position IDs** (comma-separated `OrderPosID` values of the sales order, for example `5678,5679`) and **Purchase Order Type** (0 uses the type preset in myfactory, without a preset the API rejects the request) | `orderId` and `orderNumber` of the purchase order, `orderType`, `supplierId`, `salesOrderId`, `setCompleted` and the list `positions` |
|
|
142
|
+
| Recalculate | `POST /salesorders/{id}/recalc` | The sales order with its positions |
|
|
143
|
+
| Refresh Prices | `POST /salesorders/{id}/refreshprices` with the optional Refresh Sales Prices (on by default) and Refresh Valuation Prices | The sales order with its positions |
|
|
144
|
+
| Renumber Positions | `POST /salesorders/{id}/renumberpositions` | The sales order with its positions |
|
|
145
|
+
| Set Printed | `POST /salesorders/{id}/setprinted` | `orderId`, `orderState`, `alreadyPrinted`, `printBatchEntriesMarked` |
|
|
146
|
+
| Transform | `POST /salesorders/transform?sourceorderid=…&targetordertype=…` with **Source Order ID**, **Target Order Type** and the optional **Full Copy** | The new sales order with its positions |
|
|
147
|
+
|
|
148
|
+
- **Change Currency** switches the sales order to another currency and converts the prices of its positions. Use a currency code that is set up in myfactory, because neither the API nor myfactory rejects an unknown code.
|
|
149
|
+
- **Change Customer** takes the addresses and the taxation from the new customer. With Change Conditions on (default), the order also takes over the currency and price type of the new customer and the position prices are determined again. Without a customer it works only for offers, which can be moved to a prospect.
|
|
150
|
+
- **Check Credit** fails for a sales order without a customer.
|
|
151
|
+
- **Complete** marks the sales order and its main positions as completed and removes their product planning entries. myfactory accepts it only for processed or printed sales orders. If myfactory refuses, the API reports only a general error with status 409.
|
|
152
|
+
- **Create Purchase Order**: Delivery Address chooses where the supplier delivers: No Separate Address, the address of the sales order or its delivery address. Purchase Units converts the quantities into the purchase unit of each product, rounded up. Combination positions are not split into their parts.
|
|
153
|
+
- **Recalculate** recalculates the totals, taxes and position sums of the sales order, as after a change to a position.
|
|
154
|
+
- **Refresh Prices** also overwrites prices that were entered by hand, unless myfactory is set up to keep fixed prices. At least one of Refresh Sales Prices and Refresh Valuation Prices must be on, otherwise the API answers with status 400.
|
|
155
|
+
- **Renumber Positions** numbers the positions again in their order: 1, 2, 3 …, group titles open a level (1, 1.1), text and page break lines get no number. The order of the positions does not change.
|
|
156
|
+
- **Set Printed** marks a processed sales order as printed and checks off its open entries in print batches. Nothing is printed or sent. A sales order that is already printed is returned unchanged. Use this for documents that reach the recipient by other means. Changing `OrderState` with Update does not do this.
|
|
157
|
+
- **Transform** creates the follow-up document, for example a delivery note from an order confirmation. **Target Order Type** is the number of an order type of your installation, usually 3 for a delivery note. The target order type must be a follow-up type of the source order type in myfactory. If it is not, the error message of the API lists the allowed types. Without Full Copy only positions that are still open are taken over. Transform fails if the source sales order is locked for transforming or has no positions left to take over.
|
|
158
|
+
|
|
159
|
+
**Sales Order Position**
|
|
160
|
+
|
|
161
|
+
- **Create** (`POST /salesorderpositions`): `OrderID` is required. `PosType`: 1 product (the default, needs `ProductID` or `ProductNumber`), 2 manual position (send `Name1`, `Quantity`, `Unit` and `Price`), 3 alternative position (offers only), 4 text (`Name1` up to 100 characters, long text in `PosText`), 5 subtotal, 6 page break, 7 group title. Other values are rejected. `PosIndex` inserts the position before the position at that place (0 is the first), without it the position is appended. For a product position, a sent `Price` or `Discount` wins over the price lists and the position is marked as a manual price (`PriceManual` 0 turns this off). The sales order action Refresh Prices keeps it only if myfactory is set up to keep fixed prices. myfactory recalculates the sales order, but does not number the positions again: without `PosNumber` the new position gets the number of its predecessor plus one. Use the sales order action Renumber Positions for consecutive numbers. Returns the new position. With All Data the response has almost all fields, but some such as `OrderID` are missing. Use Get to read them. Without All Data the response has only a few fields. Minimal example, with `1234` standing for the `OrderID` of an existing sales order and `1000` for a product number:
|
|
162
|
+
|
|
163
|
+
```json
|
|
164
|
+
{ "OrderID": 1234, "ProductNumber": "1000", "Quantity": 2 }
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
- **Delete** (`DELETE /salesorderpositions/{id}`): deletes one position for good and returns `{"deleted": true, "OrderPosID": 5678}`. myfactory recalculates the sales order. The API does not check whether the sales order is already processed. There is no Delete Multiple.
|
|
168
|
+
- **Get** and **Get Many** (`GET /salesorderpositions`): **Simplify** returns `OrderPosID`, `OrderID`, `PosNumber`, `ProductID`, `ProductNumber`, `Name1`, `Quantity`, `Unit`, `Price`, `Turnover`. Without All Data a list has the base fields `OrderPosID`, `OrderID`, `PosIndex`, `PosType`, `PosNumber`, `ProductID`, `ProductNumber`, `Name1`, `Quantity`, `Unit`, `Price`, `Turnover`, `PosDeleted`. **Include** loads attributes and history. For the positions of one sales order, add the filter `OrderID`.
|
|
169
|
+
- **Update** (`PUT /salesorderpositions/{id}`): as for products. `OrderID` and `PosType` cannot be changed. `PosIndex` moves the position to that place in the sales order (0 is the first), the position numbers stay the same. myfactory recalculates the sales order.
|
|
170
|
+
|
|
171
|
+
**Purchase Order**
|
|
172
|
+
|
|
173
|
+
Purchase orders work like sales orders. The differences:
|
|
174
|
+
|
|
175
|
+
- **Create** (`POST /purchaseorders`): `OrderType` (the number of a purchase order type in myfactory, for example of an order or a goods receipt) and the supplier (`SupplierID` or `SupplierNumber`) are required. The positions go into the array `Positions`, each with `ProductNumber` or `ProductID` and `Quantity`. myfactory numbers the positions consecutively and saves the new purchase order as processed, so a goods receipt books the stock at once. The response always contains the positions, All Data decides only about the header fields. Minimal example with one position, where `1` stands for the number of a purchase order type and `70001` and `1000` for the numbers of an existing supplier and product:
|
|
176
|
+
|
|
177
|
+
```json
|
|
178
|
+
{
|
|
179
|
+
"OrderType": 1,
|
|
180
|
+
"SupplierNumber": "70001",
|
|
181
|
+
"Positions": [{ "ProductNumber": "1000", "Quantity": 10 }]
|
|
182
|
+
}
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
- **Delete** (`DELETE /purchaseorders/{id}`): deletes one purchase order and returns `{"deleted": true, "OrderID": 1234}`. There is no Delete Multiple. Deleting is permanent. For order types with a financial effect, such as purchase invoices, myfactory also deletes the open item and the accounting transfer entry. myfactory refuses to delete a processed purchase order if its number range does not allow deleting or the user lacks the delete right. The API then answers with status 409 and only the message "Order could not be deleted", without the reason.
|
|
186
|
+
- **Get** (`GET /purchaseorders/{id}`): a single purchase order always comes with its positions, taxes and payments. **Include** loads attributes and history.
|
|
187
|
+
- **Get Many** (`GET /purchaseorders`): without All Data a list has the base fields `OrderID`, `BookingDate`, `OrderTypeDesc`, `SupplierID`, `Name1`, `SupplierNumber`, `Matchcode`, `DeliveryDate`, `OrderSum`, `OrderNumber`, `OrderState`, `Completed`. **Include** loads attributes, history, payments, positions and taxes. As for sales orders, Get Many with Simplify, Fields or All Data loads the details of every purchase order on the page, so keep **Limit** small.
|
|
188
|
+
- **Simplify** for Get and Get Many returns `OrderID`, `OrderNumber`, `OrderType`, `OrderTypeDesc`, `BookingDate`, `DeliveryDate`, `SupplierNumber`, `Name1`, `OrderSum`, `CurrUnit`, without positions.
|
|
189
|
+
- **Update** (`PUT /purchaseorders/{id}`): changes the given header fields. Entries in `Positions` change existing positions and need their `OrderPosID`. Entries without `OrderPosID` are ignored, use the resource Purchase Order Position to add positions. Returns the purchase order with its positions.
|
|
190
|
+
|
|
191
|
+
**Purchase Order actions**
|
|
192
|
+
|
|
193
|
+
Each action works on one purchase order, given by its `OrderID` (not the order number, get it from Purchase Order > Get Many). As for sales orders, a notice at the top of each action says what it changes, optional parameters are under **Additional Fields** and the output is what the API returns, as one item.
|
|
194
|
+
|
|
195
|
+
| Operation | Request | Output |
|
|
196
|
+
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
197
|
+
| Change Currency | `POST /purchaseorders/{id}/changecurrency` with **Currency** and the optional **Exchange Rate** (0 uses the daily rate) | The purchase order with its positions |
|
|
198
|
+
| Change Supplier | `POST /purchaseorders/{id}/changesupplier` with **New Supplier ID** and the optional Change Conditions, Keep Documents, Refresh Texts | The purchase order under its new ID. myfactory copies the order to the new supplier, keeps the order number and deletes the old order, so the old `OrderID` no longer exists. |
|
|
199
|
+
| Confirm Delivery Dates | `POST /purchaseorders/{id}/confirmdeliverydates` with **Confirmed Delivery Date** and the optional Confirmation Text and Order Confirmation Date. At least one of the three is required. | `orderId`, `confirmablePositions`, `confirmedPositions`, `failures`, `orderConfirmationDate` |
|
|
200
|
+
| Copy | `POST /purchaseorders/{id}/copy` with the optional Supplier ID, Order Type and switches. Without them the copy gets the supplier and the order type of the source. | The new purchase order with its positions |
|
|
201
|
+
| Recalculate | `POST /purchaseorders/{id}/recalc` | The purchase order with its positions |
|
|
202
|
+
| Refresh Prices | `POST /purchaseorders/{id}/refreshprices` | The purchase order with its positions |
|
|
203
|
+
| Renumber Positions | `POST /purchaseorders/{id}/renumberpositions` | The purchase order with its positions |
|
|
204
|
+
| Set Completed | `POST /purchaseorders/{id}/setcompleted` | `orderId`, `orderCompleted`, `orderState` |
|
|
205
|
+
| Set Printed | `POST /purchaseorders/{id}/setprinted` | `orderId`, `orderState`, `alreadyPrinted`, `printBatchEntriesMarked` |
|
|
206
|
+
| Transform | `POST /purchaseorders/transform?sourceorderid=…&targetordertype=…` with **Source Order ID**, **Target Order Type** and the optional **Full Copy** | The new purchase order with its positions |
|
|
207
|
+
|
|
208
|
+
- **Change Currency** switches the purchase order to another currency and converts the prices of its positions. The API does not check the currency code.
|
|
209
|
+
- **Change Supplier**: with Change Conditions on (default), the order takes over the currency and price type of the new supplier and the position prices are determined again. myfactory refuses the change for a purchase order it treats as read-only or that already has an external production order.
|
|
210
|
+
- **Confirm Delivery Dates** records the order confirmation of the supplier for all product and manual positions: each gets the confirmed delivery date, keeps the date requested before and updates the material planning. Write dates as `2026-10-01` or `01.10.2026`. The confirmation text has up to 100 characters. A confirmation cannot be withdrawn with this action. If myfactory refuses some positions, they are listed in `failures`. If it refuses all of them, the API answers with status 409.
|
|
211
|
+
- **Refresh Prices** takes the current purchase prices for all product positions and also overwrites prices entered by hand. myfactory saves the change without processing the purchase order, so a processed purchase order goes to the state in progress (`OrderState` 2).
|
|
212
|
+
- **Renumber Positions** works as for sales orders.
|
|
213
|
+
- **Set Completed** marks the purchase order and its main positions as completed and removes their material planning entries. myfactory accepts it only for processed or printed purchase orders. Changing `OrderCompleted` with Update does not do this.
|
|
214
|
+
- **Set Printed** works as for sales orders.
|
|
215
|
+
- **Transform** creates the follow-up document, for example a goods receipt from an order or a purchase invoice from a goods receipt. **Target Order Type** is the number of a purchase order type of your installation. The new document is saved as processed, so a goods receipt books the stock at once. The target order type must be a follow-up type of the source order type in myfactory. If it is not, the error message of the API lists the allowed types. Transform fails if the source purchase order is locked for transforming, already has an unprocessed follow-up document or has no positions left to take over.
|
|
216
|
+
|
|
217
|
+
**Purchase Order Position**
|
|
218
|
+
|
|
219
|
+
Works like Sales Order Position, with these differences:
|
|
220
|
+
|
|
221
|
+
- **Create** (`POST /purchaseorderpositions`): `OrderID` is the ID of the purchase order. `PosType` 3 (alternative position) does not exist for purchase orders. The other types, `PosIndex`, `PosNumber`, `Price` and `Discount` work as for sales order positions, except that the purchase order action Refresh Prices always overwrites a sent `Price` or `Discount`. myfactory recalculates the purchase order, use the purchase order action Renumber Positions for consecutive numbers. Minimal example, with `1234` standing for the `OrderID` of an existing purchase order and `1000` for a product number:
|
|
222
|
+
|
|
223
|
+
```json
|
|
224
|
+
{ "OrderID": 1234, "ProductNumber": "1000", "Quantity": 10 }
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
- **Delete** (`DELETE /purchaseorderpositions/{id}`): deletes one position for good and returns `{"deleted": true, "OrderPosID": 5678}`. myfactory recalculates the purchase order. The API does not check whether the purchase order is already processed. There is no Delete Multiple.
|
|
228
|
+
- **Get** and **Get Many** (`GET /purchaseorderpositions`): **Simplify** returns `OrderPosID`, `OrderID`, `PosNumber`, `ProductNumber`, `Name1`, `Quantity`, `Unit`, `Price`, `Turnover`, `DeliveryDate`. Without All Data a list has the base fields `OrderID`, `ProductID`, `PosType`, `PosNumber`, `Quantity`, `Price`, `Name1`, `PosIndex`, `ProductNumber`, `Unit`, `Turnover`, `OrderPosID`, `PosDeleted`. **Include** loads attributes and history. For the positions of one purchase order, add the filter `OrderID`.
|
|
229
|
+
- **Update** (`PUT /purchaseorderpositions/{id}`): as for sales order positions. The fields of the delivery date confirmation (`DeliveryRequestDate`, `DeliveryReminderDate`, `DeliveryDateConfirmationText`, `CountDeliveryDateChange`) are ignored, use the purchase order action Confirm Delivery Dates.
|
|
230
|
+
|
|
231
|
+
**Table Data**
|
|
232
|
+
|
|
233
|
+
- **Get Many** (`GET /tabledatas?table=…`): reads the rows of a table or view of the myfactory client database. There is no Get, Create, Update or Delete, because the endpoint is read-only.
|
|
234
|
+
- **Table** is required: the name of a table or view without schema, for example `tdProducts`. The API answers with status 404 if no table or view of that name exists. The tables of the interface itself (`tdIptRestApi2…`, for example API keys and the request log) are not available, the API answers with status 403.
|
|
235
|
+
- If rights are set for the access point in the API configuration, it needs the read right `TableDatas`. Without it the API answers with status 403.
|
|
236
|
+
- Each row becomes one n8n item with the columns of the table as fields.
|
|
237
|
+
- **Return All** and **Limit** work as for products.
|
|
238
|
+
- The API cannot sort this endpoint and reads the rows in no fixed order. Return All over several pages (more than 1000 rows) can therefore skip rows or return a row twice. For large tables, narrow the rows with Clause, for example to a range of IDs, so that the result fits on one page.
|
|
239
|
+
- **Options > Clause** searches the rows, as described under [All resources](#all-resources), with the column names of the table.
|
|
240
|
+
- **Options > Fields** limits the response to the listed columns, for example `ProductID,ProductNumber,Matchcode`. Upper and lower case do not matter, unknown names are ignored. Without Fields each row has all columns.
|
|
241
|
+
- There is no Filters, Sort, Simplify, All Data or Include. Use Clause to search.
|
|
242
|
+
|
|
243
|
+
**All resources**
|
|
244
|
+
|
|
245
|
+
Get Many has two options to search the list. Use Filters for simple matches and Clause for dates, comparisons and OR.
|
|
246
|
+
|
|
247
|
+
- **Filters**: one or more pairs of field name and value, for example `ProductGroup` = `Default`. The field must equal the value exactly. Several filters are combined with AND. Upper and lower case in the field name do not matter. The API converts the value by the type of the field: write dates as `2026-10-01` or `01.10.2026`, decimals with a point or a comma, and yes/no fields such as `InActive` as `-1` (yes) or `0` (no). The node refuses names that the API would not use as a filter (for example `page`, `sort` or `clause`), a filter without a value and a field used twice. Filters cannot find empty fields, use Clause with `IS NULL` for those.
|
|
248
|
+
- **Clause**: an SQL condition on the table columns of the resource. The node puts the clause in brackets and the API combines it with the filters by AND. Fields of the API response that are not table columns (for example `Positions` of a sales order) cannot be used. Write `=` as `$EQ$`, `<>` as `$NE$`, `<` as `$LT$`, `>` as `$GT$`, `>=` as `$GT$$EQ$`, `<=` as `$LT$$EQ$`, `%` as `$P100$` and `:` as `$2P$`. `IN`, `LIKE`, `IS NULL`, `AND` and `OR` are allowed. Write dates as `'yyyyMMdd'`, with a time as `'yyyy-MM-ddTHH$2P$mm$2P$ss'`. Examples:
|
|
249
|
+
- Sales orders of October 2026: `BookingDate$GT$$EQ$'20261001' AND BookingDate$LT$'20261101'`
|
|
250
|
+
- Products changed since 8 o'clock on 1 October 2026: `ChangeDate$GT$$EQ$'2026-10-01T08$2P$00$2P$00'`
|
|
251
|
+
- Products of two product groups: `ProductGroup IN ('Tools', 'Parts')` or `ProductGroup$EQ$'Tools' OR ProductGroup$EQ$'Parts'`
|
|
252
|
+
- Products with "Hammer" in the matchcode: `Matchcode LIKE '$P100$Hammer$P100$'`
|
|
253
|
+
- Addresses whose name has an umlaut as the second letter, `_` stands for any one character: `Name1 LIKE 'M_ller'`
|
|
254
|
+
- Products without an EAN: `EANNumber IS NULL OR EANNumber$EQ$''`
|
|
255
|
+
- Sales orders over 1000: `OrderSum$GT$1000`
|
|
256
|
+
- The API rejects a clause with status 400 if it
|
|
257
|
+
- contains characters outside printable ASCII, for example umlauts, line breaks or tabs (for an umlaut use `_` as a placeholder in `LIKE` instead),
|
|
258
|
+
- contains `;`, `--` or `/*`,
|
|
259
|
+
- has an odd number of single quotes,
|
|
260
|
+
- is longer than 2000 characters, including the two brackets the node adds,
|
|
261
|
+
- contains SQL keywords such as `SELECT`, `SET`, `UPDATE`, `CREATE`, `CHAR` or `CONVERT`, or hex values such as `0x1F`. This also applies inside text, so `Matchcode LIKE '$P100$SET$P100$'` is rejected too.
|
|
262
|
+
- A long `IN (...)` list soon reaches the 2000 characters. Filter on another field instead, or use a range of IDs such as `OrderID$GT$5000` and continue with the next range.
|
|
263
|
+
- If SQL Server rejects the filters or the clause, for example because of an unknown column name, the API answers with status 400 and a message that starts with "Filter produced invalid SQL". The node keeps that message and adds a hint on how to write the clause.
|
|
264
|
+
|
|
265
|
+
Return All keeps Filters and Clause for every page.
|
|
266
|
+
|
|
267
|
+
Simplify and Fields restrict the response to the named fields. Additional data from Include is then left out.
|
|
268
|
+
|
|
269
|
+
Each record becomes its own n8n item. Create and Update return the record as stored after the write. Which fields Create returns depends on All Data and the resource, see above. Errors returned by the API (for example "Login failed" or "No records found") appear as the error message of the node.
|
|
270
|
+
|
|
271
|
+
With Delete Multiple the API deletes one record after the other and stops at the first record it cannot delete. The delete is not atomic: records deleted before that stay deleted.
|
|
272
|
+
|
|
273
|
+
**Custom API Call**
|
|
274
|
+
|
|
275
|
+
n8n adds **Custom API Call** to the resources and operations of the node. Use it for endpoints of the RestApi that the node does not offer as an operation. The node itself does not send the request. n8n points you to the **HTTP Request** node instead. In the HTTP Request node, set **Authentication** to **Predefined Credential Type** and **Credential Type** to **Ipt RestApi2 API**, then select your credential. The request then carries the same four headers as this node. The base URL is not taken from the credential, so enter the full URL including `/ipt/api`, for example `https://example.com/instance/ipt/api/info`.
|
|
276
|
+
|
|
277
|
+
## Credentials
|
|
278
|
+
|
|
279
|
+
The node signs in without a session. Every request carries the API key and the target database as headers. You need an access point with an API key in the ipt RestApi2 add-in of your myfactory installation.
|
|
280
|
+
|
|
281
|
+
| Field | Header | Description |
|
|
282
|
+
| -------- | ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
283
|
+
| Base URL | | URL of the myfactory instance, for example `https://example.com/instance`. Do not add `/ipt/api`, the node does that. A trailing slash is fine. |
|
|
284
|
+
| API Key | `GUID` | API key of the RestApi2 access point. Stored as a password. |
|
|
285
|
+
| App Name | `APPNAME` | AppName of the myfactory instance, as set in the myfactory administrator. This is not the name of your own application. |
|
|
286
|
+
| Database | `DB` | Name of the myfactory client database. |
|
|
287
|
+
| Division | `DIVISION` | Number of the myfactory division, for example `1`. |
|
|
288
|
+
|
|
289
|
+
When you save the credential, n8n calls `GET /ipt/api/info`. The test fails if the API key, database or division is wrong, and also if the add-in has no valid license.
|
|
290
|
+
|
|
291
|
+
## Compatibility
|
|
292
|
+
|
|
293
|
+
- Requires ipt RestApi2 29.12.0 or later (the `fields` parameter was added in that version).
|
|
294
|
+
- The option Include needs ipt RestApi2 31.0.5 or later. Older versions ignore attributes and history and return variants and multiple EANs as empty lists.
|
|
295
|
+
- Some sales order actions need a later version: Create Purchase Order 32.1.0, Set Printed 34.5.0, Renumber Positions 57.9.0.
|
|
296
|
+
- Some purchase order actions need a later version: Confirm Delivery Dates and Set Completed 31.8.0, Set Printed 34.5.0, Renumber Positions 57.9.0, Transform 57.18.0.
|
|
297
|
+
- Options > Clause needs ipt RestApi2 29.13.1 or later. Older versions ignore a rejected clause and return unfiltered results.
|
|
298
|
+
- Table Data needs ipt RestApi2 34.6.1 or later. Older versions return the rows without their columns. From 57.5.1 on, the read right `TableDatas` can be set in the rights of the access point and the tables of the interface itself are blocked.
|
|
299
|
+
- The field `PosIndex` of sales and purchase order positions needs ipt RestApi2 57.9.0 or later: in lists, and to insert a position at a given place (Create) or move it (Update).
|
|
300
|
+
- Built with `@n8n/node-cli` 0.54.4 and `n8n-workflow` 2.45. Not yet tested against specific n8n versions.
|
|
301
|
+
|
|
302
|
+
## Usage
|
|
303
|
+
|
|
304
|
+
Example: read the first 50 products, sorted by product number, with only three fields.
|
|
305
|
+
|
|
306
|
+
1. Add the **ipt RestApi2** node and select the credential.
|
|
307
|
+
2. Set **Resource** to **Product** and **Operation** to **Get Many**.
|
|
308
|
+
3. Leave **Return All** off and keep **Limit** at 50.
|
|
309
|
+
4. Under **Options**, set **Fields** to `ProductID,ProductNumber,Matchcode` and **Sort** to `ProductNumber`.
|
|
310
|
+
|
|
311
|
+
The node calls `GET /ipt/api/products` with the query parameters `pagesize=50`, `fields=ProductID,ProductNumber,Matchcode` and `sort=ProductNumber` and returns one item per product.
|
|
312
|
+
|
|
313
|
+
## Using the node as an AI agent tool
|
|
314
|
+
|
|
315
|
+
The node can be attached to an AI Agent node as a tool.
|
|
316
|
+
|
|
317
|
+
- **One tool node per operation.** Resource and operation are fixed for each tool node. Add one node for "Get many products", another for "Update a product", and so on.
|
|
318
|
+
- **IDs as parameters.** The ID parameters are Product ID (`productId`), Address ID (`addressId`), Customer ID (`customerId`), Supplier ID (`supplierId`), Sales Order ID (`salesOrderId`, also for the sales order actions except Transform), Sales Order Position ID (`salesOrderPosId`), Purchase Order ID (`purchaseOrderId`, also for the purchase order actions except Transform) and Purchase Order Position ID (`purchaseOrderPosId`). Transform uses Source Order ID (`sourceOrderId`) and Target Order Type (`targetOrderType`) for sales and purchase orders.
|
|
319
|
+
- **Tool description.** By default n8n builds the description from the action, for example "Get many products from myfactory in ipt RestApi2". The descriptions of operations and parameters are not passed to the model. Set the tool description manually and say what the tool returns and when to use it, for example: "Searches products in the myfactory ERP. Returns product number, matchcode, name and product group."
|
|
320
|
+
- **Let the model fill parameters with `$fromAI`.**
|
|
321
|
+
- Product ID: `{{ $fromAI("productId", "Numeric ProductID of the product", "number") }}`
|
|
322
|
+
- For agents, Data with a single `$fromAI` is the simple way to write records. Fields is meant for setting up the node in the editor.
|
|
323
|
+
- Data: `{{ $fromAI("data", "Fields to write as a JSON object. Use myfactory field names such as Matchcode, Name1, BaseUnit or ProductGroup. A new product needs Matchcode, BaseUnit, BaseDecimals and ProductGroup.", "json") }}`
|
|
324
|
+
- Data for a new customer: `{{ $fromAI("data", "Fields of the new customer as a JSON object. AddressID is required: create the address first with the address tool and use the AddressID it returns.", "json") }}`
|
|
325
|
+
- Data for a new sales order: `{{ $fromAI("data", "Fields of the new sales order as a JSON object. OrderType and CustomerNumber are required. Positions is an array of objects with ProductNumber and Quantity.", "json") }}`
|
|
326
|
+
- Data for a new purchase order: `{{ $fromAI("data", "Fields of the new purchase order as a JSON object. OrderType and SupplierNumber are required. Positions is an array of objects with ProductNumber and Quantity.", "json") }}`
|
|
327
|
+
- Purchase Order ID for an action: `{{ $fromAI("purchaseOrderId", "OrderID of the purchase order, not the order number. Get it with the tool for Get Many purchase orders.", "number") }}`
|
|
328
|
+
- Clause for Get Many sales orders: `{{ $fromAI("clause", "SQL condition on sales order fields such as BookingDate, OrderType or CustomerNumber. Write = as $EQ$, < as $LT$, > as $GT$, >= as $GT$$EQ$ and % as $P100$. Write dates as 'yyyyMMdd', for example BookingDate$GT$$EQ$'20261001' AND BookingDate$LT$'20261101'. No long IN lists, use a range such as OrderID$GT$5000 instead. Leave empty for no condition.", "string") }}`. If the model leaves Clause or Fields out, the node sends no condition or field list.
|
|
329
|
+
- Filter value for Get Many sales order positions, with the filter field `ProductNumber`: `{{ $fromAI("productNumber", "Product number to find the sales order positions of", "string") }}`. The positions show in which sales orders (`OrderID`) the product was sold.
|
|
330
|
+
- Sales Order ID for an action: `{{ $fromAI("salesOrderId", "OrderID of the sales order, not the order number. Get it with the tool for Get Many sales orders.", "number") }}`
|
|
331
|
+
- Source Order ID for Transform: `{{ $fromAI("sourceOrderId", "OrderID of the sales order to transform, not the order number", "number") }}`
|
|
332
|
+
- Position IDs for Create Purchase Order: `{{ $fromAI("positionIds", "Comma-separated OrderPosID values of the sales order positions to order, for example 5678,5679", "string") }}`
|
|
333
|
+
- Currency for Change Currency: `{{ $fromAI("currency", "Currency code set up in myfactory, for example USD", "string") }}`
|
|
334
|
+
- **The agent cannot look up order types or currencies.** The node has no resource for them. Set Target Order Type and Purchase Order Type as fixed values in the tool node, or list the allowed values of your installation with their meaning in the tool description. Suppliers can be looked up with a tool for Get Many suppliers. Their names are fields of the address (`AddressID`), so the agent needs a tool for addresses too, or a fixed Supplier ID.
|
|
335
|
+
- **The model does the math.** The API returns records, not totals. For a question like "What was the turnover in October?" the model reads the sales orders of that month and adds up `OrderSum` itself. Use Simplify or Fields so that it reads only the fields it needs, and set a Limit that covers the expected number of records. With too low a limit the sum is wrong without notice.
|
|
336
|
+
- **Tell the agent the order of steps.** A customer needs an existing address. Give the agent a tool to create addresses and one to create customers, and say in the system message or the tool description that it must create the address first and pass the returned `AddressID` to the customer. A sales order needs an existing customer and the number of an order type of your installation. Name the order type in the tool description, because the agent cannot look it up. The same applies to suppliers and purchase orders.
|
|
337
|
+
- **Keep the output small.** The tool output goes to the model as JSON and counts against its context window. Turn **Simplify** on and keep **Limit** low, for example 10 to 20. Avoid **Return All** and **All Data** in tool nodes, because a list with all fields can exceed the context window. All Data is off by default for Create, which keeps the output small. Turn it on only if the agent needs all fields of the new record. Sales orders are large: Get, Create (with or without All Data), Update and most sales order actions (Change Currency, Change Customer, Copy, Recalculate, Refresh Prices, Renumber Positions, Transform) return every position. Use Simplify for Get if the agent does not need the positions. For lists of sales orders, Simplify still makes the API load all details of each order, so keep the Limit small. The same applies to purchase orders and their actions that return the order (Change Currency, Change Supplier, Copy, Recalculate, Refresh Prices, Renumber Positions, Transform).
|
|
338
|
+
- **Table Data reads any table.** Set Table as a fixed value in the tool node and name the table and its meaning in the tool description, so the agent reads only the table it needs. Rows of myfactory tables often have many columns, so set **Fields** to the columns the agent needs.
|
|
339
|
+
- **Give Delete to an agent only with care.** If an agent must delete, require a human approval: n8n can add a [human review step](https://docs.n8n.io/build/integrate-ai/ai-examples/human-in-the-loop-for-tools) in the Tools panel of the AI Agent node, and the delete tool is attached to that step. You can also use an access point without the delete right for agent workflows. Do not give an agent a tool with **Delete Multiple** turned on.
|
|
340
|
+
- **Deleting a customer or supplier can delete its address.** Depending on a myfactory setting, myfactory also deletes the address when no other record uses it, as described for Delete under Customer and Supplier in [Operations](#operations). The agent does not know this. Say it in the description of the delete tool, and tell the agent to ask before it deletes a customer or supplier on an address it did not create itself.
|
|
341
|
+
- **The same care applies to sales order actions with lasting effects.** Complete, Set Printed, Change Customer (the order gets a new ID), Change Currency, Refresh Prices (overwrites prices entered by hand), Create Purchase Order (orders from a supplier) and Transform (creates a follow-up document) change business data in a way that is hard to undo. Use a human review step for these tools. Check Credit only reads data. For purchase orders the same applies to Change Supplier (the order gets a new ID), Change Currency, Confirm Delivery Dates (changes the material planning), Refresh Prices (overwrites prices entered by hand), Set Completed, Set Printed and Transform (a goods receipt books stock at once).
|
|
342
|
+
- **Leave On Error at its default.** With "Continue" the agent may receive an empty result instead of the error message from the API, and cannot react to it.
|
|
343
|
+
|
|
344
|
+
## Resources
|
|
345
|
+
|
|
346
|
+
- [n8n community nodes documentation](https://docs.n8n.io/integrations/#community-nodes)
|
|
347
|
+
- Every RestApi2 installation documents itself: the Swagger UI at `https://example.com/instance/ipt/api/docs` and the OpenAPI description at `https://example.com/instance/ipt/api/openapi.json`.
|
|
348
|
+
|
|
349
|
+
## Version history
|
|
350
|
+
|
|
351
|
+
See [CHANGELOG.md](CHANGELOG.md).
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IAuthenticateGeneric, Icon, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare class IptRestApi2Api implements ICredentialType {
|
|
3
|
+
name: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
icon: Icon;
|
|
6
|
+
documentationUrl: string;
|
|
7
|
+
properties: INodeProperties[];
|
|
8
|
+
authenticate: IAuthenticateGeneric;
|
|
9
|
+
test: ICredentialTestRequest;
|
|
10
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IptRestApi2Api = void 0;
|
|
4
|
+
class IptRestApi2Api {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = 'iptRestApi2Api';
|
|
7
|
+
this.displayName = 'Ipt RestApi2 API';
|
|
8
|
+
this.icon = {
|
|
9
|
+
light: 'file:../nodes/IptRestApi2/iptRestApi2.svg',
|
|
10
|
+
dark: 'file:../nodes/IptRestApi2/iptRestApi2.dark.svg',
|
|
11
|
+
};
|
|
12
|
+
this.documentationUrl = 'https://github.com/ipt-solution-gmbh/n8n.iptRestApi2.node?tab=readme-ov-file#credentials';
|
|
13
|
+
this.properties = [
|
|
14
|
+
{
|
|
15
|
+
displayName: 'Base URL',
|
|
16
|
+
name: 'baseUrl',
|
|
17
|
+
type: 'string',
|
|
18
|
+
required: true,
|
|
19
|
+
default: '',
|
|
20
|
+
placeholder: 'https://example.com/instance',
|
|
21
|
+
description: 'URL of the myfactory instance, without "/ipt/api". The node adds the API path itself.',
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
displayName: 'API Key',
|
|
25
|
+
name: 'apiKey',
|
|
26
|
+
type: 'string',
|
|
27
|
+
typeOptions: { password: true },
|
|
28
|
+
required: true,
|
|
29
|
+
default: '',
|
|
30
|
+
description: 'API key of the RestApi2 access point',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
displayName: 'App Name',
|
|
34
|
+
name: 'appName',
|
|
35
|
+
type: 'string',
|
|
36
|
+
required: true,
|
|
37
|
+
default: '',
|
|
38
|
+
description: 'AppName of the myfactory instance, as set in the myfactory administrator. This is not the name of your own application.',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
displayName: 'Database',
|
|
42
|
+
name: 'database',
|
|
43
|
+
type: 'string',
|
|
44
|
+
required: true,
|
|
45
|
+
default: '',
|
|
46
|
+
description: 'Name of the myfactory client database',
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
displayName: 'Division',
|
|
50
|
+
name: 'division',
|
|
51
|
+
type: 'number',
|
|
52
|
+
required: true,
|
|
53
|
+
default: 1,
|
|
54
|
+
description: 'Number of the myfactory division',
|
|
55
|
+
},
|
|
56
|
+
];
|
|
57
|
+
this.authenticate = {
|
|
58
|
+
type: 'generic',
|
|
59
|
+
properties: {
|
|
60
|
+
headers: {
|
|
61
|
+
GUID: '={{$credentials.apiKey}}',
|
|
62
|
+
APPNAME: '={{$credentials.appName}}',
|
|
63
|
+
DB: '={{$credentials.database}}',
|
|
64
|
+
DIVISION: '={{$credentials.division}}',
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
this.test = {
|
|
69
|
+
request: {
|
|
70
|
+
baseURL: '={{$credentials.baseUrl.replace(/\\/+$/, "")}}/ipt/api',
|
|
71
|
+
url: '/info',
|
|
72
|
+
method: 'GET',
|
|
73
|
+
},
|
|
74
|
+
rules: [
|
|
75
|
+
{
|
|
76
|
+
type: 'responseSuccessBody',
|
|
77
|
+
properties: {
|
|
78
|
+
key: 'Result.LicenseValid',
|
|
79
|
+
value: false,
|
|
80
|
+
message: 'Connection works, but the ipt RestApi2 add-in has no valid license',
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
exports.IptRestApi2Api = IptRestApi2Api;
|
|
88
|
+
//# sourceMappingURL=IptRestApi2Api.credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IptRestApi2Api.credentials.js","sourceRoot":"","sources":["../../credentials/IptRestApi2Api.credentials.ts"],"names":[],"mappings":";;;AAQA,MAAa,cAAc;IAA3B;QACC,SAAI,GAAG,gBAAgB,CAAC;QAExB,gBAAW,GAAG,kBAAkB,CAAC;QAEjC,SAAI,GAAS;YACZ,KAAK,EAAE,2CAA2C;YAClD,IAAI,EAAE,gDAAgD;SACtD,CAAC;QAEF,qBAAgB,GACf,0FAA0F,CAAC;QAE5F,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,UAAU;gBACvB,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;gBACd,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,8BAA8B;gBAC3C,WAAW,EACV,uFAAuF;aACxF;YACD;gBACC,WAAW,EAAE,SAAS;gBACtB,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAC/B,QAAQ,EAAE,IAAI;gBACd,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,sCAAsC;aACnD;YACD;gBACC,WAAW,EAAE,UAAU;gBACvB,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;gBACd,OAAO,EAAE,EAAE;gBACX,WAAW,EACV,yHAAyH;aAC1H;YACD;gBACC,WAAW,EAAE,UAAU;gBACvB,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;gBACd,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,uCAAuC;aACpD;YACD;gBACC,WAAW,EAAE,UAAU;gBACvB,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;gBACd,OAAO,EAAE,CAAC;gBACV,WAAW,EAAE,kCAAkC;aAC/C;SACD,CAAC;QAGF,iBAAY,GAAyB;YACpC,IAAI,EAAE,SAAS;YACf,UAAU,EAAE;gBACX,OAAO,EAAE;oBACR,IAAI,EAAE,0BAA0B;oBAChC,OAAO,EAAE,2BAA2B;oBACpC,EAAE,EAAE,4BAA4B;oBAChC,QAAQ,EAAE,4BAA4B;iBACtC;aACD;SACD,CAAC;QAIF,SAAI,GAA2B;YAC9B,OAAO,EAAE;gBACR,OAAO,EAAE,wDAAwD;gBACjE,GAAG,EAAE,OAAO;gBACZ,MAAM,EAAE,KAAK;aACb;YACD,KAAK,EAAE;gBACN;oBACC,IAAI,EAAE,qBAAqB;oBAC3B,UAAU,EAAE;wBACX,GAAG,EAAE,qBAAqB;wBAC1B,KAAK,EAAE,KAAK;wBACZ,OAAO,EAAE,oEAAoE;qBAC7E;iBACD;aACD;SACD,CAAC;IACH,CAAC;CAAA;AA5FD,wCA4FC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type INodeType, type INodeTypeDescription } from 'n8n-workflow';
|
|
2
|
+
export declare class IptRestApi2 implements INodeType {
|
|
3
|
+
methods: {
|
|
4
|
+
resourceMapping: {
|
|
5
|
+
getWriteFields: (this: import("n8n-workflow").ILoadOptionsFunctions) => Promise<import("n8n-workflow").ResourceMapperFields>;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
description: INodeTypeDescription;
|
|
9
|
+
}
|