Case Study
Torga Optical AI WhatsApp assistant
Torga Optical is an optical retail chain operating a network of stores across South Africa, Namibia, Lesotho and Eswatini. The company offers eye examinations, prescription eyewear, sunglasses and contact lenses, combining in-store optometry services with a full online shop.
Its e-commerce platform is built on nopCommerce, where every store operates as a separate location with its own appointment schedule, staff and product availability. Customers can browse the catalogue, book an eye test at their preferred branch and follow the progress of their order online.
With customer communication increasingly moving to WhatsApp, Torga Optical needed its digital services – appointments, order tracking, promotions and store contact – to be available directly in that channel, backed by the same live data its stores work with every day.
The Project
eyeRobot is a conversational self-service assistant that brings the customer's optical store into WhatsApp. Built on the Hubot framework and plugged into Rocket.Chat Omnichannel, the bot handles the most common customer requests end-to-end – booking an eye-test appointment, checking an order, downloading promotional vouchers and getting through to the right branch – without a single human agent having to pick up the conversation first.
Every answer the bot gives is live data: it talks directly to the customer's nopCommerce store over the REST API, so appointments, orders, stores and products are always in sync with the back office.
The challenge
The customer operates a large network of optical stores across South Africa, Namibia, Lesotho and Eswatini. Routine enquiries – “when can I come in for an eye test?”, “are my glasses ready?”, “what is the number of my branch?” – arrived through a single WhatsApp channel and had to be triaged manually by the customer-care team. The goal was to automate this first line of contact, route the rest to the correct store, and do it inside the channel customers already use every day.
The solution
We delivered a Node.js chatbot that runs as a Rocket.Chat Omnichannel agent and serves a numbered, WhatsApp-friendly menu. A per-conversation state machine keeps track of where each customer is in a flow, validates every input and always offers a way back to the main menu.
The customer is recognised automatically by the phone number of the WhatsApp conversation: the bot normalises the number into several formats, resolves the country from the dialling code, and looks the profile up in nopCommerce – including the customer's preferred store. No login, no order forms, no separate app to install.
Key capabilities
- Appointment booking – a guided flow through province → store → appointment type → date → live availability slots, pulled in real time from the nopCommerce booking endpoints. Missing profile data (name, e-mail, date of birth) is collected in the chat, confirmed by the customer and posted back with the booking.
- Order status – instant lookup by order number against the nopCommerce order API, with the status translated into plain language.
- Chat with your store – the bot identifies the customer's preferred store, checks whether that store's agent is currently online and performs a live handover of the WhatsApp conversation to them through the Rocket.Chat Livechat forwarding API. The customer keeps chatting in the same window.
- Vouchers on WhatsApp – the country-specific voucher catalogue is read from nopCommerce and the selected voucher is delivered to the customer as a PDF attachment through an approved WhatsApp Business template message.
- Call my store – returns the phone number and details of the branch the customer is registered with.
- Customer care & help – contact details, working hours, social channels and a short FAQ, always one keystroke away.
Engineering highlights
- Conversation context is isolated per room, so hundreds of parallel WhatsApp chats each keep their own state, retries and validation rules.
- Strict input validation for dates (DD/MM/YYYY, plus “today” / “tomorrow”, no past dates, max four weeks ahead), e-mail, phone numbers and dates of birth – invalid answers are re-prompted instead of breaking the flow.
- Multi-country support driven by the dialling code, mapped to the correct nopCommerce country and store.
- Token-based authentication against the nopCommerce API with automatic re-authentication, and automatic Rocket.Chat token refresh on expiry.
- Containerised deployment with Docker Compose, including a start-up gate that waits until the Rocket.Chat API is reachable before the bot connects, and an automatic restart policy.
Technologies
Node.js 22, Hubot, CoffeeScript, Rocket.Chat (Omnichannel / Livechat adapter and REST API), WhatsApp Business template messaging, nopCommerce REST API, Axios, Docker & Docker Compose.
Result
Customers now book appointments, track orders and collect vouchers 24/7 straight from WhatsApp, while conversations that genuinely need a person are routed automatically to the right branch and only when someone is actually online. Routine load on the central customer-care team drops, and every interaction is powered by the same nopCommerce data the stores already work with.
Technologies
Node.js- Hubot
- CoffeeScript
- Rocket.Chat
- Rocket.Chat Omnichannel / Livechat API
WhatsApp Business API
nopCommerce
nopCommerce REST API
REST API Integration- Axios
Docker
Docker Compose