HomeProjectsWhatsApp Sales Assistant & AI Marketing Toolkit
2026Solo developer · freelance client projectIn progress
WhatsApp Sales Assistant & AI Marketing Toolkit
For a small motorbike-windshield shop in Bandung, Indonesia: a WhatsApp assistant that takes the whole order in chat with every price computed by code, plus AI marketing tools that draft ad variations and a weekly report, which code checks and a human approves.
Preview
Highlights
- The model never writes a price. Prices and totals come from code and catalogue data, and amounts in model output are stripped
- Anything outside the shop's data goes to a human instead of being promised
- AI drafts, code checks, a human approves: no ad or report goes out unreviewed
Problem
The shop sells around 230 windshield and visor products through a marketplace. On WhatsApp, customers keep asking the same things: will it fit my bike, how much is it, what does shipping cost. The owner answers every message by hand, and keeps track of orders, payment proofs and tracking numbers by hand too.
Approach
- Built on Meta's official WhatsApp Cloud API rather than an unofficial WhatsApp library. Python 3.12 with only the standard library, SQLite for storage, running as a background service that receives webhooks over an HTTPS tunnel
- The language model (OpenAI, with a local Ollama model as fallback) only holds the conversation and picks products from a list of candidates. It cannot quote prices: any sentence with a rupiah amount is removed, and prices, totals, invoices and payment instructions are filled in by code from the catalogue
- Questions the shop's data cannot answer, such as warranty, returns, discounts or cash on delivery, go to a human admin. The bot does not make promises it cannot back up
- The whole order happens in chat: product cards with photos and buttons, variant, cart, shipping details, shipping fee (from a courier API or one admin command), an invoice with an order number, and QRIS or bank transfer. The payment-proof photo is forwarded to the admin. The admin's LUNAS (paid) command reduces stock and tells the customer, and RESI sends the tracking number
- Automations: one abandoned-cart reminder inside WhatsApp's 24-hour window, with about 20% of carts held back as a comparison group to measure whether the reminder helps. The bot also remembers each customer's motorbike and labels intent: wholesale enquiries alert the admin and complaints always go to a human. Admin commands cover stock, prices, leads and a weekly funnel report. The bot also generates the 232-product feed for the shop's Meta catalogue
- Compliance is built in. The first message says it is an AI assistant and explains how to reach a human. There is a data notice and a HAPUS DATA command that deletes the customer's data (Indonesia's PDP law), plus a STOP opt-out. It asks consent before sending promotions and refuses general-purpose chatbot use, in line with Meta's policy from January 2026
- Marketing, ad variations: the module pulls product facts from the catalogue and best sellers, the model proposes 5 selling angles (price, durability, style, social proof, problem solved) and writes headlines and texts for each, 30 lines for one product. A rule-based checker rejects promises not in the shop's data (warranty, returns, COD), absolute claims such as "guaranteed", "best" or "100%", and any number not in the product facts, and flags over-long lines. A human ticks the winners on a sheet. Each picked ad gets a code (e.g. TV210H1) and a click-to-WhatsApp link that pre-fills "Halo, mau tanya TV210H1", so chats, orders and cost per order can be counted per variation and AI ads compared with existing ones. The rule is to stop after 2 rounds with no improvement in cost per order. Nothing is posted automatically: placing ads is a manual checklist step
- Marketing, weekly report: code computes revenue, orders, average order value, cancellations, WhatsApp messages, and ad spend and ROAS when ad data exists. Each figure is compared with last week and with the median of the previous 4 to 8 weeks, and outliers are flagged with median + MAD. The model only writes the sentences: any sentence with a number that is not in the table is dropped and replaced by a plain template sentence. Phone numbers are screened out before anything goes to the model, and the report is queued for human approval instead of being sent
Stack
Python 3.12 (standard library)SQLiteWhatsApp Cloud APIMeta Commerce CatalogueOpenAI APIOllama (qwen3:8b)launchd serviceHTTPS tunnel
Outcome
- Tested: 49 automated tests, plus a 76-case adversarial run against the real model that found 13 bugs. After fixes, 75 of 76 cases passed
- A live end-to-end test on real WhatsApp on 24 Oct 2026 went through the whole flow: chat, cards, cart, address, shipping, invoice, payment proof, paid, tracking number
- Not live with customers yet. Go-live is waiting on Meta: the client's WhatsApp Business account still needs business verification and a payment method on file. There are no sales results yet
- The demo video replays real bot output from the production code in a local sandbox. The shop name is hidden, product photos are blurred and phone numbers are dummies
- The two marketing modules are built and unit-tested as part of a 26-module marketing toolkit. In a sandbox demo with OpenAI gpt-5.6-luna, the real model wrote 30 ad lines for one product and all 30 passed the checker. The rejections shown in the video are hand-written test lines, labelled as such, used to demonstrate the checker; the real output happened to be clean. Human decisions in the demo were simulated, and the weekly report uses sample data because the shop has only a handful of test orders
- The marketing part has not been used with live ads yet: the shop is not running paid ads, and the WhatsApp account is still waiting on Meta verification. There are no marketing results yet
Tags