๐ฑ WhatsApp Bill Share
Setup: Simulation vs Live mode
Two modes: Sim (logs to DB, no real send) for testing; Live (Meta Business API) for production.
- Admin โ WhatsApp Settings
- Sim mode (default): pick Mode = Sim. Every "send" logs to WhatsAppOutbox but nothing goes out. Great for demos.
- Live mode: pick Mode = Live. Fill Meta credentials: WABA ID, Phone Number ID, Access Token, Business Phone (E.164), App Secret (for webhook signature verify)
- Enable Auto Send Bill to automatically WA every completed POS bill (only for opted-in customers)
- Enable Auto Reply for AI answering inbound queries โ see Inbound section.
Send a bill manually
- Finish a POS bill. On the "Bill Complete" screen, tap ๐ฑ WhatsApp button
- Enter customer phone (E.164 format: +919876543210) โ or auto-filled if customer master has phone
- Tick Opt in for future bills if customer agrees
- Tap Send. Message goes via Meta API using the bill_share template.
- Delivery status tracked: Sent โ Delivered โ Read. Visible on /POS/SaleRegister โ click bill.
Customer opt-in (DPDP compliance)
Under India's Data Protection Digital Personal Act (DPDP 2023), you need explicit consent to send marketing messages.
- Utility messages (this bill, this receipt) โ implied consent when customer provides phone at POS
- Marketing messages (promotions, offers) โ need explicit opt-in checkbox
- Opt-in flag stored on Customer.WhatsAppOptIn. Manage from Customer form.
- Opt-in is per-customer-per-tenant. If customer opts out at one shop, doesn't affect other shops.
WhatsApp templates (Meta approval required)
Meta requires pre-approval of every message template. You cannot send freeform text (except in reply to an inbound message within 24 hours).
- Admin โ WhatsApp Templates. Pre-seeded:
bill_share,payment_reminder,order_ready,appointment_reminder,festival_greeting - Submit each to Meta for approval via Business Manager. Approval takes 1-3 hours.
- Only Approved templates can be used. Rejected templates re-editable + re-submit.
- Templates have placeholders ({{1}}, {{2}}) โ filled at send time (customer name, amount, invoice no)
SMS fallback (when customer not on WhatsApp)
Meta returns error 131026 = "Not on WhatsApp". Solvexa auto-retries via SMS (MSG91 for India).
- Setup once: Admin โ SMS Settings. Provider = MSG91. AuthKey + Sender ID (6-char DLT-approved) + Route.
- DLT templates: register + approve on TRAI DLT portal. Solvexa reads template ID per message.
- Automatic fallback: BillDeliveryService tries WhatsApp first. On 131026 โ tries SMS. Only one delivery counted.
- Costs: WA โ โน0.35 per bill, SMS โ โน0.18 per segment (160 chars).
Send Payment Link via WhatsApp
Customer owes โน5,000 across 3 invoices. Send them a Razorpay hosted payment link โ they tap, pay via any UPI/card/wallet, we auto-mark paid.
- Customers โ Payment Link โ + New
- Pick customer (shows outstanding balance). Enter amount + optional invoice refs.
- Tick Send via WhatsApp + Send via SMS for redundancy
- Click Create + Send. Customer receives short link (rzp.io/i/XXX) + amount + description
- Payment auto-updates: PaymentLink.Status = Paid via Razorpay webhook. Auto-applied to invoice via receipt sproc.
Inbound messages + AI reply
Customer replies to your bill or messages your business phone. Solvexa can auto-answer basic queries via Saathi.
- Enable Auto Reply at WhatsApp Settings
- Customer WA-messages your business number: "kaunse hours khule ho aap"
- Saathi's Ollama/Claude answers in the customer's language: "We're open 9am to 9pm daily"
- If Saathi doesn't know, forwards to owner's WhatsApp for manual reply
- All inbound + outbound visible at /WhatsApp/Inbox with conversation history
STOP opt-out (mandatory legal)
Any customer who WA-replies "STOP" or "UNSUBSCRIBE" is auto-flagged as opted-out. All future sends to that number blocked.
- Handled by WhatsAppInboundService โ detects STOP keyword in any language (English/Hindi/Marathi)
- Sets Customer.WhatsAppOptIn = 0 automatically
- Sends confirmation: "You've been unsubscribed. Reply START to opt back in."
- Log at /WhatsApp/OptOutLog for compliance audit