Hi Team,
Recently came across an issue where the Opportunity Capture API was giving below error despite the lead does not exists in the system.
Error response – response <200,ImportResponseDTO(additionalDetails=null, createdOpportunityId=null, exceptionMessage=Duplicate entries are not allowed., while creating or updating the lead, exceptionType=MXDuplicateEntryException, isUnique=false, primaryAction=0, relatedProspectId=null, requestId=196644e0-f278-4460-af96-35e22dd249f4, secondaryAction=0, status=1),[Content-Type:”application/json; charset=utf-8″, Content-Length:”474″, Cache-Control:”no-cache, no-store”, x-LSQ-TraceId:”5c60f8ea-6317-4ab9-82af-1b58da400951″, Date:”Thu, 04 Jul 2024 04:38:11 GMT”, Connection:”keep-alive”]>

When checked further with Dev, the mentioned lead is merged lead whose isLead = 0 and hence it is not showing up in the UI but however the lead does exist in the DB.
Customer was trying to create a lead with a unique field whose data is already present in the DB and hence error was throwing in the API response.
Solution: Make an API call and null the value of the unique field present for the lead. Once the value is nullified you will be able to create the lead.
Dev ticket: #1336899
Best,
Kiran
