Category: Forms and APIs

CRM Creates Duplicate Leads from One Form Submission

Read this guide in Polish

Webhook can be delivered more than once. Also a rerun after timeout can create a second record, even though the first request saved the data. Repeat handling should be part of integration.

Step by step

1. Check the event identifier of the supplier and the number of requests in logs. The same email address does not always mean the same lead; the customer can ask for two different offers.

2 . Select a stable source identifier and add a limitation of uniqueness in the database, e.g. a pair of supplier plus form or event identifier, depending on its semantics.

3 . The check in the code “if there exists” and then a separate INSERT can lose at two parallel demands. Use transaction or save based on uniqueness limitation.

4 . A repeated correct event should be answered according to the supplier's protocol. Do not re-sign welcome and assignment.

5 . Test the parallel delivery of the same payoad and two different events of the same person. Logs should allow to find the result without storing unnecessary customer data.

How to check whether the amendment works

Repeating a test webhook does not create a new lead or additional notifications. Two really separate queries still need to be handled. The merger rule is a separate business decision.