Overview #
Customers using the Opportunity Capture API or Lead Capture API may observe duplicate or unexpected update behavior when submitting the same phone number with different country codes.
This occurs in tenants where FLE (Field Level Encryption) is enabled.
FLE (Field Level Encryption) is a feature where unique fields (such as phone number) are stored in an encrypted format in the database.
Scenario 1: Opportunity Capture API – MXDuplicateEntryException #
Error Response #
When attempting to create an opportunity, the API may return:
{
"Status": 1,
"PrimaryAction": 0,
"SecondaryAction": 0,
"ExceptionType": "MXDuplicateEntryException",
"ExceptionMessage": "Duplicate entries are not allowed., while creating or updating the lead",
"IsUnique": false,
"CreatedOpportunityId": null
}
Observed Behavior #
-
A lead already exists with phone number stored as +91 9876543210.
-
An Opportunity Capture API request is sent with +1 9876543210.
-
Instead of creating a new lead/opportunity, the system throws
MXDuplicateEntryException.
Root Cause #
In FLE-enabled tenants:
-
Phone numbers are encrypted without the country code to support application-wide search.
-
Because of this, the system treats phone numbers as identical regardless of country code.
-
Only one lead can exist for a given phone number across all country codes.
As a result, the API considers the incoming number a duplicate and blocks creation.
Workaround #
Currently, no workaround is available, as this is a design limitation of FLE.
Scenario 2: Lead Capture API – Existing Lead Gets Updated #
This behavior may also be observed when using the Lead Capture API.
Tested Behavior #
-
A lead exists with phone number +91 9876543210.
-
A Lead Capture API request is sent with +1 9876543210 for the same phone number.
System Behavior #
-
The system does not create a new lead.
-
Instead, it updates the existing +91 lead record.
Reason #
Due to FLE encryption without country code:
-
The phone number is treated as the same unique value.
-
The system matches the existing lead.
The existing lead is updated instead of creating a new record.
Recommended Action #
-
Clearly communicate this limitation to customers.
-
If they want this to not throw the error. Understand their business requirement for allowing the same phone number with different country codes and discuss this internally further with the engineering team.
-
