Overview
Official business messaging APIs typically charge per-template conversation fees ($0.05–$0.08 per message), which quickly becomes prohibitive for small rural pharmacies and SME retailers who need to notify 400+ customers each month regarding overdue store balances.
WA Reminder Companion is an automated microservice designed to act as an un-metered notification dispatcher. It runs as a resilient Linux systemd background service, listens for invoice due triggers from local POS systems, and dispatches courteous, formatted reminder messages with PDF receipts.
Key Design Principles
- Idempotency by Default: Every reminder job carries a unique hash based on
(invoice_id, customer_id, due_month). Even if the POS sends duplicate webhook triggers, each customer receives at most one reminder per billing cycle. - Human Jitter & Rate Limiting: Rather than blasting bulk messages simultaneously, the dispatcher injects random jitter delays (18 to 45 seconds between messages) to ensure polite delivery.
- Fail-Safe Audit Logging: Dispatched messages, delivery timestamps, and failure events are captured in an append-only SQLite database and mirrored to a private Telegram channel for instant operator visibility.