Docs · Setup
Connect Twilio (WhatsApp) in 5 minutes
One-time setup in Twilio's console. After this every café manager can pair their WhatsApp number and get morning briefs + reorder approvals on WhatsApp instead of (or in addition to) Telegram.
Open Twilio's console
Go to console.twilio.com. If you don't have an account, click Sign up — Twilio gives you a free trial with $15 credit. Plenty for one café's test messaging volume.
Copy Account SID + Auth Token
Top of the dashboard, under Account Info:
- Account SID — starts with
ACfollowed by 32 hex chars. Copy it. - Auth Token — click the eye icon to reveal, then copy. 32 hex chars.
Activate the WhatsApp Sandbox
Left nav → Messaging → Try it out → Send a WhatsApp message. Twilio gives you a sandbox phone number — usually +1 415 523 8886 — and a join code like join <word>.
From your real WhatsApp, send the join code to that number. Once Twilio confirms you're joined, your sandbox is live.
Sandbox is for testing. For production WhatsApp messaging at scale you'll register a real Business sender — but the dev sandbox is enough to wire the bot end-to-end.
Set the inbound webhook URL
Same Sandbox screen, scroll to Sandbox settings. In the field “When a message comes in” paste:
Webhook URL
https://stockpilot-app-production-2a53.up.railway.app/api/bot/whatsappMethod: POST. Save. Twilio now posts every inbound WhatsApp message to StockPilot, signed with your auth token — so the app can verify the request actually came from Twilio (not spoofed) before acting on it.
Paste all three into Railway
Open your StockPilot service on Railway → Variables tab → + New Variable three times:
TWILIO_ACCOUNT_SID=paste the Account SIDTWILIO_AUTH_TOKEN=paste the Auth TokenTWILIO_WHATSAPP_FROM=whatsapp:+14155238886(the sandbox number, with thewhatsapp:prefix)
Railway redeploys automatically — takes ~60 seconds.
Pair WhatsApp from Settings
Reload /settings. The WhatsApp row no longer says “not configured”. Click Pair WhatsApp, you'll get a 6-digit code → text it to the Twilio sandbox number. The bot replies and the row flips to Live · paired as +1….