MRPeasy + n8n: Auto Purchase Orders at Minimum Stock

MRPeasy + n8n: Bestellungen automatisch bei Mindestbestand

🇬🇧 English

This article contains affiliate links. If you buy through them, we may earn a commission at no extra cost to you.

MRPeasy + n8n: Auto-Generate Purchase Orders When Inventory Hits Minimum Stock

Running out of a critical component mid-production is one of the most avoidable disruptions in manufacturing — yet it still happens constantly in small and mid-sized operations. The fix is not hiring someone to stare at stock levels all day. The fix is automation. By connecting MRPeasy with n8n, you can build a workflow that monitors your inventory in real time and fires off a purchase order the moment a part or material drops to its minimum stock threshold.

This guide walks you through exactly how to set that up — no custom code required, no expensive middleware, just a clean workflow that runs in the background while your team focuses on production.

What You Need Before You Start

  • MRPeasy account — with API access enabled (available on Starter plan and above)
  • n8n instance — either self-hosted (free) or via n8n, which offers n8n Cloud with 400+ integrations and no infrastructure to manage
  • Supplier data in MRPeasy — each item that needs auto-ordering must have a default supplier and a minimum stock level configured
  • MRPeasy API key — found under Settings → Integrations → API in your MRPeasy dashboard

How the Workflow Logic Works

The core idea is simple: n8n polls the MRPeasy API on a schedule, checks current stock quantities against the defined minimum levels, and — when a shortfall is detected — creates a purchase order automatically in MRPeasy and optionally sends a notification to your purchasing team.

Here is the step-by-step flow:

  1. Trigger: A Schedule node runs the workflow every hour (or at whatever interval fits your operation).
  2. Fetch stock levels: An HTTP Request node calls the MRPeasy REST API endpoint GET /api/v1/stock/ to retrieve current quantities for all tracked items.
  3. Filter below-minimum items: A Function or IF node compares quantity_on_hand against minimum_stock for each item and passes only those that are at or below the threshold.
  4. Check for open POs: An optional HTTP Request node calls GET /api/v1/purchaseorders/ and filters for open orders containing the same item — preventing duplicate orders from being created.
  5. Create purchase order: For items that pass both filters, a POST request to /api/v1/purchaseorders/ creates the PO with the item, quantity to order (reorder quantity from MRPeasy), supplier ID, and expected delivery date.
  6. Notify the team: A final node sends a Slack message, email, or Teams notification summarising which POs were created, what was ordered, and from which supplier.

Setting Up the MRPeasy API Call in n8n

Step 1 — Add an HTTP Request node

In your n8n canvas, add an HTTP Request node after the Schedule trigger. Set the method to GET and the URL to:

https://app.mrpeasy.com/api/v1/stock/

Under Authentication, choose Header Auth and add your MRPeasy API key as:

  • Header name: Authorization
  • Header value: Bearer YOUR_API_KEY

Step 2 — Filter with a Function node

Add a Function node and use this logic to extract items below minimum stock:


const items = $input.all();
return items.filter(item => {
 const qty = item.json.quantity_on_hand;
 const min = item.json.minimum_stock;
 return qty !== null && min !== null && qty <= min;
});

Step 3 — Deduplicate with an open PO check

Before creating a new PO, fetch existing open purchase orders via GET /api/v1/purchaseorders/?status=open and use an IF node to skip any item that already has an open order. This prevents the workflow from flooding your suppliers with duplicate requests if it runs frequently.

Step 4 — POST the new purchase order

Add another HTTP Request node, set it to POST, and point it to /api/v1/purchaseorders/. In the JSON body, map the following fields from the filtered stock data:

  • item_id — the MRPeasy product ID
  • supplier_id — from the item's default supplier field
  • quantity — use the item's reorder_quantity field, or calculate it as minimum_stock - quantity_on_hand + safety_buffer
  • expected_delivery — today's date plus the item's configured lead time in days

Extending the Workflow

Multi-supplier logic

If some items have multiple approved suppliers, you can add a Switch node that selects the preferred supplier based on lead time, price tier, or availability — all stored as custom fields in MRPeasy.

Approval gate

Instead of creating POs automatically, you can route large orders (above a defined value threshold) to a Slack approval step. A manager clicks Approve or Reject directly in Slack before the PO is submitted to MRPeasy. n8n's Wait node handles this elegantly.

Google Sheets log

Append every auto-generated PO to a Google Sheet for audit purposes — date, item, quantity, supplier, and PO reference number. This gives your finance team a clean paper trail without requiring them to log in to MRPeasy.

Common Mistakes to Avoid

  • Not setting minimum stock in MRPeasy: The workflow cannot trigger if the field is empty. Audit your item master before activating.
  • Missing default supplier: Each item must have a default supplier configured or the POST will fail. Use an error branch to catch these and notify a human.
  • Running too frequently: Polling every 5 minutes is rarely necessary for inventory checks and can hit API rate limits. Every 1–4 hours is usually sufficient.
  • No duplicate PO check: Skipping step 3 above means the workflow may create multiple POs for the same item on consecutive runs before the first order is received and stock is updated.

