Article

Stock-out alerts in Slack: connecting a Slack app's incoming webhook

If your team already works in Slack, a stock-out is most visible there. OpenBoxes Lift can post a message to a Slack channel when a product runs out of stock at a location, and one more when stock comes back. This article covers the parts that trip people up: which kind of Slack webhook works, what the channel will and will not receive, and what to check when nothing arrives. The step-by-step reference is in Slack alerts.

Slack alerts are opt-in and included on the plan you are already on, with no add-on to buy, on Shared and Dedicated instances alike.

The webhook has to come from a Slack app#

Lift posts to Slack through an incoming webhook, a URL that posts to one channel. It has to come from a Slack app you create in your own workspace, and its host must be hooks.slack.com.

  • GovSlack webhooks (hooks.slack-gov.com) are refused when you save them.
  • Legacy custom-integration webhooks are not supported either. If an older setup gave you one, create a new webhook from a Slack app instead.

In Slack, that means three things: create a Slack app in the workspace whose channel should receive the alerts (at api.slack.com/apps), turn on Incoming Webhooks for it, and add a new webhook to the workspace, choosing the channel. The channel is chosen there, in Slack, not in Lift. Treat the URL like a password: anyone who holds it can post to that channel.

Connecting it, and testing it#

In the portal sidebar, go to Integrations, then the Destinations tab, then Slack, and choose Add Slack destination. Give it a name you will recognise, paste the webhook URL and save. The URL is stored encrypted and never shown again; afterwards the panel shows only the host. Anyone on your account can add, change, test or remove a destination, and you can have up to 5.

Then use Send test message in the destination's edit dialog, or Test send on its card. It posts one short message marked [TEST] saying the connection works. A channel pages nobody, so there is nothing to silence first. Tests are limited to one per destination every 5 minutes. The Slack alerts guide has each step in full.

What the channel will receive#

It is deliberately narrow, so it is worth knowing before you tell your team to watch the channel:

  • For stock, stock-outs only. A message is posted when a product that has a minimum level set at a location drops to zero quantity on hand at that location.
  • Once a day, not in real time. Lift takes one picture of your stock each day, in your instance's timezone, and posts from that picture. A product that runs out at noon is posted when the next daily check sees it.
  • One message per product and location. A product still at zero the next day is not posted again. When a later daily check sees stock, one Stock returned message follows.
  • At most 50 new stock-outs per destination per day, then one extra message saying how many more products are out of stock, with the true total.

Products that are below their minimum but not at zero, and lots that are close to expiring, never go to Slack. Those stay in the daily stock alert email, so keep the email on if they matter to you.

If nothing arrives#

Work through these in order:

  1. Did the test arrive? If the [TEST] message reached the channel, the webhook works and the question is what the daily check found. If you pressed the button twice within 5 minutes, the second press sent nothing and said so; that does not mean the URL is wrong.
  2. Is a minimum level set? A product with no minimum level at a location is never checked there, however low it gets.
  3. Has the daily check run since the stock-out? Messages come from the once-a-day check, so a product that ran out this afternoon appears after the next check.
  4. Is the product at zero? A product below its minimum but not at zero is in the email, never in Slack.
  5. Was the destination switched off? If Slack refuses messages three times in a row (the webhook was deleted, the app was removed from the workspace, the channel was archived), Lift switches the destination off and the panel says so. A Slack outage or rate limit never does. Check the webhook in your Slack app, then open the destination with Edit and save its URL again; the same URL is enough.
  6. Which kind of webhook is it? A GovSlack URL is refused at save. A legacy custom-integration webhook is not supported; replace it with one from a Slack app.

Messages also stop, silently, when a product is no longer tracked (its minimum was removed, or the product or location is gone), when the destination is removed, when the instance is suspended or closed, or when there has been no usable daily check for three days running. Replacing the URL posts no confirmation; within about an hour, the new webhook gets a message for each product that is still out of stock.

Also in the channel, if you choose#

  • The weekly summary. Tick Also post the weekly summary here on the destination (off by default) while the weekly summary is switched on for your account under Stock alerts, and the channel gets one short message each Monday with the week's counts, up to 5 new stock-outs and a link to the Reports page. It never carries stock values, supplier names, order numbers or activity quantities. See the weekly summary.
  • Temperature alerts (beta). If you have connected temperature loggers, switching this destination on in the Temperature alerts (beta) section of the same panel also sends temperature alerts to the channel.

Teams and PagerDuty#

Slack is not the only place a stock-out can go. A Microsoft Teams channel gets the same stock-outs as a card, through a Workflows webhook: see Stock-out alerts in Microsoft Teams and Microsoft Teams alerts. If a stock-out needs someone on call, PagerDuty alerts open an incident on your on-call service. To decide between them, read Email, Slack, Teams or PagerDuty: where should your stock alerts go?, and the stock alerts overview shows every alert on one page.

Summary#

  • Use an incoming webhook from a Slack app; the host must be hooks.slack.com. Legacy webhooks and GovSlack are not supported.
  • Add it under Integrations, Destinations, Slack, then send a test; it posts one [TEST] message.
  • Expect stock-outs only, from a once-a-day check; below-minimum and expiring stock stay in the email.
  • If the channel is quiet, check minimum levels first, then whether the destination was switched off.

Keep reading