WhatsApp order notifications without duplicate messages
Published on 2026-11-14 by frfrand
Event-driven architecture and idempotency for purchase, shipping, and incident notifications via WhatsApp.
# Order notifications via WhatsApp without duplicate messages
A store changes the status of an order and triggers an event. If the webhook repeats, the worker restarts, or the provider responds after a timeout, the system can emit two identical notices. A 'processed' event does not always equal an effective delivery. You must distinguish business states, sending attempts, and provider acceptance.
What to notify
Select events that truly add value: order confirmed, payment credited, prepared, handed over to carrier, shipping exception, delivery completed, and return. Avoid sending notifications for every internal update or microstate. The text must include a recognizable reference, confirmed status, and a useful action; no payment data or secrets.
Outbox model
When an operation changes the status in the database, create in the same transaction a pending notification record with a unique key, for example order_id + event_type + status_version + channel. A worker processes that outbox in the background. This way the event is not lost if the application crashes after saving the order, before sending the message.
State machine
Use pending, sending, accepted, delivered, definitive failure, and requires review. For an uncertain timeout, check the provider status or reconcile before resending; blind retries can duplicate messages if the first attempt actually went through. Maintain a correlation identifier and, if available, the remote message ID.
Templates and preferences
Outside the attention window, use templates appropriate to the category and current rules. Check customer consent and preferences, separating transactional notifications from marketing. A commercial opt-out request should not be automatically reactivated by a subsequent order without grounds.
Observability and metrics
Measure duplicate event block rate, pending queue, latency until acceptance, errors by template, deliveries, and opt-outs. Set alerts for accumulation and a review tray for permanent errors, such as invalid number. Limit volume per recipient and avoid flooding if historical orders are imported.
Failure testing
Run the same webhook 10 times, disconnect the provider, cut a worker between states, and send events out of order. The expected result is a single notification intent for a business change, with traceability. Extend the implementation with secure webhooks and background tasks.
Frequently asked questions
Is it necessary to build everything from scratch? Not always. Start with the minimum process and add integrations when there is a demonstrable need.
How are repeated errors avoided? With stable identifiers, validations, logs, and retry tests.
When to intervene manually? In the face of ambiguous data, persistent errors, and high-impact actions.
Conclusion
Document the process and test its failures before increasing volume. At ArduMaker you can explore the infrastructure and integrations applicable to this scenario.