Deluge Help

Retrieve individual Records from Zoho Subscriptions

 Overview

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

 Supported Modules

  • Customers
  • Subscriptions
  • Hosted Pages
  • Events

 Syntax

<response> = zoho.subscriptions.retrieve(<module>, <orgID>, <ID> );

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.

<ID> refers to the ID of the record you want to fetch.

Note:

  • All the parameters listed above are mandatory.

 Examples

1) Retrieve a record from Hosted Pages module of Zoho Subscriptions

In this example, we will fetch a record from the Hosted Pages module byadding code to a Zoho Creator form and submitting the form. The form consists of field "Record ID". Upon submission of the form, the specified record gets retrieved from Zoho Subscriptions using the data submitted.​

response = zoho.subscriptions.retrieve("hostedpages", "12345678", input.Record_ID);

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

where,
"hostedpages" and "12345678" refer to the module name and org ID respectively.
input.Record_ID refers to the Zoho Creator form field.

 Response Format

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

{
"custom_fields":"[]",
"message":"success",
"status":"fresh",
"hostedpage_id":"2-1a76024dc81f1bb6dd4a78d3a5c6f2b16cf56ec5a5b67151097ba494318be79b8a3668c64f1e146cd07b01e06e3e282a",
"action":"new_subscription",
"expiring_time":"2015-03-10T11:53:07+0530",
"code":0,
"created_time":"2015-03-10T10:53:07+0530",
"url":"https://subscriptions.zoho.com/hostedpage/2-1a76024dc81f1bb6dd4a78d3a5c6f2b16cf56ec5a5b67151097ba494318be79b8a3668c64f1e146cd07b01e06e3e282a/checkout"
}

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

Error Response for - Invalid Record ID

{"message":"Please specify a valid hosted page.","code":107401}

Share this post : FacebookTwitter

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

Write to us: support@zohocreator.com