# How to add Slack to ERPNext

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

## Short answer

ERPNext can post to Slack natively through the Slack Webhook URL DocType and a Notification set to the Slack channel. For slash commands and interactive approvals, add a Slack app that calls ERPNext's REST API with a scoped token and applies Workflow transitions through a whitelisted method.

## System

ERPNext

## Capability

slack

## Intro

Slack is a common choice for smaller manufacturers, distributors and software-adjacent hardware companies running ERPNext. The pain is rarely the lack of alerts; it is the gap between a channel message and the action. Someone sees 'Work Order WO-0042 is late' and then has to open the Desk, find it and do something.

ERPNext is friendlier to Slack than to most chat tools, because the Frappe framework ships a way to send to an Incoming Webhook without code. That covers the first 80 percent. The rest, slash commands and buttons that act, needs a real Slack app and a careful look at who is allowed to do what.

## Use Cases

### Order desk channel for new Sales Orders

**Description:** Every submitted Sales Order posts customer, delivery date and value to an order desk channel, with a link back to the form.

### Stock-out and reorder warnings

**Description:** Items hitting reorder level or negative projected quantity are posted to a planning channel, grouped by warehouse, instead of waiting for someone to run Stock Projected Qty.

### Approve or reject from the message

**Description:** Buttons on a Slack message apply the Workflow transition for Purchase Orders or Expense Claims, restricted to named approvers.

### Slash command for quick lookups

**Description:** A command like /erp stock ITEM-001 returns bin quantities per warehouse from the Bin DocType; /erp po 0123 returns status and next delivery date.

### Production exceptions

**Description:** Work Orders past planned end date, or Job Cards with a stopped timer, raise a thread in the shop-floor channel so the supervisor can reply in context.

## System Surface

- Slack Webhook URL DocType: stores incoming webhook URLs for channels, used by Notification when its channel is set to Slack (available in current Frappe versions, verify on yours).
- Notification DocType: choose the document event, a condition, and a Jinja message body; recipients can be dynamic from fields on the document.
- REST API /api/resource and /api/method with token auth, which is what a Slack app uses for lookups and for applying actions.
- Workflow DocType and the apply_workflow method used by the Desk, for transitions that should respect allowed roles.
- Bin, Stock Ledger Entry and Purchase Order Item tables, reached through the API rather than directly, for stock and delivery lookups.

## How It Works

### Start with the native channel

**Detail:** Create an Incoming Webhook in Slack for the target channel, add it as a Slack Webhook URL in ERPNext, then create a Notification on the event you care about with a short Jinja message and a link to the document.

### Decide what needs interaction

**Detail:** If a message only informs, stop there. Add a Slack app only for slash commands, buttons or dialogs, because every interactive feature is an authenticated write path.

### Create the Slack app

**Detail:** Enable slash commands and interactivity with a request URL on a small service you host, verify Slack's signing secret on each call, and request only the scopes you need.

### Map Slack users to ERPNext users

**Detail:** Use the Slack profile email to find the ERPNext User. Reject actions when no match exists or the user lacks the role the transition requires.

### Call ERPNext as a scoped identity

**Detail:** Reads go through a service account with read-only roles. Writes go through a whitelisted method that checks permissions for the mapped user, so Slack cannot become a back door.

### Reply in thread and log

**Detail:** Respond ephemerally to lookups, update the original message after an action, and add a Comment on the ERPNext document noting the Slack user and time.

## Example Flows

### Late Work Order thread

**Trigger:** A scheduled job finds Work Orders past planned_end_date still In Process.

**Steps:**

- The job posts one message per work order via the Slack Webhook URL, with item, qty and workstation.
- Supervisors reply in the thread with a new estimate.
- A planner clicks a 'Log note' button that adds the text as a Comment on the Work Order.

**Result:** Delay reasons are captured on the record instead of lost in chat history.

### Slash command stock check

**Trigger:** A salesperson types /erp stock FG-100 in any channel.

**Steps:**

- Slack sends the signed command to the service.
- The service queries the Bin list for that item through the API.
- It replies ephemerally with quantity by warehouse and reserved quantity.

**Result:** Quick answers without exposing stock levels to the whole channel or opening the Desk.

## On Prem

Slack is a hosted service, so the data in each message sits with Slack. ERPNext can remain fully on-prem; the Notification sends outbound HTTPS, and any interactive Slack app needs an inbound endpoint reachable by Slack, typically a reverse proxy in front of one small service. For regulated or defense work, keep messages to identifiers and status, and do not post drawings, specs or customer pricing. If you want an AI assistant answering in Slack, run the model locally and let the service retrieve ERPNext data under the asking user's permissions. Fully air-gapped sites should use a self-hosted chat alternative with the same webhook shape.

## Security

- Verify Slack's signing secret and timestamp on every request to stop forged commands and replays.
- Treat the webhook URL as a secret; anyone with it can post into your channel.
- Check ERPNext permissions for the mapped user server side; never rely on channel membership as authorization.
- Limit Slack scopes and restrict the app to specific channels where possible.
- Keep commercially sensitive fields out of messages, and store the audit trail inside ERPNext.

## Options

### Native Notification with Slack Webhook URL

**Fit:** Alerts and digests where nobody needs to act from inside Slack.

**Effort:** An hour per alert, no code.

### Custom Slack app and small service

**Fit:** Slash commands and approvals with exact permission control.

**Effort:** One to three weeks including review and testing.

### Partner build with Netray

**Fit:** Teams who want a Slack assistant that answers natural-language questions over ERPNext on private models.

**Effort:** Pilot on a few read-only questions, then widen.

## Pitfalls

- Notifications on every on_update create noise people mute; trigger on state or threshold changes.
- Incoming webhooks post as the app, not a person, so approvals need the interactive path to carry identity.
- Slack expects a response within about three seconds to a slash command; acknowledge first and process in the background.
- Posting full document contents leaks data into a system with different retention rules than ERPNext.
- Using the Administrator API key for the bot is a common shortcut that undoes your role model.

## Faq

### Does ERPNext support Slack out of the box?

**Answer:** Current Frappe versions include a Slack Webhook URL DocType and a Slack channel option in Notification, which covers one-way alerts. Exact availability depends on your version, so look for it under the Notification form before building anything custom.

### Can I approve documents from Slack?

**Answer:** Yes, with a Slack app that handles button clicks and calls a whitelisted ERPNext method. Map the Slack user to an ERPNext user and enforce the Workflow role check on the server so a button press carries real authority only for real approvers.

### Is it safe to post customer data to Slack?

**Answer:** It depends on your obligations. Treat Slack as a different data store with its own retention. Post identifiers, status and links, and keep prices, specs and personal data inside ERPNext behind login.

### Can I use this with self-hosted ERPNext?

**Answer:** Yes. Outbound webhooks need only internet egress. Interactive features need a public HTTPS endpoint for Slack to call, ideally one small service behind a reverse proxy rather than exposing ERPNext directly.

### What about Slack message limits and rate limits?

**Answer:** Incoming webhooks and the Web API are rate limited per workspace and channel. Batch noisy events into a digest, use threads for follow-ups, and queue sends through the Frappe background workers so bursts do not drop messages.

## Search terms

erpnext slack integration, slack for erpnext, erpnext slack notification, frappe slack webhook, erpnext slack bot, erpnext slack slash command, erpnext slack approval, send erpnext alerts to slack, erpnext slack webhook url, erpnext work order slack alert

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