Create Records

Create record in Zoho Subscriptions


This task is used to create a record in Zoho Subscriptions.


<variable> = zoho.subscriptions.create(<module_name><org_id>,<data_map>, <connection>);


ParameterData typeDescription



is the variable response returned by Zoho Subscriptions.



is the name of the module in where the record will be added.

Following are the applicable modules.



Hosted Pages



Org ID of the organization in which the record will be created.c

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



Input map with key as Zoho Subscriptions field's name and the required value. For ex: {"display_name":input.Last_Name}

To learn about the mandatory fields, click here and go to <Module> --> Create <Module> 




specifies the name of the Zoho Subscriptions connection.

*Note: This param is not applicable in Zoho Creator and mandatory in Zoho Cliq.


1) Let's say we have a Zoho Creator form containing fields Customer_ID, and Plan code. On submission of this form, a subscription must be created in Zoho Subscriptions with the details specified in the form. We can achieve this using the following snippet:

values = map();
values.put("customer_id", input.Customer_ID);
values.put("auto_collect", false);
values.put("plan", {"plan_code" : input.Plan_Code});

response = zoho.subscriptions.create("Subscriptions", "66XXXXX66", values);


is a MAP variable which hold key value pairs required to create a subscription
are the TEXT that represents the label name of the field specified in Zoho Subscriptions API. Customer ID can be viewed in the url in Zoho Subscriptions when you click on a Customer record.
is the TEXT that represents the module in which the record needs to be created
is the TEXT that represents the organization ID of the Zoho Subscriptions account in which the record needs to be created

2) Let’s take an example of creating a record in the "Customers" module in Zoho Subscriptions using the following snippet.

values = map();
values.put("display_name" , "john");
values.put("email" , "");

resp = zoho.subscriptions.create("Customers", "10982991", values);


valuesis a map variable that holds key value pairs
are names of Zoho Subscriptions fields.
are field inputs
"Customers"is the module in Zoho Subscriptions, where the record will be created.
respis response returned as map by Zoho Subscriptions.
10982991org id of the organzation in which the record will be created.

Sample Response

The following is a sample success response:

   "message":"The customer has been added.",
      "payment_terms_label":"Due On Receipt",

To fetch the ID of the record from the returned response, use the following snippet:

info <response_variable>.get("<module_name>").get("<module_name>_id">
// example for <module_name> is customer and example for <module_name>_id is customer_id

The following is a sample failure response:

"message":"Enter valid Customer Name",

Related Links

Share this post : FacebookTwitter

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

Write to us: