Creator Help

Get Records from Zoho Invoice

 Overview

The zoho.invoice.getrecords() task can be executed to fetch records from any of the supported modules of Zoho Invoice. By placing it in the required form actions block of Zoho Creator, the process of fetching records form Zoho Invoice can easily be automated as per requirement. Lets say we have a Zoho Creator form where records need to be fetched from Zoho Invoice for further action such as performing an iteration. You can execute zoho.invoice.getrecords() task in the required form actions block which will return the response containing the records in a map format. Further details on how to execute this task are explained below.

 Supported Modules

  • Invoices
  • CustomerPayments
  • Items
  • Contacts
  • Expenses
  • Estimates
  • ExpenseCategory

 Syntax

response =zoho.invoice.getrecords(moduleName, organisation_id, filter_by, search_text, sort_column)

where,
<response> - is the map variable returned by Zoho Invoice as response. 
<moduleName> - name of module in Zoho Invoice from where the records will be fetched. (mandatory)
<organisation_id> - required org id from where the records will be fetched(mandatory). Following is an image displaying a sample Organization ID.

filter_by allows to filter records by status (module specific). Click here and go to <module> -> <list module> for more information. Example, Contacts -> List Contacts.
search_text - search records based on search keywords (module specific). Click here and go to <module> -> <list module> for more information. Example, Contacts -> List Contacts.
sort_column - sort records of a column alphabetically (module specific). Click here and go to <module> -> <list module> for more information. Example, Contacts -> List Contacts.

 Example

Following is a sample script that can be added in a Zoho Creator form to fetch records from Zoho Invoice . Let's say we have a Creator form where we need to fetch records from Zoho Invoice to perform an iteration. You can add the following script in required form actions block of the Creator Form so that whenever this form is loaded, edited or submitted etc, records existing in Zoho Invoice's specified module are retrieved accordingly. In this case, the module is "Contacts". When the following script gets executed, all records from specified org ID in Zoho Invoice are fetched.

response = zoho.invoice.getrecords("Contacts", "10982991");

where,
response - is the map variable returned by Zoho Invoice as response. 
Contacts - name of module in Zoho Invoice from where the records will be fetched.
10982991 - sample Org ID from where the records will be fetched.

 Response

Response returned by Zoho Invoice as map:

{
    "code": 0,
    "message": "success",
    "contacts": [
        {
            "contact_id": "219715000000050001",
            "contact_name": "Bala",
            "company_name": "Bowman and Co",
            "contact_type": "customer",
            "status": "active",
            "source": "api",
            "is_linked_with_zohocrm": false,
            "payment_terms": 15,
            "payment_terms_label": "Net 15",
            "currency_id": "219715000000000099",
            "currency_code": "INR",
            "outstanding_receivable_amount": 0,
            "unused_credits_receivable_amount": 0,
            "first_name": "Will",
            "last_name": "Smith",
            "email": "willsmith@bowmanfurniture.com",
            "phone": " 1-925-921-9201",
            "mobile": " 1-4054439562",
            "created_time": "2015-11-30T16:25:32+0530",
            "last_modified_time": "2015-11-30T16:29:34+0530"
        }
        ],
    "page_context": {
        "page": 1,
        "per_page": 200,
        "has_more_page": false,
        "report_name": "Contacts",
        "applied_filter": "Status.All",
        "sort_column": "contact_name",
        "sort_order": "A"
    }
}

Failure Response:

{"message":"This user is not associated with the organization_id:11529358.","code":6041}

Share this post : FacebookTwitter

Still can't find what you're looking for?

Write to us: support@zohocreator.com