Results You Can Expect

Small manufacturers who implement this pattern typically report:

  • Elimination of manual daily stock checks for reorder decisions
  • Faster PO creation — from hours to seconds once a threshold is crossed
  • Fewer stockouts, since the buffer is enforced automatically every time the workflow runs
  • A clear audit trail of every auto-generated order, with timestamps and quantities

The investment is a few hours of setup. The payoff is a procurement process that runs itself.

If you manage inventory for a small or mid-sized manufacturing operation, you can track stock levels and manage purchasing via MRPeasy — including production planning, inventory and purchasing in one cloud ERP — to stop stockouts before they disrupt your production line.

🇩🇪 Deutsch

Dieser Artikel enthält Affiliate-Links (Werbung). Kaufst du darüber, erhalten wir ggf. eine Provision – für dich ohne Mehrkosten.

MRPeasy + n8n: Bestellungen automatisch auslösen, wenn der Mindestbestand erreicht ist

Ein kritisches Bauteil mitten in der Produktion nicht mehr vorrätig zu haben, ist eine der am häufigsten vermeidbaren Unterbrechungen in kleinen und mittelständischen Fertigungsbetrieben — und dennoch passiert es ständig. Die Lösung liegt nicht darin, jemanden abzustellen, der den ganzen Tag auf Lagerbestände starrt. Die Lösung ist Automatisierung. Wenn du MRPeasy mit n8n verbindest, kannst du einen Workflow aufbauen, der deine Bestände kontinuierlich überwacht und automatisch eine Bestellung auslöst, sobald ein Material oder Bauteil den konfigurierten Mindestbestand unterschreitet.

Diese Anleitung zeigt dir Schritt für Schritt, wie das funktioniert — ohne eigenen Code, ohne teure Middleware, nur ein sauberer Workflow, der im Hintergrund läuft, während dein Team sich auf die Produktion konzentriert.

Was du vorher brauchst

  • MRPeasy-Konto — mit aktiviertem API-Zugang (ab dem Starter-Plan verfügbar)
  • n8n-Instanz — entweder selbst gehostet (kostenlos) oder über n8n, das n8n Cloud mit über 400 Integrationen anbietet, ohne eigene Infrastruktur
  • Lieferantendaten in MRPeasy — jeder Artikel, der automatisch nachbestellt werden soll, muss einen Standardlieferanten und einen Mindestbestand haben
  • MRPeasy API-Schlüssel — zu finden unter Einstellungen → Integrationen → API in deinem MRPeasy-Dashboard

Wie die Workflow-Logik funktioniert

Die Grundidee ist einfach: n8n fragt die MRPeasy API nach einem Zeitplan ab, vergleicht die aktuellen Lagermengen mit den definierten Mindestbeständen und legt — wenn ein Unterschreiten erkannt wird — automatisch eine Bestellung in MRPeasy an. Optional wird dein Einkaufsteam per Benachrichtigung informiert.

Der Ablauf im Detail:

  1. Auslöser: Ein Schedule-Node startet den Workflow stündlich (oder in einem anderen Intervall, das zu deinem Betrieb passt).
  2. Lagerbestände abrufen: Ein HTTP-Request-Node ruft den MRPeasy REST API-Endpunkt GET /api/v1/stock/ auf und liefert die aktuellen Mengen aller getrackten Artikel.
  3. Artikel unterhalb des Minimums filtern: Ein Function- oder IF-Node vergleicht quantity_on_hand mit minimum_stock für jeden Artikel und leitet nur jene weiter, die den Schwellenwert erreicht oder unterschritten haben.
  4. Offene Bestellungen prüfen: Ein optionaler HTTP-Request-Node ruft GET /api/v1/purchaseorders/?status=open auf und filtert Artikel heraus, für die bereits eine offene Bestellung besteht — damit keine Duplikate entstehen.
  5. Bestellung anlegen: Für Artikel, die beide Filter passiert haben, erstellt ein POST-Request an /api/v1/purchaseorders/ die Bestellung mit Artikel, Menge, Lieferanten-ID und voraussichtlichem Lieferdatum.
  6. Team benachrichtigen: Ein abschließender Node sendet eine Slack-Nachricht, E-Mail oder Teams-Meldung mit einer Zusammenfassung der angelegten Bestellungen.

Den MRPeasy API-Aufruf in n8n einrichten

Schritt 1 — HTTP-Request-Node hinzufügen

Füge nach dem Schedule-Trigger einen HTTP Request-Node hinzu. Setze die Methode auf GET und die URL auf:

https://app.mrpeasy.com/api/v1/stock/

Unter Authentifizierung wähle Header Auth und trage deinen API-Schlüssel ein:

  • Header-Name: Authorization
  • Header-Wert: Bearer DEIN_API_SCHLÜSSEL

