AutomationFlowsData & Sheets › Natuurwaarnemer Erp — Inkoop Opslaan

Natuurwaarnemer Erp — Inkoop Opslaan

Natuurwaarnemer ERP — Inkoop opslaan. Uses mySql, httpRequest. Webhook trigger; 6 nodes.

Webhook trigger★★★★☆ complexity6 nodesMySQLHTTP Request
Data & Sheets Trigger: Webhook Nodes: 6 Complexity: ★★★★☆ Added:

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "updatedAt": "2026-06-07T09:31:59.574Z",
  "createdAt": "2026-06-02T19:22:00.587Z",
  "id": "Lz2UMDBaUWjpjzyI",
  "name": "Natuurwaarnemer ERP \u2014 Inkoop opslaan",
  "description": null,
  "active": true,
  "isArchived": false,
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "inkoop-opslaan",
        "responseMode": "responseNode",
        "options": {}
      },
      "id": "cdb7d77c-d5b8-4f4a-93a8-3846568efcaa",
      "name": "Webhook: Inkoop opslaan",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        0,
        0
      ]
    },
    {
      "parameters": {
        "functionCode": "function sanitize(val) {\n  if (val === null || val === undefined) return '';\n  return String(val).replace(/'/g, \"''\").trim();\n}\nconst b = items[0].json.body || items[0].json;\nconst bedrag = parseFloat(b.bedrag) || 0;\nconst btwPct = parseFloat(b.btw) || 0;\nconst btwBedrag = Math.round(bedrag * btwPct) / 100;\nconst totaal = Math.round((bedrag + btwBedrag) * 100) / 100;\nreturn [{ json: {\n  datum:         sanitize(b.datum || new Date().toISOString().split('T')[0]),\n  leverancier:   sanitize(b.leverancier),\n  factuurnummer: sanitize(b.factuurnummer),\n  omschrijving:  sanitize(b.omschrijving),\n  bedrag:        bedrag,\n  btw_pct:       btwPct,\n  btw_bedrag:    btwBedrag,\n  totaal:        totaal,\n  grootboek:     sanitize(b.grootboek)\n}}];"
      },
      "id": "8d4dc208-5100-4a20-a720-44facc599ccf",
      "name": "Function: Input valideren",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        224,
        0
      ]
    },
    {
      "parameters": {
        "operation": "executeQuery",
        "query": "INSERT INTO expenses (date, supplier, invoice_number, description, amount, btw_percentage, btw_amount, total, ledger_account_id) VALUES (STR_TO_DATE('{{ $json.datum }}', '%d-%m-%Y'), '{{ $json.leverancier }}', '{{ $json.factuurnummer }}', '{{ $json.omschrijving }}', {{ $json.bedrag }}, {{ $json.btw_pct }}, {{ $json.btw_bedrag }}, {{ $json.totaal }}, (SELECT id FROM ledger_accounts WHERE code = SUBSTRING_INDEX('{{ $json.grootboek }}', ' ', 1) LIMIT 1))",
        "options": {}
      },
      "id": "e2a68793-2ec4-4904-a96d-bcbdc498deee",
      "name": "MySQL: Inkoop invoegen",
      "type": "n8n-nodes-base.mySql",
      "typeVersion": 2,
      "position": [
        448,
        0
      ],
      "credentials": {
        "mySql": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "executeQuery",
        "query": "INSERT INTO ledger_entries (date, account_id, description, debit, credit, reference, journal) SELECT STR_TO_DATE('{{ $(\"Function: Input valideren\").item.json.datum }}', '%d-%m-%Y'), id, '{{ $(\"Function: Input valideren\").item.json.omschrijving }}', {{ $(\"Function: Input valideren\").item.json.bedrag }}, 0, '{{ $(\"Function: Input valideren\").item.json.omschrijving }}', 'inkoop' FROM ledger_accounts WHERE code = SUBSTRING_INDEX('{{ $(\"Function: Input valideren\").item.json.grootboek }}', ' ', 1) LIMIT 1",
        "options": {}
      },
      "id": "7c6a95e3-55c3-4101-9513-dcb8f1253b0e",
      "name": "MySQL: Grootboekboeking inkoop",
      "type": "n8n-nodes-base.mySql",
      "typeVersion": 2,
      "position": [
        672,
        0
      ],
      "credentials": {
        "mySql": {
          "name": "<your credential>"
        }
      },
      "onError": "continueRegularOutput"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "http://192.168.2.17:8123/api/services/input_text/set_value",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "<redacted-credential>"
            },
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"entity_id\": \"input_text.erp_status\",\n  \"value\": \"inkoop|inkoop_opgeslagen|Inkoop van {{ $('Function: Input valideren').item.json.leverancier }} opgeslagen (\u20ac {{ $('Function: Input valideren').item.json.totaal }})\"\n}",
        "options": {
          "response": {
            "response": {
              "fullResponse": true,
              "neverError": true
            }
          }
        }
      },
      "id": "1cdff1e6-d058-4f56-b9b4-177b3bbfb498",
      "name": "HTTP: HA terugkoppeling",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4,
      "position": [
        864,
        0
      ]
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "={{ JSON.stringify({ success: true, type: 'inkoop', bericht: 'Inkoop van ' + $('Function: Input valideren').item.json.leverancier + ' opgeslagen (\u20ac ' + $('Function: Input valideren').item.json.totaal + ')' }) }}",
        "options": {}
      },
      "id": "a1c1a3c8-cba0-46ce-b6e5-0f7d03d14228",
      "name": "Respond to Webhook",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1,
      "position": [
        1072,
        0
      ]
    }
  ],
  "connections": {
    "Webhook: Inkoop opslaan": {
      "main": [
        [
          {
            "node": "Function: Input valideren",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Function: Input valideren": {
      "main": [
        [
          {
            "node": "MySQL: Inkoop invoegen",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "MySQL: Inkoop invoegen": {
      "main": [
        [
          {
            "node": "MySQL: Grootboekboeking inkoop",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "MySQL: Grootboekboeking inkoop": {
      "main": [
        [
          {
            "node": "HTTP: HA terugkoppeling",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP: HA terugkoppeling": {
      "main": [
        [
          {
            "node": "Respond to Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1",
    "binaryMode": "separate",
    "availableInMCP": false,
    "callerPolicy": "workflowsFromSameOwner"
  },
  "staticData": null,
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "versionId": "b19d0bba-3fc6-41fe-9caf-a81b235020ae",
  "activeVersionId": "b19d0bba-3fc6-41fe-9caf-a81b235020ae",
  "versionCounter": 23,
  "triggerCount": 1,
  "shared": [
    {
      "updatedAt": "2026-06-02T19:22:00.599Z",
      "createdAt": "2026-06-02T19:22:00.599Z",
      "role": "workflow:owner",
      "workflowId": "Lz2UMDBaUWjpjzyI",
      "projectId": "m5RFSl9CcHUdb8CB",
      "project": {
        "updatedAt": "2026-04-21T19:10:08.086Z",
        "createdAt": "2026-04-21T18:59:53.063Z",
        "id": "m5RFSl9CcHUdb8CB",
        "name": "Ruud Hogenberg <info@natuurwaarnemer.nl>",
        "type": "personal",
        "icon": null,
        "description": null,
        "creatorId": "4e4dfe16-eb75-4c88-ac33-b7c362667bc3"
      }
    }
  ],
  "tags": [
    {
      "updatedAt": "2026-05-14T17:38:33.393Z",
      "createdAt": "2026-05-14T17:38:33.393Z",
      "id": "kJXdD2xK24cTwUjI",
      "name": "ERP"
    },
    {
      "updatedAt": "2026-05-16T09:59:01.655Z",
      "createdAt": "2026-05-16T09:59:01.655Z",
      "id": "oxi7sJOr7vsIeGSE",
      "name": "Inkoop"
    }
  ],
  "activeVersion": {
    "updatedAt": "2026-06-07T09:31:59.576Z",
    "createdAt": "2026-06-07T09:31:59.576Z",
    "versionId": "b19d0bba-3fc6-41fe-9caf-a81b235020ae",
    "workflowId": "Lz2UMDBaUWjpjzyI",
    "nodes": [
      {
        "parameters": {
          "httpMethod": "POST",
          "path": "inkoop-opslaan",
          "responseMode": "responseNode",
          "options": {}
        },
        "id": "cdb7d77c-d5b8-4f4a-93a8-3846568efcaa",
        "name": "Webhook: Inkoop opslaan",
        "type": "n8n-nodes-base.webhook",
        "typeVersion": 2,
        "position": [
          0,
          0
        ],
        "webhookId": "4fe6c577-a4d4-461e-8286-f8c7ca9694e1"
      },
      {
        "parameters": {
          "functionCode": "function sanitize(val) {\n  if (val === null || val === undefined) return '';\n  return String(val).replace(/'/g, \"''\").trim();\n}\nconst b = items[0].json.body || items[0].json;\nconst bedrag = parseFloat(b.bedrag) || 0;\nconst btwPct = parseFloat(b.btw) || 0;\nconst btwBedrag = Math.round(bedrag * btwPct) / 100;\nconst totaal = Math.round((bedrag + btwBedrag) * 100) / 100;\nreturn [{ json: {\n  datum:         sanitize(b.datum || new Date().toISOString().split('T')[0]),\n  leverancier:   sanitize(b.leverancier),\n  factuurnummer: sanitize(b.factuurnummer),\n  omschrijving:  sanitize(b.omschrijving),\n  bedrag:        bedrag,\n  btw_pct:       btwPct,\n  btw_bedrag:    btwBedrag,\n  totaal:        totaal,\n  grootboek:     sanitize(b.grootboek)\n}}];"
        },
        "id": "8d4dc208-5100-4a20-a720-44facc599ccf",
        "name": "Function: Input valideren",
        "type": "n8n-nodes-base.function",
        "typeVersion": 1,
        "position": [
          224,
          0
        ]
      },
      {
        "parameters": {
          "operation": "executeQuery",
          "query": "INSERT INTO expenses (date, supplier, invoice_number, description, amount, btw_percentage, btw_amount, total, ledger_account_id) VALUES (STR_TO_DATE('{{ $json.datum }}', '%d-%m-%Y'), '{{ $json.leverancier }}', '{{ $json.factuurnummer }}', '{{ $json.omschrijving }}', {{ $json.bedrag }}, {{ $json.btw_pct }}, {{ $json.btw_bedrag }}, {{ $json.totaal }}, (SELECT id FROM ledger_accounts WHERE code = SUBSTRING_INDEX('{{ $json.grootboek }}', ' ', 1) LIMIT 1))",
          "options": {}
        },
        "id": "e2a68793-2ec4-4904-a96d-bcbdc498deee",
        "name": "MySQL: Inkoop invoegen",
        "type": "n8n-nodes-base.mySql",
        "typeVersion": 2,
        "position": [
          448,
          0
        ],
        "credentials": {
          "mySql": {
            "id": "AdVYD86SBj0ZYuto",
            "name": "MySQL \u2014 erp"
          }
        }
      },
      {
        "parameters": {
          "operation": "executeQuery",
          "query": "INSERT INTO ledger_entries (date, account_id, description, debit, credit, reference, journal) SELECT STR_TO_DATE('{{ $(\"Function: Input valideren\").item.json.datum }}', '%d-%m-%Y'), id, '{{ $(\"Function: Input valideren\").item.json.omschrijving }}', {{ $(\"Function: Input valideren\").item.json.bedrag }}, 0, '{{ $(\"Function: Input valideren\").item.json.omschrijving }}', 'inkoop' FROM ledger_accounts WHERE code = SUBSTRING_INDEX('{{ $(\"Function: Input valideren\").item.json.grootboek }}', ' ', 1) LIMIT 1",
          "options": {}
        },
        "id": "7c6a95e3-55c3-4101-9513-dcb8f1253b0e",
        "name": "MySQL: Grootboekboeking inkoop",
        "type": "n8n-nodes-base.mySql",
        "typeVersion": 2,
        "position": [
          672,
          0
        ],
        "credentials": {
          "mySql": {
            "id": "AdVYD86SBj0ZYuto",
            "name": "MySQL \u2014 erp"
          }
        },
        "onError": "continueRegularOutput"
      },
      {
        "parameters": {
          "method": "POST",
          "url": "http://192.168.2.17:8123/api/services/input_text/set_value",
          "sendHeaders": true,
          "headerParameters": {
            "parameters": [
              {
                "name": "Authorization",
                "value": "<redacted-credential>"
              },
              {
                "name": "Content-Type",
                "value": "application/json"
              }
            ]
          },
          "sendBody": true,
          "specifyBody": "json",
          "jsonBody": "={\n  \"entity_id\": \"input_text.erp_status\",\n  \"value\": \"inkoop|inkoop_opgeslagen|Inkoop van {{ $('Function: Input valideren').item.json.leverancier }} opgeslagen (\u20ac {{ $('Function: Input valideren').item.json.totaal }})\"\n}",
          "options": {
            "response": {
              "response": {
                "fullResponse": true,
                "neverError": true
              }
            }
          }
        },
        "id": "1cdff1e6-d058-4f56-b9b4-177b3bbfb498",
        "name": "HTTP: HA terugkoppeling",
        "type": "n8n-nodes-base.httpRequest",
        "typeVersion": 4,
        "position": [
          864,
          0
        ]
      },
      {
        "parameters": {
          "respondWith": "json",
          "responseBody": "={{ JSON.stringify({ success: true, type: 'inkoop', bericht: 'Inkoop van ' + $('Function: Input valideren').item.json.leverancier + ' opgeslagen (\u20ac ' + $('Function: Input valideren').item.json.totaal + ')' }) }}",
          "options": {}
        },
        "id": "a1c1a3c8-cba0-46ce-b6e5-0f7d03d14228",
        "name": "Respond to Webhook",
        "type": "n8n-nodes-base.respondToWebhook",
        "typeVersion": 1,
        "position": [
          1072,
          0
        ]
      }
    ],
    "connections": {
      "Webhook: Inkoop opslaan": {
        "main": [
          [
            {
              "node": "Function: Input valideren",
              "type": "main",
              "index": 0
            }
          ]
        ]
      },
      "Function: Input valideren": {
        "main": [
          [
            {
              "node": "MySQL: Inkoop invoegen",
              "type": "main",
              "index": 0
            }
          ]
        ]
      },
      "MySQL: Inkoop invoegen": {
        "main": [
          [
            {
              "node": "MySQL: Grootboekboeking inkoop",
              "type": "main",
              "index": 0
            }
          ]
        ]
      },
      "MySQL: Grootboekboeking inkoop": {
        "main": [
          [
            {
              "node": "HTTP: HA terugkoppeling",
              "type": "main",
              "index": 0
            }
          ]
        ]
      },
      "HTTP: HA terugkoppeling": {
        "main": [
          [
            {
              "node": "Respond to Webhook",
              "type": "main",
              "index": 0
            }
          ]
        ]
      }
    },
    "authors": "Ruud Hogenberg",
    "name": null,
    "description": null,
    "autosaved": false,
    "workflowPublishHistory": [
      {
        "createdAt": "2026-06-07T09:31:59.749Z",
        "id": 348,
        "workflowId": "Lz2UMDBaUWjpjzyI",
        "versionId": "b19d0bba-3fc6-41fe-9caf-a81b235020ae",
        "event": "activated",
        "userId": "4e4dfe16-eb75-4c88-ac33-b7c362667bc3"
      },
      {
        "createdAt": "2026-06-07T09:31:59.678Z",
        "id": 347,
        "workflowId": "Lz2UMDBaUWjpjzyI",
        "versionId": "b19d0bba-3fc6-41fe-9caf-a81b235020ae",
        "event": "deactivated",
        "userId": "4e4dfe16-eb75-4c88-ac33-b7c362667bc3"
      }
    ]
  }
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

Natuurwaarnemer ERP — Inkoop opslaan. Uses mySql, httpRequest. Webhook trigger; 6 nodes.

Source: https://github.com/natuurwaarnemer/Boekhouden-in-HA/blob/0c3c42a80c3b9d7662c1fa47d01f7082b74097c3/n8n/inkoop_opslaan.json — original creator credit. Request a take-down →

More Data & Sheets workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

Data & Sheets

BP_check. Uses googleSheets, @n-octo-n/n8n-nodes-json-database, httpRequest, itemLists. Webhook trigger; 99 nodes.

Google Sheets, @N Octo N/N8N Nodes Json Database, HTTP Request +2
Data & Sheets

v25.1.3. Uses httpRequest, mySql, n8n-nodes-zohozeptomail. Webhook trigger; 98 nodes.

HTTP Request, MySQL, N8N Nodes Zohozeptomail
Data & Sheets

BP_check2. Uses googleSheets, @n-octo-n/n8n-nodes-json-database, httpRequest, itemLists. Webhook trigger; 95 nodes.

Google Sheets, @N Octo N/N8N Nodes Json Database, HTTP Request +2
Data & Sheets

InsertDB. Uses mySql, httpRequest. Webhook trigger; 29 nodes.

MySQL, HTTP Request
Data & Sheets

N8Nworkflow. Uses stopAndError, httpRequest, mySql. Webhook trigger; 22 nodes.

Stop And Error, HTTP Request, MySQL