Inspiration

The inspiration for OrderMitra came from my dad's pharmaceutical wholesale business. Growing up around the business, I saw how much manual work went into processing everyday orders. Retail pharmacies would place orders through phone calls and WhatsApp messages. On WhatsApp, they sent text messages, voice notes, photographs of handwritten lists, PDFs, and Excel sheets. These orders could arrive in English, Hindi, Kannada, Tamil, or Telugu.

When a retailer called, someone had to answer the phone, listen to the requested medicines, write everything down, confirm quantities, check availability, and enter the order manually. At the same time, other retailers continued sending WhatsApp orders. The staff had to switch between conversations, stock records, retailer credit details, and billing. This made the process time consuming and increased the risk of mistakes, delayed orders, and incorrect invoices.

Seeing this problem firsthand in my dad's business made me realize that the issue was not simply a lack of software. The entire ordering process was disconnected. Communication, inventory, credit management, and billing were handled as separate tasks, even though each depended on the same order information.

I wanted to connect these steps into one intelligent workflow without forcing retailers to change how they communicate. That idea led to OrderMitra, an AI powered order desk designed to connect retailer communication with the wholesaler's actual business operations.

What it does

OrderMitra is an AI powered order management system for pharmaceutical wholesalers. It is designed to turn incoming retailer orders into structured, verified, and billable transactions through one connected application.

Retailers can send orders through WhatsApp using text, voice notes, handwritten order photos, PDFs, and Excel or CSV files. The AI agent interprets supported messages and attachments, identifies the requested medicines and quantities, and matches them against the wholesaler's catalogue. The system supports five languages: English, Hindi, Kannada, Tamil, and Telugu.

Phone calls are another important part of the problem we identified. In a traditional wholesale business, staff must manually record orders received over the phone. OrderMitra's current automated intake is built around WhatsApp, while integrating phone call ordering into the same workflow is part of our future vision.

Once an order is interpreted, the application checks the relevant business data. It verifies available inventory by batch and expiry date, checks retailer credit conditions and outstanding bills, and identifies cases that require drug licence verification or human review. When a product is unavailable, it can suggest an alternative with the same composition. After the order passes the necessary checks, the application generates a GST invoice with product details, HSN codes, batch numbers, expiry dates, quantities, and applicable taxes.

The wholesaler's team can review the order and its processing history through a central dashboard. OrderMitra also includes payment links, early payment discount handling, GST reporting, demand forecasting, stock replenishment suggestions, expiry alerts, and a dashboard assistant.

The main idea is that information should not have to be entered and checked independently at every stage. Once an order is captured, the relevant parts of the business should work from the same underlying records.

How we built it

We built OrderMitra using Next.js and TypeScript, with SQLite as the database. The application acts as the central connection point between incoming orders, AI interpretation, inventory records, retailer information, billing, payments, and the wholesaler dashboard.

The communication flow begins when a retailer sends an order through WhatsApp. Meta's WhatsApp Business platform delivers incoming messages and supported attachments to our application through webhooks. During local development, we use ngrok to expose our development server through a public HTTPS URL so Meta can reach the application.

The incoming message is passed to the order processing logic, which determines what kind of input it contains and prepares it for interpretation. The AI layer uses Google AI Studio by default, with additional support for NVIDIA Nemotron models through OpenAI compatible endpoints. We configured Nebius AI Studio, also known as Nebius Token Factory, as our primary Nemotron provider, with NVIDIA's API and self hosted NVIDIA NIM available as alternatives.

The AI agent interprets the retailer's message and converts it into structured order information, such as medicine names, requested quantities, units, and the retailer's intent. That structured information is then passed to the application's order processing logic. The AI does not independently decide the final invoice amount or directly determine whether stock or credit rules should be bypassed.

The application matches the interpreted items against the product catalogue stored in SQLite. It retrieves the relevant stock batches, checks expiry dates and available quantities, and applies the configured business rules. Retailer records provide the information needed for credit checks, outstanding balances, and drug licence verification. If an item is unavailable, the application can offer a suitable alternative for the retailer or wholesaler to consider.

Once the order is ready to proceed, the billing logic calculates the product totals, taxable values, GST, and applicable payment terms. The invoice generator uses this verified information to create the GST invoice. Razorpay provides payment links, with a UPI link available as a fallback. Payment notifications can return through the configured Razorpay webhook, allowing the application to update the relevant payment records.

