# How to add Slack to Epicor Prophet 21

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

## Short answer

Create a Slack app with slash commands and interactive messages, back it with a small service that queries Prophet 21 through its middleware or a read-only SQL Server view, and write approvals back through the P21 transaction APIs. Start with read-only slash commands and alerts, then add approvals once identity mapping is in place.

## System

Epicor Prophet 21

## Capability

slack

## Intro

Slack tends to show up at distributors that have a younger sales or e-commerce team, or a regional business that grew by acquisition. Inside sales asks the warehouse channel whether an item is in stock, buyers ask each other where a PO stands, and somebody screenshots a P21 window into a thread.

A Slack app can answer those questions where they are asked. A slash command returns on-hand by location, an alert drops into the right channel when a high-value order is backordered, and an interactive message lets the right person release a hold without logging in.

This page focuses on what makes Slack different from other chat integrations: slash commands, Block Kit interactivity, the three-second response rule, and how to run it against a P21 install that may not be internet facing.

## Use Cases

### Slash command stock check

**Description:** A command like /stock followed by an item ID returns on-hand, allocated and on-order by branch, read from item location data.

### Backorder alerts to the right channel

**Description:** Route backorders on key accounts to the account's sales channel, with the line, quantity short and expected receipt date.

### Quote and order lookup

**Description:** Return a compact card for a quote or order number with status, total and next action, with a link back to P21.

### Hold release request

**Description:** Post credit or price holds as interactive messages that an authorised manager can release or reject.

### Late PO nudges

**Description:** Send buyers a thread per late PO with vendor, due date and a button to log a vendor contact note.

### E-commerce order exceptions

**Description:** Surface web orders that failed to import or were held for item mismatch, so the team sees them within minutes.

## System Surface

- P21 middleware services for item, customer, order and quote reads, and for creating notes or transactions; confirm the endpoints exposed in your version.
- SQL Server read-only views for fast lookups: item and location quantities, open sales order lines with backorder quantity, and open PO lines with due dates. Table names such as inv_mast, inv_loc, oe_line and po_line are typical but should be verified.
- Business rules or alerts to push events when holds or backorders occur, avoiding constant polling.
- Web order import tables or logs from your e-commerce integration, which are the natural source for failed-import alerts.
- P21 user records for mapping Slack users to ERP users when approvals are involved.

## How It Works

### Create the Slack app

**Detail:** Define slash commands, an interactivity request URL and an events URL, with minimal scopes such as commands, chat:write and users:read.email for identity mapping.

### Host the endpoints

**Detail:** Run a service behind HTTPS that verifies the Slack signing secret on every request. Use Socket Mode if you cannot expose an inbound URL.

### Respect the three second limit

**Detail:** Acknowledge the slash command immediately and post the answer through the response URL once the P21 query finishes.

### Build a read-only tool layer

**Detail:** Implement stock, order, quote and PO lookups as fixed parameterised queries or API calls. Do not accept free SQL from chat.

### Add outbound alerts

**Detail:** Consume P21 events from a queue and post Block Kit messages to channels chosen by rules such as account owner or branch.

### Enable interactive actions

**Detail:** Map the Slack user email to a P21 user, check approval authority, and call the P21 API with a service account, noting the human approver.

### Monitor and tune

**Detail:** Track which alerts get actioned versus muted and prune the rest.

## Example Flows

### Stock check in a sales channel

**Trigger:** A salesperson types /stock with an item number.

**Steps:**

- Slack calls the service, which acknowledges within three seconds.
- The service reads quantities for each location.
- It posts a compact table with available, allocated and next receipt.
- A button offers to open the item in a P21 link or request a transfer.

**Result:** The salesperson answers a customer in under a minute without hunting for a P21 seat.

### Backorder on a key account

**Trigger:** An order line for a flagged account goes on backorder.

**Steps:**

- The event includes order, line and quantity short.
- The service finds the expected PO receipt date for the item.
- A message goes to the account channel with alternatives if a substitute item exists.

**Result:** The account owner contacts the customer before the customer notices.

### Web order failed import

**Trigger:** The e-commerce import log records an error for an order.

**Steps:**

- The service reads the error and the web order number.
- It posts to the e-commerce channel with the failing item or customer.
- A team member replies in thread and marks it resolved.

**Result:** Failed orders are worked quickly instead of discovered at the end of the day.

## On Prem

If P21 is on-premises, keep the Slack app service inside your network and use Socket Mode so Slack connects to you over an outbound WebSocket, avoiding any inbound firewall opening. Queries go to a read-only SQL Server replica or view and the P21 middleware stays internal. Slack stores whatever you post, so keep messages short and avoid pricing or margin in public channels. If you want natural-language questions in Slack, run the language model locally and let it call the same fixed tools, returning only the final answer to the channel.

## Security

- Verify Slack request signatures and reject stale timestamps on every call.
- Keep a Slack-to-P21 identity map and check authority before any write.
- Expose only fixed lookup tools; never run user supplied SQL.
- Send sensitive data by ephemeral message to the requester rather than posting it in a shared channel.
- Store tokens in a secrets manager and rotate them on staff changes.

## Options

### iPaaS or no-code workflow

**Fit:** Simple alerts to Slack when you can already trigger from P21 data or a scheduled report.

**Effort:** A few days for basic alerts.

### Custom Slack app

**Fit:** Slash commands, interactive approvals and controlled lookups with your own rules.

**Effort:** Roughly three to six weeks.

### Partner such as Netray

**Fit:** When you want a private AI assistant answering free-form P21 questions in Slack with every query shown.

**Effort:** A pilot of several weeks on a read-only scope.

## Pitfalls

- Missing the three second acknowledgement makes the command fail visibly; always defer the real work.
- Posting prices or margins to wide channels leaks sensitive commercial data.
- Treating Slack email as proof of identity without verification invites spoofing in shared workspaces.
- Long running P21 queries from chat can load the production database; use a replica or indexed view.
- Alert fatigue; start with a few high-value events and measure action rates.

## Faq

### Is there an official Slack app for Prophet 21?

**Answer:** I am not aware of an official Epicor Slack app for P21. Some integration platforms offer generic P21 and Slack connectors, but you should confirm current availability. Most teams build a small app over the P21 APIs or a read-only database view.

### Can we avoid opening an inbound firewall port?

**Answer:** Yes. Slack Socket Mode lets your service open an outbound connection to Slack instead of receiving inbound HTTP requests. That fits an on-premises P21 environment where inbound exposure is restricted by policy.

### Can Slack users edit orders?

**Answer:** They can request changes, but it is better to start read-only. Where edits are allowed, limit them to notes, holds and simple status actions, require P21 role checks, and keep price or quantity changes in the P21 client.

### How do we handle different branches?

**Answer:** Map branches to channels and filter events by location or account owner. A routing table kept next to the integration lets operations change the destination without code changes when branches or owners change.

### Can AI answer questions in Slack?

**Answer:** Yes. An assistant can translate questions into approved lookups, such as stock or order status, and reply with the source. For sensitive distribution data, use a model hosted in your environment rather than a public API.

## Search terms

epicor prophet 21 slack integration, slack for epicor prophet 21, p21 slack bot, prophet 21 slack slash command, epicor p21 slack alerts, p21 backorder alerts slack, slack inventory lookup erp, prophet 21 slack approvals, slack socket mode on-premises erp, distribution erp slack integration

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