WhatsApp bot
Customers text the shop's WhatsApp and get the real repair status back — including approving quotes with «YES».
What the bot answers
The bot identifies the customer by phone number and the repair by context. Every message is independent — no login, no menus:
| Customer writes | Bot replies |
|---|---|
| «is it ready?» or any text | Repair status + expected date |
| «quote» / «price» / «how much» | Pending quote amount + how to answer |
| YES / accept / ok | Approves the pending quote — same flow as the counter |
| NO / decline | Declines the quote |
| Repair code (REP-…) | Status of that specific job |
| «help» / «human», audio or image | Escalates to staff — with an in-app notification |
| Number with no record | Friendly reply with the shop's contacts |
How it picks the answer
The bot finds the customer record by the last 9 digits of the phone number — robust to +351 prefixes, spaces and different formats. With one active repair, context is obvious and it answers directly; with several, it lists the codes for the customer to pick.
«Active repair» means everything not yet delivered, returned or cancelled — including jobs ready for pickup, which are exactly the ones generating «is it ready?» messages.
What the bot can't solve escalates to people: «help», «human», audio, images and off-pattern questions create an in-app notification with the customer's text — the team replies manually.
What's needed (Meta)
The module uses Meta's official WhatsApp Business Platform — no workarounds, no ban risk for the shop's number. Requirements:
- A Meta app (developers.facebook.com) with the WhatsApp product — our OficinaOS app already exists and is published
- The shop's number on WhatsApp Business — coexistence keeps the phone app working while the API connects in parallel
- A permanent system-user token with whatsapp_business_messaging + whatsapp_business_management permissions
- The webhook pointed at OficinaOS Cloud — already configured on our side
Setup in the app (per shop)
After Meta onboarding (we assist the first shop), the app-side setup is 4 fields:
- Menu → Notifications → Setup → WhatsApp section
- Business ID + Phone Number ID — provided during onboarding
- API Token — the permanent system-user token (the app uploads it once to the Cloud, where it's stored encrypted — sends then go through the relay and the token is never asked for again)
- Enable — the app registers the phone_number_id and credentials with the Cloud by itself and the bot goes live
Honest limits
- Replies can take up to ~2 minutes (sync cycle) — not instant
- Replying to customers is free; starting conversations («your repair is ready») needs Meta-approved templates with per-message fees
- Flood control: max 20 messages/hour per number — spam protection
- Audio and images aren't interpreted — they go to a human
- In test mode only Meta-verified numbers get replies — in production there's no such limit
If the bot goes quiet
| Symptom | What to check |
|---|---|
| Customer gets no reply | Is the Meta token still valid? (temporary tokens expire in 24h — use a system-user token) |
| Message never reaches the app | Is the whatsapp-bot module active in the Cloud? Correct phone_number_id in settings? |
| Bot replies but Meta blocks | In test mode, is the recipient verified? In production, it's the 24h window |
| «YES» does nothing | Is there a sent, pending quote on that job? (the bot only acts on unanswered quotes) |
| Right quote, wrong reply | Does the customer record's phone share the same last 9 digits? |