The resulting order, invoice, and processing information are available through the wholesaler's dashboard. Staff can inspect the order details, review AI actions, resolve credit or licence holds, monitor stock, and manage dispatch. Other dashboard features use the same underlying business data to provide expiry reports, outstanding payment information, demand forecasts, and GST return summaries.

The connection between these components is what makes OrderMitra more than a chatbot. A message received through WhatsApp starts a workflow that connects AI interpretation to real catalogue records, stock checks, retailer verification, billing, payment handling, and human review.

We also designed safeguards around these connections. Incoming messages and uploaded documents are treated as data rather than trusted instructions. Sensitive changes can require confirmation, inputs are validated before being saved, and supported assistant actions are logged. The AI helps understand what needs to happen, while the application enforces the rules that govern what can actually happen.

Challenges we ran into

One of our biggest challenges was connecting different types of communication to a consistent order processing workflow. A retailer might send a handwritten Kannada order, follow it with a Hindi voice note, and then clarify a quantity through another message. The system had to interpret the information, identify the correct medicines, and preserve the requested quantities without confusing different products or units.

Another challenge was ensuring that every component used consistent information. The order interpretation layer, product catalogue, batch inventory, retailer credit records, and billing system all depend on one another. A correctly interpreted order is still not useful if it is matched to the wrong product, checked against outdated stock, or billed using incorrect values.

We also had to ensure that AI interpretation remained separate from financial calculations. Instead of allowing a model to generate invoice totals or make unchecked stock changes, we designed the application to validate the interpreted order and use deterministic business logic for calculations and important decisions.

Connecting WhatsApp webhooks, AI providers, Razorpay, database operations, and the dashboard required careful integration as well. Each component has a different responsibility, but they must work together without losing the context of the original order.

Phone calls highlighted another important limitation in traditional workflows. Unlike WhatsApp messages, calls require someone to listen and record the details. Bringing phone ordering into the same automated pipeline is a future extension that would require an appropriate telephony integration and safeguards for confirming spoken medicine names and quantities.

Accomplishments that we're proud of

We are proud of building an end to end application that connects retailer communication with the operational systems of a pharmaceutical wholesaler. Rather than creating an isolated AI chatbot, we connected WhatsApp order intake, AI based interpretation, product matching, batch inventory, credit and licence checks, GST invoice generation, payment integration, and reporting.

We are particularly proud of the separation between AI and business logic. The AI interprets what the retailer is requesting, while the application calculates financial values, applies inventory rules, and enforces configured controls. This makes the architecture more appropriate for a domain where accuracy and accountability matter.

We also built a flexible AI integration that supports Google AI Studio and Nemotron compatible endpoints through Nebius AI Studio. Combined with a central database and dashboard, this gives us a foundation for connecting more communication channels and improving the order workflow over time.

Most importantly, OrderMitra addresses a real problem I observed in my dad's business. The project gave us an opportunity to apply AI to a practical operational challenge faced by small pharmaceutical wholesalers.

What we learned

We learned that the value of an AI system comes not only from how well it understands a message, but also from how effectively it communicates with the rest of the application.

The AI model, database, inventory system, billing logic, payment integration, and dashboard must each have clear responsibilities and pass information reliably between one another. A model can interpret an order, but the application must validate that interpretation against actual products, stock levels, retailer records, and business rules before the transaction proceeds.

We also learned that human oversight is essential when the system encounters ambiguity or a sensitive decision. Making the workflow traceable and requiring confirmation for important actions helps staff understand and control what the system does.

Finally, we learned that solving a real business problem requires understanding the entire process, from the first conversation with a retailer to the final invoice and dispatch, rather than automating only one isolated step.

What's next for OrderMitra

Our next goal is to connect more ordering channels to the same central workflow. We want to explore phone call integration so that spoken orders can be captured, converted into structured medicine and quantity details, confirmed with the retailer, and passed into the existing order processing system for review.

We also plan to improve multilingual voice and handwriting recognition, evaluate additional Nemotron model variants through Nebius AI Studio, and enhance demand forecasting, expiry management, and supplier reorder recommendations.

Our long term vision is to bring WhatsApp messages, phone orders, inventory, retailer records, credit management, billing, and payments together in one connected system. Instead of staff repeatedly transferring information between disconnected processes, OrderMitra aims to let information flow through a consistent workflow with appropriate validation and human oversight.

OrderMitra began with a problem I saw in my dad's pharmaceutical wholesale business. We want to turn that firsthand experience into a practical solution that helps wholesalers process orders more efficiently, reduce repetitive work, and serve their retail pharmacy customers better.

Built With

Share this project:

Updates

Submission history