Dentolize · WhatsApp Paid Messages Walkthrough
On this pageWhat this PR isWho is affectedScope of this PRFraming

WhatsApp Paid Messages

What this PR is

WhatsApp is changing how it charges businesses for messages sent through the official Business API: starting 1 October, a reply outside a short free window costs money, priced by what the message is used for. This PR teaches Dentolize's WhatsApp integration about that change — for every clinic that messages patients through the official WhatsApp channel (packages/whatsapp-official, clinic-web's "WhatsApp Bot" section, and the clinic-mobile WhatsApp tab).

It does four things:

  1. Tracks two "free to reply" windows on every conversation — the

ordinary 24-hour window that opens when a contact writes in, and a new, longer 72-hour window that opens when the clinic answers someone who clicked a "click-to-WhatsApp" ad within a day of arriving.

  1. Tags every outgoing message with whether it was free or paid, and

what category WhatsApp bills it under (service, utility, marketing, or authentication).

  1. Adds a cost report — a new "Messages Cost" tab, on both web and

mobile, that breaks down what was sent and what it will be billed as.

  1. Lets a clinic cap its daily spend — two new settings limit how many

paid replies the automated bot and the clinic's human staff are each allowed to send per day, so nobody discovers the new pricing by way of a surprise bill.

Who is affected

  • Clinic staff replying to patients on WhatsApp (web Chats screen,

mobile WhatsApp tab) now see whether a conversation is free or paid, and a running countdown to when that changes.

  • Clinic owners / admins configuring WhatsApp (Settings tab in the

web WhatsApp Bot section) get two new fields to cap daily paid-message spend.

  • The automated bot (packages/whatsapp-official) now tracks and

respects the same limits and windows when it auto-replies, and stops auto-replying for the day once its own cap is hit.

Scope of this PR

Everything lives in this single repository (/work/repo); there are no related PRs for this feature. The change touches:

  • packages/prisma — schema + migration for the new columns and enum.
  • packages/server — GraphQL schema, resolvers, permissions, and the

cron jobs that send scheduled/reminder WhatsApp messages.

  • packages/whatsapp-official — the NestJS bot service that receives

inbound WhatsApp webhooks and sends automated replies.

  • packages/clinic-web and packages/clinic-mobile — the conversation

list, chat header, and new cost-report screens staff use day to day.

  • packages/clinic-web-canary — the newer settings form where the daily

spend caps are configured.

Framing

This feature is not yet released — the pricing itself does not take effect until 1 October, and the UI says so with a banner. Everything described in this walkthrough is live in code and in the sandbox now, ahead of that date, so clinics and staff can get used to the new signals before money is actually at stake.