# How to add an AI chatbot to Epicor Prophet 21

> Source: https://netray.co/integrations/epicor-prophet-21-ai-chatbot
> Publisher: Netray (netray.co), AI and integration engineering for ERP and manufacturing systems.
> Section: Integrations

## Short answer

A Prophet 21 chatbot answers staff or customer questions from live ERP data, such as order status, stock and invoices, and hands off to a person when it cannot. Build it on read-only views or the P21 API with strict identity checks, and run it on-prem with an open model if the data must stay inside.

## System

Epicor Prophet 21

## Capability

ai-chatbot

## Intro

Distributors spend a large share of staff time answering the same questions: where is my order, do you have this in stock, can you resend an invoice, what is my account balance. These come in by phone, email and portal, and each answer means opening one or two P21 windows. A chatbot grounded in P21 data can take the routine ones and let people handle the exceptions.

There are two quite different audiences. An internal assistant for counter, inside sales and purchasing can see more and tolerate occasional roughness. A customer-facing bot, perhaps inside a web store or customer portal, sees only that customer's data and must never guess. The design differs mostly in identity and what the bot is permitted to say.

This page covers both, the integration points in Prophet 21, and the guardrails that make the difference between a helpful bot and one that costs you a customer.

## Use Cases

### Customer order status portal chat

**Description:** A signed-in contractor asks where their delivery is. The bot looks up their open orders, ship dates and tracking and answers, with a button to message the account rep if something is wrong.

### Invoice and statement requests

**Description:** The bot finds the invoice by number, PO or date range for the authenticated customer and sends a PDF or link, reducing AR inbox requests.

### Internal counter assistant

**Description:** Counter staff ask about stock across branches, alternates and customer last purchase price. The bot answers with source references so staff can verify in P21.

### Product and spec question answering

**Description:** Using item descriptions, attributes and attached spec sheets, the bot answers technical questions and shows the matching stocked items with availability.

### Policy and process help desk

**Description:** Staff ask how to process a special order, return or drop ship in P21. The bot answers from your internal procedures and links to the right documents.

## System Surface

SQL Server views for orders, shipments, invoices, items and availability. Fast to build for read-only answers, and reproducible against known P21 screens.

P21 APIs (Interactive, Transaction and data services depending on version) for logic-heavy answers like customer-specific pricing, and for any action such as creating an RMA request.

Epicor commerce and portal products (for example eCommerce or customer portal offerings in the Epicor line): the likely home of a customer-facing bot. Their extension and API options depend on product and version, so check them.

Attachments and document links: spec sheets, certifications and invoice PDFs that can be indexed for retrieval, subject to where P21 stores them.

Identity: P21 user and contact records for staff, and portal or web store accounts for customers. The bot must tie every request to a verified identity before running any query.

## How It Works

### Decide the audience and the boundary

**Detail:** Start internal if you are unsure. Write down exactly what the bot may answer and what it must refuse or escalate, such as pricing disputes and credit decisions.

### Build the grounding tools

**Detail:** Create tools for order status, availability, invoice lookup and item search that take an authenticated identity as a hidden parameter, so the model cannot request another customer's data.

### Add retrieval for documents

**Detail:** Index procedures, product spec sheets and policy documents for retrieval. Keep this separate from transactional lookups, and cite the source in answers.

### Pick the model and host

**Detail:** A hosted model is quickest. A local open-weight model on your own server suits private data. Smaller models can handle scripted lookups well if tools are clear.

### Embed it where users already are

**Detail:** Place it in the customer portal, a Teams channel for staff, or a web widget. A side panel that opens beside P21 windows is possible through custom UI options, depending on version.

### Build handoff and feedback

**Detail:** When confidence is low, the bot creates a case or emails the right rep with the conversation attached. Collect thumbs up or down and review failures weekly.

## Example Flows

### Customer asks about a late delivery

**Trigger:** A signed-in customer types: where is my order for the Elm Street job?

**Steps:**

- The bot calls the order search tool scoped to the customer's account and matches the ship-to or job reference.
- It reads shipment status, carrier and tracking number.
- It replies with the status and expected date, or says the order is backordered and when stock is due.
- If the customer says it is urgent, it notifies the account rep with the order number.

**Result:** The customer gets a factual answer immediately, and urgent cases reach a person with context.

### Counter staff checks alternates

**Trigger:** A counter user asks for stock of an item that shows zero on hand.

**Steps:**

