Inventory Templates

Purpose

To fetch the details of inventory templates.

Request Details

Request URL

{api-domain}/crm/{version}/settings/inventory_templates

To fetch details of a specific template
{api-domain}/crm/{version}/settings/inventory_templates/{id}

Supported modules

Quotes, Invoices, Purchase Orders, and Sales Orders.

All modules whose value for the key "inventory_template_supported" is true in the Modules API are supported here.

Header

Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52

Scope

scope=ZohoCRM.templates.inventory.READ

Parameters
  • modulestring, optional

    Specify the API name of the module you want to fetch the inventory templates from. Refer to the Supported modules section above.

  • categorystring, optional

    To filter the inventory templates based on their type. The possible values are favorite: templates marked as your favorite, created_by_me: templates that you created, shared_with_me: templates that other users shared with you, and draft: templates in your draft.

  • sort_bystring, optional

    Specify based on what you want to sort your templates. The possible values are modified_time: to sort based on the modified time, last_usage_time: to sort based on the latest time a template was used, and name: to sort based on the template's name. The default value is modified_time.

  • sort_orderstring, optional

    The order you want to sort the templates in. The possible values are asc: to sort in ascending order and desc: to sort in descending order, this is the default value.

Note
  • The sort_order parameter applies to given sort_by parameter value.

  • The content key contains the HTML of the email template and is rendered in the response only when you fetch a specific email template.

Sample Request

Copiedcurl "https://www.zohoapis.com/crm/v3/settings/inventory_templates"
-X GET
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"

Response JSON Keys

  • created_timestring

    Represents the date and time at which the inventory template was created.

  • modified_timestring

    Represents the date and time at which the inventory template was last modified.

  • folderJSON object

    Represents the name and unique ID of the template folder.

  • last_usage_timestring

    Represents the date and time at which the inventory template was last used.

  • moduleJSON object

    Represents the API name and unique ID of the module with which the inventory template is associated.

  • namestring

    Represents the name of the template.

  • modified_byJSON object

    Represents the name and ID of the user who last modified the inventory template.

  • idstring

    Represents the unique ID of the inventory template.

  • editor_modestring

    Represents the mode in which the inventory template is created. The possible values are gallery: the template is chosen from the template gallery and is customized, rich_text: a pre-designed custom template, plain_text: the template is built from scratch.
    To know more about the editor modes, refer to Creating Inventory Templates.

  • favoriteboolean

    Represents if the inventory template is marked as favorite.

  • categorystring

    Represents the category of the template. The possible values are custom_templates: the templates created by a user, system_templates: the templates present in the system by default, plugin_templates: the templates that are created and installed from the Zoho CRM extension, marketplace_templates: the templates that are created and installed from the published plugins.

  • created_byJSON object

    Represents the name and ID of the user who created the inventory template.

Possible Errors

  • INVALID_MODULEHTTP 400

    The module name specified is invalid.
    Resolution: Specify the valid module API name. Refer to the Supported modules section above.

  • PATTERN_NOT_MATCHEDHTTP 400

    You have specified incorrect values for the key specified in "api_name" of the response.
    Resolution: Input correct values.

  • FEATURE_NOT_SUPPORTEDHTTP 403

    This feature is not supported for your edition.
    Resolution: Contact your administrator.

  • NO_PERMISSIONHTTP 403

    You do not have permission to view the templates of this module.
    Resolution: Contact your administrator.

  • 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.

  • OAUTH_SCOPE_MISMATCHHTTP 401

    Unauthorized
    Resolution: Client does not have ZohoCRM.templates.inventory.READ scope. Create a new client with valid scope. Refer to the Scope section above.

  • INTERNAL_ERRORHTTP 500

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

  • 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.

  • AUTHORIZATION_FAILEDHTTP 400

    User does not have sufficient privilege to read records data
    Resolution: The user does not have the permission to retrieve records data. Contact your system administrator.

Sample Response

Copied{
    "inventory_templates": [
        {
            "created_time": "2021-08-09T09:52:11+05:30",
            "modified_time": "2021-08-09T09:52:11+05:30",
            "folder": {
                "name": "Public Templates",
                "id": "4876876000000329734"
            },
            "last_usage_time": null,
            "module": {
                "api_name": "Purchase_Orders",
                "id": "4876876000000002223"
            },
            "name": "Purchase Order Template",
            "modified_by": {
                "name": "Patricia Boyle",
                "id": "4876876000000327001"
            },
            "id": "4876876000000329743",
            "editor_mode": "rich_text",
            "category": "system_templates",
            "favorite": false,
            "created_by": {
                "name": "Patricia Boyle",
                "id": "4876876000000327001"
            }
        },
        {
            "created_time": "2021-08-09T09:52:11+05:30",
            "modified_time": "2021-08-09T09:52:11+05:30",
            "folder": {
                "name": "Public Templates",
                "id": "4876876000000329734"
            },
            "last_usage_time": null,
            "module": {
                "api_name": "Sales_Orders",
                "id": "4876876000000002221"
            },
            "name": "Sales Order Template",
            "modified_by": {
                "name": "Patricia Boyle",
                "id": "4876876000000327001"
            },
            "id": "4876876000000329741",
            "editor_mode": "rich_text",
            "category": "system_templates",
            "favorite": false,
            "created_by": {
                "name": "Patricia Boyle",
                "id": "4876876000000327001"
            }
        },
        {
            "created_time": "2021-08-09T09:52:11+05:30",
            "modified_time": "2021-08-09T09:52:11+05:30",
            "folder": {
                "name": "Public Templates",
                "id": "4876876000000329734"
            },
            "last_usage_time": null,
            "module": {
                "api_name": "Invoices",
                "id": "4876876000000002225"
            },
            "name": "Invoice Template",
            "modified_by": {
                "name": "Patricia Boyle",
                "id": "4876876000000327001"
            },
            "id": "4876876000000329739",
            "editor_mode": "rich_text",
            "category": "system_templates",
            "favorite": false,
            "created_by": {
                "name": "Patricia Boyle",
                "id": "4876876000000327001"
            }
        },
        {
            "created_time": "2021-08-09T09:52:10+05:30",
            "modified_time": "2021-08-09T09:52:10+05:30",
            "folder": {
                "name": "Public Templates",
                "id": "4876876000000329734"
            },
            "last_usage_time": null,
            "module": {
                "api_name": "Quotes",
                "id": "4876876000000002219"
            },
            "name": "Quote Template",
            "modified_by": {
                "name": "Patricia Boyle",
                "id": "4876876000000327001"
            },
            "id": "4876876000000329737",
            "editor_mode": "rich_text",
            "category": "system_templates",
            "favorite": false,
            "created_by": {
                "name": "Patricia Boyle",
                "id": "4876876000000327001"
            }
        }
    ],
    "info": {
        "per_page": 200,
        "count": 4,
        "page": 1,
        "more_records": false
    }
}