← back to index

building an ai-powered order system

Thirty minutes per order, on average. Thousands of orders per month. Every one of them typed by hand into two separate ERP systems.

That was the starting point at a pet food manufacturer running a ten-year-old, on-prem ERP system. Their customers sent orders by email as PDFs or spreadsheets, and staff read each document and typed the data into both ERPs for every order.

INSPIRED Pet Nutrition's Tech Stack - Order Management System architecture showing Medusa OMS with Gemini AI, Resend, and ERP integrations
System architecture (source: medusajs.com)

We built an order management system on Medusa that automates the entire flow. An email arrives with a PDF or spreadsheet, and the AI parses the unstructured data into structured data in just a few minutes. The system creates a draft order, the staff reviews and confirms, and the order syncs to the correct ERP.

The result: 9x faster order processing, an 80% cost reduction, and most orders now flow through automatically.

what i learned

Start with workflows, not screens. By that I mean: understand the business and its processes first. That gave us the input to map the entire order flow before writing any code, and it made the technical decisions obvious. Understanding the process came before choosing technology. The process mapping also helped a lot to understand the technical limitations of both ERP systems that needed to be integrated. Pain experienced by the end user clearly showed the technical challenges with both ERP systems. And there were plenty of lessons in integrating 10-year-old, on-prem ERP systems with a modern cloud-hosted solution. 

Modular wins. Each ERP got its own module. When one ERP changes (like Tropos switching from VPN to direct API), we update one module. 

AI is a tool, not magic. It parses emails well, but humans still review orders. The system suggests, shows how confident it is, and the staff confirms. This balance enables production reliability. Trust but verify.

why it worked

Medusa’s modular architecture let us build exactly what was needed. We extended it with custom modules for each ERP (IFS and Tropos), added AI parsing workflows, and built a tailored Admin UI. With this approach, we could leverage OOTB capabilities of Medusa and extend with the specifics needed to solve the problem, and we could focus on the part that would bring most value to the business.

The tech stack: Medusa 2.5 for the OMS backbone, Medusa Admin with a custom-developed Microsoft SSO for the UI, AWS (Fargate, CloudFront) via SST v3, PostgreSQL on Neon, SOPS for secrets management.

the details

INSPIRED Pet Nutrition is now scaling the system to a third ERP after another acquisition. The architecture evolved into a reusable B2B automation product we’re offering to other manufacturers. Read the full case study on Medusa’s blog.


I led this project as Solution Delivery Director at rb2, with some solution architecture and hands-on coding mixed in.