Skip to main content
Ogni volta che un piatto esce di stock — sospeso dal team, esaurito attraverso l’inventario o disattivato dalla cassa — storekit invia un evento. Questa recipe li registra, ti mostra i pattern (quali piatti, quali giorni, a che ora) e pubblica un riepilogo su Slack ogni mattina così il responsabile acquisti e lo chef iniziano la giornata sapendo cosa è finito.
La dashboard ha già un report degli snooze sotto Reports (vedi Report degli snooze). Costruisci questa recipe quando vuoi vedere nello stesso elenco anche gli esaurimenti da inventario e le modifiche dalla cassa, o vuoi che il riepilogo venga spinto su Slack invece che consultato.

Come funziona

  1. storekit invia item.out_of_stock alla tua app ogni volta che un articolo diventa non disponibile.
  2. La tua app registra l’articolo, l’ora, il motivo e chi lo ha causato.
  3. Un job schedulato gira a un orario che scegli ogni mattina e pubblica l’elenco di ieri, più una tabella continua “più esauriti questo mese”, su Slack.

Cosa ti serve

  • I webhook abilitati sul tuo piano storekit (Settings → Developers).
  • Un account Replit. Questa recipe ha bisogno di un URL pubblico che resti attivo, di un database e di uno scheduler per il job mattutino, che Replit fornisce tutti in un solo posto.
  • Un URL di incoming webhook Slack per il canale che deve ricevere il riepilogo.

Step 1: costruisci l’app

Incolla nel builder l’intero blocco in un unico messaggio.

Either button opens the builder with the whole prompt below already filled in. Nothing starts until you press send, so read it through and edit the parts marked as yours first.

Apri l’app, premi “Send digest now” e verifica che Slack mostri “Nothing sold out yesterday.” prima di collegare storekit.

Step 2: collega storekit

1

Open the webhooks portal

In the dashboard sidebar, go to Settings → Webhooks. If your plan includes webhooks and they are not yet enabled, click Enable Webhooks. If the page shows Upgrade to enable webhooks, contact support to discuss adding webhooks to your plan.
2

Add your app as an endpoint

In the embedded portal, add a new endpoint, paste the webhook URL your app builder gave you, and tick only the event types the recipe needs.
3

Copy the signing secret into your app

Open the endpoint you just created and copy its signing secret. In your app builder, save it as the environment variable STOREKIT_WEBHOOK_SECRET (builders call this “secrets” or “environment variables”). Redeploy if the builder asks you to.
4

Send a test event

Use the portal’s test option on the endpoint to send a sample event. The delivery log shows the response code from your app. A 2xx means your app accepted it; anything else, read the response body in the log — it is usually a missing secret.
Seleziona solo item.out_of_stock per questo endpoint.

Step 3: testa con un esaurimento reale

Sospendi un articolo dal menu builder (vedi Sospensione dei prodotti). Entro pochi secondi compare una riga nell’app con reason “snoozed” e source “manual”. Riattiva l’articolo dopo il test — l’app non lo registra, come previsto.

Idee

  • Email settimanale al buyer: chiedi al builder di aggiungere un’email del lunedì (tramite un provider come Resend o Postmark) con la tabella dei 30 giorni allegata in CSV.
  • Lista prep: marca gli articoli che si esauriscono prima delle 20 per tre volte in una settimana come “sotto-preparati” ed elencali separatamente.
  • Controllo incrociato con la cassa: filtra per source per vedere quanto spesso il tuo POS nasconde articoli che pensavi fossero in vendita.

Cosa non fa

  • Non può dirti quando un articolo è tornato disponibile, perché non esiste un evento “back in stock”. Leggi il log come “è uscito alle”, non come “è stato fuori per”.
  • Non modifica la disponibilità. Riattivare e rifornire avvengono ancora nella dashboard o sulla tua cassa come prima.
  • Gli eventi partono dal momento in cui colleghi l’endpoint. Prima di quel momento non c’è storia; la tabella dei 30 giorni si riempie nel corso del primo mese.
  • È il tuo servizio. Il supporto storekit può confermare che un evento item.out_of_stock ha raggiunto il tuo URL e il codice di risposta; il log e il riepilogo sono tuoi.

Correlati

Payload item.out_of_stock

Ogni valore di reason e source che l’evento può portare.

Scrivere un prompt che funziona

La struttura dietro questo prompt e cosa dire quando il builder sbaglia.

Avvisi ordini su Slack o telefono

Lo stesso pattern per gli ordini invece che per le scorte.

Disponibilità e sospensione

Sospensione, inventario e il report degli snooze integrato.