Soap Api V4.1 , Lead to Contact

Hello, im trying to use Soap API 4.1 to transform a Lead into a Contact.

I can create/update without problem, but when i have to convert a Lead into a Contact, im sure it is not only create a contact and delete the old lead, there must be some relationship between both that would be destroyed if i cant link the lead info to the new contact, but i cant find any detailed info about how to do it in a right way.

Thank you.

You should share the version of all your relevant software: Suite, DB, OS, PHP.

Hi Chris thanks for the reply, sure, the software we use is:
-Php 8.2.

You need proper versions. Check the below link.

Client is using SuiteCRM 7.10.32, and all is working properly on his side, the question is , ¿how could I transform a Lead into a Contact using the Soap API?.

Here’s how to use the v4.1 SOAP API:

And the V8 (JSON/REST) API:

I don’t know that you can “convert” a lead by API. However, you could probably replicate all the action steps. It would be pretty complicated. You’d have to:

  1. Change status of lead to “converted”
  2. Create a new contact, copy over the info and relate to lead
  3. Create and account, copy over the info and relate to contact
  4. loop through related tasks, calls, emails ,etc and change the relationship from the lead to the contact.
  5. There’s also a duplicate check in the conversion process to ensure your not creating a duplicate contact or account, you may want to replicate that.

Seem a good approach for me, i will give it a try.

Thank you.

Another possible approach to use an API custom extension (which I don’t know how to do), or a custom entrypoint (well documented in the official docs) and then calling the existing "convert lead2 code from there.

This should do all that @pstevens lists in his steps, and might be a lot quicker than trying to make so many successive API calls.

See function handleSave in modules/Leads/views/view.convertlead.php

@pgr Interesting! Never thought of calling existing functionality inside a custom entry point to trigger a convert action!

It’s just an idea - I expect a few problems will need to be ironed out. But it should be doable, by looking at what the code expects.

For example, I see it’s reading a bunch of $_REQUEST parameters that it expects from the view. You’d have to touch up that global variable before calling the function… and there are likely other problems that need solving.

On the other hand, if you skim through the code you will also realize there’s a lot of work in there, a lot of accumulated wisdom about converting leads that would be quite hard to replicate on your own…