Choose where you’d like to start

Fetch records from Zoho Billing

Overview

This task is used to fetch records from Zoho Billing. This task is based on Zoho Billing API <ModuleName> -> List All <ModuleName>.

Syntax

<variable> = zoho.billing.getList(<moduleName>, <organization_ID>, <per_page>, <page>, <connection>);

where:

Params Data typeDescription

<variable> 

KEY-VALUE

Response returned by Zoho Billing.

<module_name> 

TEXT

The name of the module from where the records will be fetched.

<organization_ID>

TEXT

ID of the organization from where the records will be fetched.

Note: Learn how to fetch organization ID from the UI and from the response of zoho.billing.getOrganization task.

<per_page>

NUMBER

Maximum number of records in a single page.

 

<page>

NUMBER

To get the list of records based on pages.

 

<connection>

TEXT

The link name of the Zoho Billing connection.

Note:

  • In view of stopping new authtoken generation, a Zoho OAuth connection with appropriate scopes is mandatory in order for new integration tasks (created after the deadline specified in the post) to work as expected. Existing integration tasks will continue to work with or without the connections parameter until you manually delete the authtoken from accounts.
  • Add relevant scopes mentioned in Zoho Billing API while creating the connection.
  • Refer to this post for the list of Zoho services that support the connections page.
  • Learn more about connections

Example: Fetch records from Zoho Billing

When the following script gets executed, the specified records are fetched from the "Customers" module in Zoho Billings.

response = zoho.billing.getList("Customers", "66XXXXX66", 2, 1, "billing_connection");

where:

response
is the KEY-VALUE variable returned by Zoho Billing
"Customers"
is the TEXT that represents the module from which the records need to be fetched.
"66XXXXX66"
is the TEXT that represents the organization ID of the Zoho Billing account in which the records will be fetched
2
is the NUMBER that represents the index of the first record that will be fetched
1
is the NUMBER that represents number of records that will be fetched
"billing_connection"
is the TEXT that represents Zoho Billing connection link name

Sample Response

The success response returned is of the following format:

{"code":0,"message":"success","customers":[{"customer_name":"Portia","display_name":"Portia","customer_id":"4592517000000082032","contact_id":"4592517000000082032","currency_code":"USD","currency_symbol":"$","status":"active","company_name":"Zylker","unused_credits":0.0,"outstanding_receivable_amount":0.0,"unused_credits_receivable_amount_bcy":0.0,"outstanding_receivable_amount_bcy":0.0,"outstanding":0.0,"first_name":"Neville","last_name":"Longbottom","email":"portia@zylker.com","phone":"9999999998","mobile":"","website":"","is_gapps_customer":false,"created_time":"2023-10-12T04:37:27-0400","updated_time":"2023-10-13T06:26:44-0400","is_portal_invitation_accepted":false,"payment_terms_label":"Due on Receipt","payment_terms":0,"created_by":"Megan V","has_attachment":false},{"customer_name":"John","display_name":"John","customer_id":"4592517000000086001","contact_id":"4592517000000086001","currency_code":"USD","currency_symbol":"$","status":"active","company_name":"Zylker","unused_credits":0.0,"outstanding_receivable_amount":0.0,"unused_credits_receivable_amount_bcy":0.0,"outstanding_receivable_amount_bcy":0.0,"outstanding":0.0,"first_name":"Primrose","last_name":"","email":"john.l@zylker.com","phone":"9999999999","mobile":"","website":"","is_gapps_customer":false,"created_time":"2023-10-13T02:34:40-0400","updated_time":"2023-10-13T06:24:15-0400","is_portal_invitation_accepted":false,"payment_terms_label":"Due on Receipt","payment_terms":0,"created_by":"Megan V","has_attachment":false}],"page_context":{"page":1,"per_page":2,"has_more_page":false,"report_name":"All Contacts","applied_filter":"Status.All","custom_fields":[],"sort_column":"customer_id","sort_order":"A"}}

 

To fetch the record IDs from the response, use the following snippet:

var = <response_variable>.get("<module_name>"); 
// example for <module_name> is customers
for each var1 in var
{
info var1.toMap().get("<module_name>_id");
// example for <module_name>_id is customer_id
}

The following is a sample failure response:

{  
   "message":"Invalid URL passed",
   "code":5
}

Related Links

Get Started Now

Execute