convertLead Method

convertLead Method

Purpose

You can use this method to convert lead to potential, account and contact. You can also associate the existing contact or account to the converting lead using this method.

For lead conversion process, see Convert Leads to Other Sales Records in User Manual.

Request URL

XML Format:
https://crm.zoho.com/crm/private/xml/Leads/convertLead?authtoken=Auth Token&scope=crmapi &leadId=entity Id&xmlData=POTENTIALXMLDATA

JSON Format:
https://crm.zoho.com/crm/private/json/Leads/convertLead?authtoken=Auth Token&scope=crmapi &leadId=entity Id&xmlData=POTENTIALXMLDATA

Request Parameters

Parameter Data Type Description
authtoken* String Encrypted alphanumeric string to authenticate your Zoho credentials.
scope* String Specify the value as crmapi
leadId* String Specify unique ID of the lead
xmlData* XML Specify fields and corresponding values
newFormat Integer newFormat=1: To exclude fields with "null" values while inserting data from your CRM account.
newFormat=2:To include fields with "null" values while inserting data from your CRM account.
version Integer version = 1: (Default value) This will fetch responses based on the earlier API implementation i.e prior to the enhancements made.
version = 2: This will fetch responses based on the latest API implementation.

* - Mandatory parameter

Note:

  • Refer the Release Notes page to learn more about enhancements made in the API implementation.

Sample XML to convert a Lead into an Account, Contact and Potential

<Potentials>
<row no="1">
<option val="createPotential">true</option>
<option val="assignTo">sample@zoho.com</option>
<option val="notifyLeadOwner">true</option>
<option val="notifyNewEntityOwner">true</option>
</row>
<row no="2">
<FL val="Potential Name">Samplepotential</FL>
<FL val="Closing Date">12/21/2009</FL><FL val="Potential Stage">Closed Won</FL>
<FL val="Contact Role">Purchasing</FL>
<FL val="Amount">3432.23</FL>
<FL val="Probability">100</FL>
</row>
</Potentials>

Note:

  • In this XML, <row no="2"> is mandatory ONLY if the value for "createPotential" is set to true.If the value for "createPotential" is set to false, a Potential will NOT be created on conversion of the Lead.

Sample XML to associate the existing contact or account to the converting lead

<Potentials>
<row no="1">
<option val="createPotential">true</option>
<option val="assignTo">sample@zoho.com</option>
<option val="notifyLeadOwner">true</option>
<option val="notifyNewEntityOwner">true</option>
</row>
<row no="2">
<FL val="Potential Name">Samplepotential</FL>
<FL val="Closing Date">12/21/2009</FL><FL val="Potential Stage">Closed Won</FL>
<FL val="Contact Role">Purchasing</FL>
<FL val="Amount">3432.23</FL>
<FL val="Probability">100</FL>
<FL val="ACCOUNTID">543212345</FL>
<FL val="CONTACTID">1234554321</FL>
<FL val="OVERWRITE">true</FL>
</row>
</Potentials>

Note:

  • The assignTo value can either be SMOWNERID or email id.
  • You can associate the existing contact or account to the converting lead even if the lead is converted or not converted to a potential. To achieve this, you have to send ACCOUNTID and CONTACTID through xml
  • If both <FL val="ACCOUNTID"></FL> and <FL val="OVERWRITE">true</FL> values are given, then the account name will be replaced by the company name while associating with the existing account. However, the data of that account will remain the same
  • If OVERWRITE value is false, then association will only happen. However, if you give OVERWRITE value without giving ACCOUNTID, the working of this method remains unchanged
  • If <FL val="CONTACTID"></FL> is given, then the converting lead will be associated to the existing contact

Sample XML to convert a Lead without creating a Potential

<Potentials>
<row no="1">
<option val="createPotential">false</option>
<option val="assignTo">sample@zoho.com</option>
<option val="notifyLeadOwner">true</option>
<option val="notifyNewEntityOwner">true</option>
</row>
</Potentials>

    • Related Articles

    • convertLeads Method - Comparison

      Purpose To convert lead to potential, account and contact. Request URL Version 1.0: https://crm.zoho.com/crm/private/xml/Leads/convertLead?authtoken=AuthToken&scope=crmapi&leadId=entity Id&xmlData=POTENTIALXMLDATA Version 2.0: URL: ...
    • deleteRecords Method

      Table of Contents Purpose Request URL Request Parameters Example Purpose You can use this method to delete the selected record (you must specify unique ID of the record) and move to the recycle bin. Note: This method is availablefor all modules. ...
    • downloadPhoto Method

       Purpose You can use this method to download the photos of Leads or Contacts.  Request URL XML Format: For Leads: https://crm.zoho.com/crm/private/xml/Leads/downloadPhoto?authtoken=Auth Token&scope=crmapi&id=RecordID For Contacts: ...
    • searchRecords Method

       Purpose You can use the searchRecords method to get the list of records that meet your search criteria.  Request URL XML Format: https://crm.zoho.com/crm/private/xml/Leads/searchRecords?authtoken=Auth Token&scope=crmapi&criteria=(((Last ...
    • deleteFile Method

      Purpose You can use this method to delete files attached to records. Request URL XML Format: https://crm.zoho.com/crm/private/xml/Leads/deleteFile?authtoken=Auth Token&scope=crmapi&id=Attachment Id JSON Format: ...