• WhatsApp
  • Go
  • Product

WhatsApp from the restaurant’s own number: linked devices, consent and the review loop

A bill on WhatsApp from “Fravolo” is spam. The same bill from the restaurant’s own number is a conversation: the guest recognises it, can reply, and the owner sees the reply. So instead of sending from a shared business account, Fravolo links each outlet’s own number as a device, the same way WhatsApp Web does. That one decision drives most of the design in this post.

Fravolo Engineering · updated · 9 min read

Linking the outlet’s phone as a device

The owner opens Business settings and scans a QR code with the outlet’s WhatsApp — or, because a phone cannot scan its own screen, asks for a short pairing code and types it into WhatsApp instead. The API holds a multi-device session for that number using an open-source Go implementation of the WhatsApp protocol. From then on Fravolo can send from the number and receive what guests send to it.

Guesttheir own WhatsAppWhatsAppoutlet’s number,linked deviceAPI · THE ONE PROCESS THAT OWNS SESSIONSSession managerone session per outletnumber must match settingsJob runnerfollow-ups, broadcastsconsent + quiet hoursInboxthreads, scoped per restaurantpublished on the live busSettled bille-bill linkOwnerinbox + push
One process owns every linked session. Bills and follow-ups go out from the outlet’s own number; guest replies come back into the owner’s inbox over the live event bus.

Two rules are enforced at the moment of pairing:

  • The number must be the outlet’s. The phone that scanned is compared with the business phone in the outlet’s settings, normalised with the market’s dialling code. Any other number is logged out and its device deleted on the spot. Nobody can link a personal phone to send a restaurant’s bills.
  • One number per outlet. Within a restaurant, a number already linked to another outlet is refused — checked before pairing starts, and again when it completes.
walink/service.go (abridged)Go
func (s *Service) Paired(ctx context.Context, k Key, got string) error {
	want, err := s.expected(ctx, k.Outlet) // Business settings phone, normalised
	if err != nil {
		return err
	}
	if got != want {
		return ErrWrongPhone // the session layer logs this device out
	}
	if used, err := s.r.phoneUsed(ctx, k.Tenant, got, k.Outlet); err != nil {
		return err
	} else if used {
		return ErrPhoneInUse
	}
	// ... record the link as connected ...
	return s.r.saveLink(ctx, link)
}

Exactly one process owns the sessions

A linked device is a set of keys. If two processes connect with the same keys, WhatsApp tells each that it has been replaced, they reconnect, replace each other again, and before long the number gets flagged. So the session store — a small SQLite file, using a pure-Go driver because our API image has no C toolchain — is opened only by the instance that runs background jobs. If that process is ever told it has been replaced, it drops the session and steps aside instead of fighting. The API runs as a single instance today, and that instance owns every session.

On boot, the manager clears pairings a restart interrupted and restores every active link. The reconnects are spread out randomly over a short window, so a deploy does not log every restaurant’s number in from one address in the same second.

An inbox, not a firehose

A restaurant’s phone receives a lot that is not about the restaurant. Incoming messages pass through a reducer that drops groups, status updates, channels, reactions, edits and notes-to-self, and keeps one-to-one conversations with a phone number. When a number is linked, the last week of direct chats is pulled in so the inbox does not start empty. Threads and messages are stored as the restaurant’s business data — scoped like everything else — and each new message is published on the live bus, so the inbox refreshes and the owner’s phone gets a push.

Replies from the inbox go out from the same number. The guest sees one continuous conversation with the restaurant, which is the whole point.

The review loop

After a visit, the thank-you message can ask for a rating from one to five. Guests answer in every way you can imagine, so the parser accepts “4”, “5/5”, “4 stars”, a row of star emoji, and Devanagari digits. A rating only counts if it arrives within a couple of days of the question.

Thank-youasks for a ratingfrom 1 to 5Guest replies“4” “5/5” “4 stars”★★★★★ or ५Parsewithin 2 days4 or 5thank you+ link to post a Google review1 to 3apology: what went wrong?owner alerted with the billnext message saved as commentreview link offered tooEvery rating is stored: average, spread,unhappy count, how many were asked.
Every rating is stored. Happy guests are invited to post a review; unhappy guests are heard first, and the owner is told straight away.
  • Four or five: a thank-you with a link to the restaurant’s Google review page.
  • One to three: an apology that asks what went wrong, an alert to the owner’s phone with the bill number, and the guest’s next message saved as their comment. The owner can often fix it while the guest is still nearby.

Every rating is kept, and the owner’s dashboard shows the average, the spread, the unhappy count and how many guests were asked — so a restaurant can see whether a bad week was one table or a pattern.

When the number is not linked

Not every restaurant links its number on day one. The bill sender prefers the linked number when an outlet has one, and otherwise falls back to an approved template through the official WhatsApp Business platform, or to a one-tap share link the cashier sends by hand. The guest gets their bill either way; only the linked number turns it into a conversation.

Trade-offs

  • We depend on a protocol we do not control. A linked device is how WhatsApp Web works, but WhatsApp can still restrict a number that behaves like a bulk sender. That is why sends are paced, consent is enforced in code and broadcasts are capped. We tell restaurants this plainly before they link.
  • One process is a single point of failure for messaging. If the instance holding the sessions is down, nothing goes out from the linked numbers: cashiers can still share a bill by hand, and follow-ups wait in the queue. A failed send from a linked number does not fall back to the template route either. Splitting sessions across workers needs a sharded store and a lease per number; it is the first thing we would build when one process is no longer enough.
  • Consent words are a list. English, Hindi and Hinglish today. Dutch guests answering “nee” or “ja” are not understood yet, and that is a gap we are closing for the Netherlands.
Code in this post is adapted from Fravolo’s codebase and simplified for reading: names are generic and error handling is trimmed. Written by Fravolo Engineering, 12 November 2026; checked against the code again on 23 November 2026.