- The bot checks availability across branches and inbound POs.
- It looks up alternates and cross-references for the item.
- It lists nearby branches with stock and stocked substitutes with prices.

**Result:** The user can offer a transfer or substitute while the customer is still at the counter.

### Invoice copy request

**Trigger:** A customer asks for last month's invoice for PO 55120.

**Steps:**

- The bot verifies the session identity.
- It searches invoices for that customer by PO reference and period.
- It returns the link to the invoice PDF from the portal or an emailed copy to the address on file.

**Result:** An AR clerk is not involved, and the document goes only to an address already on the account.

## On Prem

A staff chatbot is a natural fit for fully on-prem operation: an open-weight model on a local GPU, retrieval over your procedures and spec sheets in a local vector store, and read-only access to SQL Server views over the internal network. No customer or pricing data leaves the building. A customer-facing bot is trickier, because customers reach it from the internet, so you need a hardened gateway and authentication tier in a DMZ, with the model and P21 still internal. For Epicor-hosted P21, plan on the supported APIs and any customer portal product, and confirm what data the vendor allows you to pull into your own bot.

## Security

- Resolve identity before any lookup and inject it server-side. Never let the model choose the customer ID.
- For customer bots, return only the customer's own orders, invoices and prices, and never cost, margin or other customers' data.
- Add prompt injection defenses: treat user text and document content as untrusted, and keep tools read-only unless an action is explicitly approved.
- Rate limit and monitor for scraping, such as repeated item lookups meant to extract the price list.
- Log conversations with retention aligned to privacy rules, and give a way to delete them.

## Options

### Epicor portal or commerce features

**Fit:** Use first if your Epicor products already include an assistant that covers order status and invoices to your satisfaction.

**Effort:** Configuration and licensing, little custom work.

### General chatbot platform with your own connector

**Fit:** Reasonable for a customer widget when you can accept the platform hosting data and you build the grounding tools yourself.

**Effort:** A few weeks, plus platform fees.

### Private chatbot on your own infrastructure

**Fit:** For internal use or sensitive pricing, with a local model and role-aware tools. Netray builds this, as do other integrators.

**Effort:** Several weeks for a first release, then added topics.

## Pitfalls

- Letting the model decide who the customer is. Identity must come from the session, never from the conversation text.
- Answering price questions without applying contract pricing, so the bot quotes list price to a customer on a contract.
- No handoff path. A bot that cannot escalate frustrates customers faster than a phone queue.
- Mixing documents and transactions in one retrieval index, which makes the bot confidently paraphrase stale policy as if it were live stock.
- Launching to customers first. Run internally for a month, learn the failure modes, then expose a narrow scope externally.

## Faq

### Can the chatbot live inside Prophet 21 itself?

**Answer:** Possibly as a companion panel or an embedded web view, depending on your version and customization options. Many teams find it simpler to run the bot in Teams, a browser tab or the customer portal, and link to P21 records, rather than modifying the desktop client.

### How do we keep it from giving wrong stock numbers?

**Answer:** Make the bot quote tool output only and forbid estimation. Define in the tool whether it returns on-hand or available, and use the same definition counter staff use. Test it against P21 screens for a set of items before launch, and retest after upgrades.

### Does a customer-facing bot need a hosted model?

**Answer:** No. A local open-weight model can power it from your data center behind a hardened gateway. A hosted model can be simpler and stronger at language, but then order and invoice data pass to the provider, which you should confirm is acceptable to you and your customers.

### Can it take orders?

**Answer:** It can collect the details and create a draft quote or cart for review, using the supported P21 or commerce API. Fully automatic order entry is riskier, because of pricing, credit and allocation rules, so most distributors keep a human or an explicit customer confirmation step.

### What does it cost to run?

**Answer:** Costs fall into model usage or GPU hardware, hosting for the bot and retrieval store, and engineering time. A local model has a fixed cost that favors steady volume, while hosted models charge by usage. Estimate from your monthly question volume before choosing.

## Search terms

epicor prophet 21 ai chatbot, prophet 21 chatbot, p21 customer service bot, chatbot for distributors erp, p21 order status chatbot, prophet 21 customer portal ai, on-prem chatbot for erp, ai assistant for epicor p21, p21 virtual assistant, add chatbot to prophet 21

---
Talk to an engineer: https://netray.co/contact?intent=erp_ai | Machine catalog: https://netray.co/agent/catalog.json
