WhatsApp Business API integration guide

How to Prevent Duplicate WhatsApp Enquiries in Your CRM

Use the incoming WhatsApp message ID to recognise repeat deliveries. Save that ID with the receiving business number in a record that can be created only once. Then apply your CRM’s enquiry rules to each new message so genuine customer follow-ups are still captured.

By Weform Solution ·

Why one message can create two enquiries

A webhook is an HTTP notification sent to your integration when an event occurs. Imagine a Mysore tour operator receives a request for a weekend vehicle. The integration creates an enquiry, but the request times out before the sender sees a successful response. If that event is delivered again, an integration that creates a lead on every request can assign the same booking enquiry twice.

In Meta’s Cloud API payload, incoming messages are in messages and each entry carries an id. The receiving business number is identified by metadata.phone_number_id. If a provider wraps the payload, ask which fields preserve those identifiers and test whether they stay stable on replay. See Meta’s incoming text webhook example.

How to record each incoming message once

  1. Read every inbound message in the payload. Iterate over the messages your integration supports. Route outbound status events to the message status handler so updates such as delivered or read do not open enquiries.
  2. Give each inbound message a stable key. For a CRM that handles several business numbers, use the receiving number ID and incoming message ID together. Include the CRM tenant identifier if several businesses share the integration.
  3. Enforce uniqueness at storage. A database unique constraint can stop two workers from accepting the same key concurrently. If the message and enquiry share a database, commit the receipt and CRM update together. If the CRM is external, save pending work durably and use the CRM’s idempotency or external-ID lookup where supported. A failed write must still be recoverable. See how PostgreSQL enforces a unique combination of fields.
  4. Decide what counts as a new enquiry. A customer who follows up with pickup details sends a new message. Save that message against the open enquiry when it belongs to the same request. Define a clear rule for when a fresh request gets its own record.

What to test before switching on CRM automation

In a test workspace, send a sample booking request and replay the same inbound event twice, including once while the first copy is still processing. Expect one recorded message and one enquiry assignment. Then send a second message from the same test number, such as a pickup time. Expect the follow-up to appear in the conversation even though the number and customer are the same.

Simulate a CRM timeout after a write may have succeeded. On retry, look up the record by its stable external reference before attempting another create. If the CRM cannot confirm the outcome, route the item for review so an operator can resolve it. Finally, send a delivery status update and confirm it updates the outgoing message record. Use sample data and log event IDs and processing outcomes so you can trace failures without recording message text in diagnostic logs.

If your team also gets two assignments when a chatbot hands a conversation to an agent, review the WhatsApp human handover checklist for ownership rules.

Common questions

Can I use the customer’s phone number to remove duplicates?

Use the sender’s phone number to find the contact. Use the incoming message ID to recognise a repeated delivery. One customer can send several distinct messages or make several enquiries.

Can I delete existing duplicate leads automatically?

First compare the source message references and inspect the activity on both records. Preserve notes, assignments and follow-ups when merging. Keep separate enquiries if they came from different customer requests.

What should I ask my WhatsApp or CRM provider?

Ask which incoming message ID you can store, what happens when a webhook or CRM write is retried, and how the CRM looks up a lead by external reference. Request a test replay before enabling the workflow for customers.