Process WhatsApp webhook deliveries so that receiving the same update twice has the same effect as receiving it once. Record inbound messages by message ID, and handle delivery status separately so later status changes still reach the original message record.
Choose the key for each update type
An inbound message can usually be keyed by its provider message ID within its account or sender. A status update needs to identify both the message and the kind of event. Marking a message ID as fully processed after the first update can drop a later delivered or read status.
Record the event before triggering actions
Persist the event or enqueue it durably before acknowledging processing. Use a unique constraint or equivalent concurrency control so two workers cannot both create a lead or send an automatic reply for the same inbound message. Keep user-visible effects tied to the accepted event record.
Replay the cases that affect reports
Test the same inbound message twice, two distinct statuses for one outbound message, and a status that arrives before an earlier status. Keep the history where it helps support reconcile a campaign, and make reporting count unique messages rather than requests received.
Frequently asked questions
Why can a webhook update arrive twice?
The provider can retry when it does not receive a successful confirmation. Design the processing step to tolerate re-delivery.
Should I discard every event with the same message ID?
Preserve distinct event types and status changes. Deduplicate at the level of the update your system is applying.
Related guides
- WhatsApp Failed Payment Message Examples
- Sync WhatsApp Opt-Outs Between Your CRM and Campaigns
- Explore a related WapBlaster guide
See the official WhatsApp or Meta guidance for product details.