Fetch records from Zoho Billing
Table of ContentsUp
Overview
This task is used to fetch records from Zoho Billing. This task is based on Zoho Billing API <ModuleName> -> List All <ModuleName>.
Syntax
where:
Params | Data type | Description |
<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.subscription.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:
|
Example: Fetch records from Zoho Billing
When the following script gets executed, the specified record is updated in the "Subscriptions" module in Zoho Billings.
response = zoho.subscriptions.getList("Subscriptions", "66XXXXX66", 1, 200, "subscriptions_connection");
where:
response
"Subscriptions"
"66XXXXX66"
1
200
"subscriptions_connection"
Sample Response
The success response returned is of the following format:
"message":"success",
"transactions":[
{
"amount":1000,
"status":"sent",
"reference_id":"INV-000002",
"type":"invoice",
"date":"2015-03-10",
"transaction_id":"115888000000046015"
},
{
"amount":100,
"status":"sent",
"reference_id":"INV-000001",
"type":"invoice",
"date":"2015-03-10",
"transaction_id":"115888000000047015"
}
],
"page_context":{
"per_page":200,
"sort_column":"date",
"has_more_page":false,
"page":1,
"applied_filter":"TransactionType.All",
"sort_order":"D"
},
"code":0
}
To fetch the record IDs from the response, use the following snippet:
// 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
}