Mock ERP API for prototyping integrations and agent demos

Starting promptUse this prompt as a starting point to build your workflow.

Build a self-contained mock ERP (enterprise resource planning) REST API that other workflows, demos, or front-ends can call to simulate a small business's back office. It should behave like a real ERP: persistent data, cross-module side effects (confirming a sale draws down inventory and posts to the general ledger), and honest error responses. Trigger it with a single HTTP route (e.g. /erp-api) that accepts JSON requests and returns JSON. Keep the endpoint private (space or tenant auth) unless you specifically want it callable from outside. Back it with an embedded SQLite database (use Bun's built-in SQLite — or another lightweight embedded store) living in a persistent named volume, so data survives across runs. On first use, create the schema and seed it with realistic starter data across these modules: chart of accounts and general-ledger journal entries; AR/AP invoices and payments; inventory items, warehouses, and stock levels; purchase orders and sales orders; manufacturing (products, bills of materials, production orders, QA checks); HR (departments, employees, payroll runs); and CRM (customers, opportunities). Expose generic CRUD (list with simple filters, get, create, update, delete) over each resource, plus higher-level business-logic actions that span modules and stay transactional and internally consistent: Confirm a sales order: check stock, decrement inventory, raise an AR invoice, and post revenue + COGS to the ledger. Receive a purchase order: add inventory, raise an AP bill, and post to the ledger. Pay an invoice (AR or AP): record the payment, update its status, and post the ledger entry. Release a production order: verify component availability against the BOM, consume components, produce finished goods, and open a QA check. Run payroll for a period across active employees, computing gross/tax/net and posting to the ledger. A cross-module KPI summary endpoint (financials, supply chain, HR, CRM, manufacturing). Return proper HTTP status codes (404 for missing records, 409 for conflicts like insufficient stock or already-paid invoices, 422 for validation errors) with clear JSON error messages. Keep money in integer cents. Structure the code cleanly — separate the database/schema/seed layer, request parsing and shared HTTP/CRUD helpers, and the business logic — rather than one large file. This workflow needs no third-party services; if you later want to notify a channel or sync a record on key events, wire in your team's chat tool (e.g. Slack) or system of record as an optional add-on. Tools used: Bun SQLite (bun:sqlite), 3B

New to Tines?Sign up free for Tines 3B Explore Edition

What this prompt builds

A self-contained mock ERP REST API that simulates real business-system behavior—inventory, accounting, HR, manufacturing, and CRM—with persistent SQLite storage and genuine cross-module transactional logic. Designed for developers, solutions engineers, and AI-agent builders who need a realistic backend for prototyping integrations, automations, and dashboards without provisioning slow, expensive production ERPs or settling for toy mocks. One-step deployment delivers a believable system of record with seeded data, proper HTTP semantics, and state that persists across runs.

The problem

Developers, solutions engineers, and AI-agent builders prototyping integrations—order-to-cash, procure-to-pay, inventory alerts, financial reporting—hit a wall when they need a realistic backend: real ERPs like NetSuite, SAP, or Dynamics are slow, expensive, and impossible to get sandbox access to during a hackathon or demo sprint, while toy "todo API" mocks lack the cross-module side effects, accounting logic, and inventory behavior of an actual business system. This workflow solves that by delivering a self-contained, believable ERP API in one step—no external accounts, no credentials—seeded with sample data and ready to call instantly, so teams can build and demo against a system that behaves like the real thing.

Solution and impact

The workflow provides a full ERP simulated behind a clean REST API, backed by persistent SQLite storage and genuine transactional business logic: confirming a sales order checks stock, moves inventory, creates an invoice, and posts double-entry journal entries to the general ledger, with the same integrity across purchasing, payroll, and manufacturing. A cross-module KPI endpoint surfaces real-time metrics like cash, open AR/AP, low-stock items, headcount, and pipeline. What normally takes days of provisioning and licensing—or yields an unconvincing hand-rolled mock—becomes an endpoint callable in seconds, with data that behaves like an actual business, accelerating prototyping and making demos far more credible for developers, SEs, and agent builders.