Convert Inventory Records

Purpose

To convert inventory records. The following are the conversions you can perform:

  • Quotes to Sales Orders or Invoices
  • Sales Orders to Invoices

Request Details

Request URLs

To convert Quotes module record to Sales Order or Invoice record:

{api-domain}/crm/{version}/Quotes/{record_id}/actions/convert

To convert Sales Orders module record to Invoice record:

{api-domain}/crm/{version}/Sales_Orders/{record_id}/actions/convert

Header

Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52

Scope

scope= ZohoCRM.mass_convert.{module_api_name}.CREATE
Note:Specify the API name of the parent module, from which you want to convert the record.

Possible modules names

Quotes, and Sales Orders
 

Sample Request

Copiedcurl "https://www.zohoapis.com/crm/v6/Quotes/3652397000007566544/actions/convert"
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"
-d "@input.json"
-X POST

Input JSON Keys

  • convert_toJSON array, mandatory

    Represents the details of the module to which you want to convert the record.

    • moduleJSON object, mandatory

      The API name and the unique ID of the module to which you want to convert the record.

Notes

  • Upon conversion, the tags will be carried over to the converted record.
  • The record being converted is considered the parent record, and the converted record is considered as the child record.

Sample Input

Copied{
    "data": [
        {
            "convert_to": [
                {
                    "module": {
                        "id": "2423488000000000171",
                        "api_name": "Sales_Orders"
                    }
                }
            ]
        }
    ]
}

Possible Errors

  • MANDATORY_NOT_FOUNDHTTP 400

    Required field not found

    Resolution: The 'convert_to' field is missing in your input body. Please specify the required field.

  • AMBIGUITY_DURING_PROCESSINGHTTP 400

    The ID given in the request body does not belong to the respective module from which you are trying to convert

    Resolution: Specify the required field with its valid module API name and ID.

  • EXPECTED_FIELD_MISSINGHTTP 400

    The 'convert_to' JSON array is missing or empty

    Resolution: Specify the mandatory 'convert_to' key in the input body.

  • INVALID_DATAHTTP 400
    • The 'convert_to' data type seems to be invalid
    • The given 'module' data type seems to be invlaid
    • The given 'id' seems to be invalid
    • Invalid data type of module ID
    • The data type of the API name is invalid
    • The requested ID given seems to be invalid
    • The requested module name given seems to be invalid
    • Multiple modules have been used for conversion in the request body

    Resolutions:

    • The 'convert_to' must be a JSON array. Please specify the valid data type.
    • The 'module' must be a JSON object. Please specify the valid data type.
    • Please specify the valid module ID.
    • Specify a valid data type for the module ID. Accepted data type is 'string.'
    • The data type of the API name should be a string.
    • Specify a valid record ID in the request.
    • Specify a valid module API name in the request.
    • One module for conversion per action is allowed.
  • ID_ALREADY_CONVERTEDHTTP 400

    ID already converted

    Resolution: The record you have specified has already been converted. Please specify another unique record ID.

  • NOT_APPROVEDHTTP 400

    Specified parent record has not been approved

    Resolution: You cannot convert a record that is still in approval process.

  • NOT_REVIEWEDHTTP 400

    Specified parent record has not been reviewed

    Resolution: You cannot convert a record that is still in review process.

  • INVALID_REQUEST_METHODHTTP 400

    The http request method type is not a valid one
    Resolution: You have specified an invalid HTTP method to access the API URL. Specify a valid request method. Refer to the endpoints section above.

  • DUPLICATE_DATAHTTP 401

    Duplicate unique value has been found 
    Resolution: If the unique field in the target module already has a record with the same value as the one being converted, the conversion will not proceed. Ensure that the unique field value for the record being converted is distinct from existing records in the target module.

  • OAUTH_SCOPE_MISMATCHHTTP 401

    Unauthorized 
    Resolution: Client does not have ZohoCRM.modules.Quotes.CREATE (or) ZohoCRM.modules.SalesOrders.CREATE scope.
    Create a new  token with valid scope the required scopes. Refer to scope section above.

  • AUTHENTICATION_FAILUREHTTP 401

    Authentication failed
    Resolution: Pass the access token in the request header of the API call.

  • NO_PERMISSIONHTTP 403
    • Permission is denied for the parent module or child module
    • The parent or child module is disabled in Organize Modules

    Resolutions:

    • Enable permission for the parent or child module. For that, refer to the note section below.
    • Enable permission for the parent or child module in the Organize Modules section. Refer to the note section below for more details.
  • INVALID_URL_PATTERNHTTP 404

    Please check if the URL trying to access is a correct one
    Resolution: The request URL specified is incorrect. Specify a valid request URL. Refer to the request URL section above.

  • INTERNAL_ERRORHTTP 500

    Internal Server Error
    Resolution: Unexpected and unhandled exception in the server. Contact support team.

Notes

  • To perform inventory record conversions, it is necessary to enable inventory module permission in both the Organize modules and Security Control. If these permissions are not enabled, the system will give a NO_PERMISSION error. Please note that only users with admin access has access to these settings.
    • To enable the Organize Modules permission, go to Setup > Customization > Modules and Fields > Organize Modules tab. Choose the module you want to enable and grant permission.
    • To enable Security Control permissions, go to to Setup > Security Control > Profiles. Select the desired profiles (only custom profiles, for the system-defined profiles, it is already enabled) that require access to the modules, choose the modules (Quotes and Sales Orders) you want to enable from Convert and Mass Convert options in Import/Export Permissions section, and grant permission.

Sample Response

Copied{
    "data": [
        {
            "code": "SUCCESS",
            "details": {
                "Sales_Orders": {
                    "name": "Patricia",
                    "id": "2423488000000619001"
                }
            },
            "message": "The record has been converted successfully",
            "status": "success"
        }
    ]
}