Deluge Help

Get Records from Zoho Subscriptions

 Overview

Using zoho.subscriptions.getList() Deluge task in Zoho Creator, you can fetch records from supported modules of Zoho Subscriptions. You can make use of different workflow options in Zoho Creator to automate this process . Fetch customer details, transaction details, subscription detail etc., as and when you need to, using this task.

 Supported Modules

  • Customers
  • Subscriptions
  • Hosted Pages
  • Events
  • Transactions

 Syntax

<response> = zoho.subscriptions.getList(<module>, <orgID>, <per_page>, <page>);

where,
<response> is the map variable returned as response. It contains the details of the fetched record.
<module> is the name of the Zoho Subscriptions Module from where the record needs to be fetched. For example, "Customers" refers to the Customers module.
<orgID> refers to your organization ID as specified in Zoho Subscriptions. To know your organization ID, click on <YourOrganizationName> > Manage Organizations, from the top-right corner of your Zoho Subscriptions Home page. Click here to learn more about Org ID.
<per_page> is the number of records to be retrieved per page.
<page> is index number of the page which should be retrieved.

Note:

  • All the parameters listed above, except <per_page> and <page>, are mandatory.

 Examples

1) Fetch transaction details from Zoho Subscriptions using Zoho Creator form

In this example, we will fetch transaction details byadding code to a Zoho Creator form and submitting the form. The form consists of fields "Module Name" and "Org ID". Upon submission of the form, a record gets created in Zoho Subscriptions using the data submitted.​

response = zoho.subscriptions.getList(input.Module_Name, input.Org_ID);

  • Submitting the form will fetch all records from the specified module and orgID.

where,
"input.Module_Name" and "input.Org_ID" refer to Zoho Creator form fields.

 Response Format

Following is the response format returned by Zoho Subscriptions to Zoho Creator:

{
"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
}

If for some reason, the execution fails, the error response will be in the following format:

Error Response for - Module Name misspelt

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

Share this post : FacebookTwitter

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

Write to us: support@zohocreator.com