Schritt 2 — Mit einem Function-Node filtern

Füge einen Function-Node hinzu und nutze folgende Logik, um Artikel unterhalb des Mindestbestands herauszufiltern:


const items = $input.all();
return items.filter(item => {
 const qty = item.json.quantity_on_hand;
 const min = item.json.minimum_stock;
 return qty !== null && min !== null && qty <= min;
});

Schritt 3 — Duplikate durch Prüfung offener Bestellungen vermeiden

Rufe vor der Erstellung einer neuen Bestellung die offenen Bestellungen über GET /api/v1/purchaseorders/?status=open ab und überspringe mit einem IF-Node alle Artikel, für die bereits eine offene Bestellung vorliegt. So wird verhindert, dass der Workflow bei häufigem Durchlauf mehrfach dieselbe Bestellung anlegt, bevor der erste Wareneingang gebucht wurde.

Schritt 4 — Neue Bestellung per POST anlegen

Füge einen weiteren HTTP Request-Node hinzu, setze ihn auf POST und ziele auf /api/v1/purchaseorders/. Mappe im JSON-Body folgende Felder aus den gefilterten Lagerdaten:

  • item_id — die MRPeasy-Produkt-ID
  • supplier_id — aus dem Standardlieferantenfeld des Artikels
  • quantity — nutze das Feld reorder_quantity des Artikels oder berechne: minimum_stock - quantity_on_hand + Sicherheitspuffer
  • expected_delivery — heutiges Datum plus die konfigurierte Lieferzeit des Artikels in Tagen

Den Workflow erweitern

Mehrere Lieferanten berücksichtigen

Wenn für manche Artikel mehrere freigegebene Lieferanten hinterlegt sind, kannst du einen Switch-Node einbauen, der anhand von Lieferzeit, Preisstaffel oder Verfügbarkeit — gespeichert als benutzerdefinierte Felder in MRPeasy — automatisch den optimalen Lieferanten auswählt.

Freigabe-Schleife für große Bestellungen

Statt Bestellungen vollautomatisch anzulegen, kannst du große Aufträge (ab einem bestimmten Warenwert) in einen Slack-Freigabeschritt leiten. Ein Verantwortlicher klickt direkt in Slack auf Freigeben oder Ablehnen, bevor die Bestellung in MRPeasy übermittelt wird. Der Wait-Node von n8n übernimmt das reibungslos.

Google-Sheets-Protokoll

Jede automatisch erstellte Bestellung kann in ein Google Sheet geschrieben werden — Datum, Artikel, Menge, Lieferant und Bestellreferenz. So erhält dein Buchhaltungsteam eine saubere Nachverfolgung, ohne sich in MRPeasy einloggen zu müssen.

Häufige Fehler, die du vermeiden solltest

  • Kein Mindestbestand in MRPeasy gepflegt: Der Workflow kann nicht auslösen, wenn das Feld leer ist. Prüfe deinen Artikelstamm, bevor du den Workflow aktivierst.
  • Kein Standardlieferant hinterlegt: Jeder Artikel braucht einen Standardlieferanten, sonst schlägt der POST fehl. Baue einen Fehlerpfad ein, der in solchen Fällen eine Benachrichtigung sendet.
  • Zu häufige Ausführung: Eine Abfragefrequenz von 5 Minuten ist für Lagerprüfungen selten nötig und kann API-Ratenlimits treffen. Stündliche bis vierstündliche Intervalle sind in der Regel ausreichend.
  • Kein Duplikat-Check: Wer Schritt 3 weglässt, riskiert mehrfache Bestellungen für denselben Artikel bei aufeinanderfolgenden Workflow-Läufen, bevor der erste Wareneingang gebucht ist.

Was du erwarten kannst

Kleine Fertigungsbetriebe, die dieses Muster einsetzen, berichten typischerweise von:

  • Wegfall manueller täglicher Lagerprüfungen für Nachbestellentscheidungen
  • Deutlich schnellerer Bestellanlage — von Stunden auf Sekunden, sobald ein Schwellenwert unterschritten wird
  • Weniger Produktionsunterbrechungen durch leere Lager, da der Puffer automatisch durchgesetzt wird
  • Einem lückenlosen Prüfpfad jeder automatisch erstellten Bestellung mit Zeitstempel und Menge

Der Aufwand liegt bei wenigen Stunden Einrichtungszeit. Der Gewinn ist ein Beschaffungsprozess, der sich selbst managt.

Wenn du Lagerbestände und Einkauf in einem kleinen oder mittelständischen Produktionsbetrieb verwaltest, kannst du über MRPeasy deine Produktion, dein Lager und deinen Einkauf in einem Cloud-ERP bündeln — inklusive Produktionsplanung, Bestandsführung und Bestellwesen — und Produktionsunterbrechungen durch leere Lager dauerhaft vermeiden.