Plans
A plan object contains the billing and pricing information of a plan. Your organization may consist of plans that differ either by features or by the plan’s billing frequency. You can have a $10 basic plan, $20 professional plan, $24 monthly or a $240 yearly plan.
Attribute
active
or inactive
.months
or years
. For interval=2 and interval_unit=months, the customer is billed every two months.inter
or intra
.addon_code
and name
as properties. active
or inactive
.{
"plan_code": "basic-monthly",
"name": "Basic",
"description": "Basic monthly plan.",
"store_markup_description": "Mailbox Storage-100GB | User & Docs Storage-500GB | User",
"status": "active",
"product_id": "903000000045027",
"account_id": "903000987009900",
"account_name": "Sales",
"tax_id": "903000000065300",
"trial_period": 1,
"setup_fee": 0,
"setup_fee_account_id": "903000987009903",
"setup_fee_account_name": "General Income",
"tags": [
{
"tag_option_id": "460000000054280",
"is_tag_mandatory": false,
"tag_name": "Colors",
"tag_id": "460000000054182",
"tag_option_name": "Black"
}
],
"custom_fields": [
{
"customfield_id": "2000000029001",
"is_active": "true",
"show_in_all_pdf": "true",
"value_formatted": "Normal",
"data_type": "string",
"index": 1,
"label": "cfitem",
"show_on_pdf": false,
"placeholder": "cf_cfitem",
"value": "Normal"
}
],
"recurring_price": 400,
"unit": "kg",
"interval": 1,
"interval_unit": "months",
"billing_cycles": -1,
"product_type": "goods",
"hsn_or_sac": "74191010",
"sat_item_key_code": 71121206,
"unitkey_code": "E48",
"item_tax_preferences": [
{
"tax_specification": "intra",
"tax_name": "GST",
"tax_percentage": 10,
"tax_id": "903000000065300"
}
],
"addons": [
{
"addon_code": "Email-basic",
"name": "Monthly_Addon",
"status": "active",
"pricing_scheme": "unit",
"unit_name": "Email",
"price_brackets": [
{
"start_quantity": 1,
"end_quantity": 50,
"price": 10
}
]
}
],
"url": "https://billing.zoho.com/subscribe/3b884751f87f05e584c3952b6388e7f96a2bba0f6b0532177e00f0ba8db832fc/basic-monthly",
"created_time": "2016-06-05T17:40:49-0700",
"updated_time": "2016-06-05T24:40:49-0700"
}
Create a plan
Create a new plan.
OAuth Scope : ZohoSubscriptions.plans.CREATE
Arguments
months
or years
. For interval=2 and interval_unit=months, the customer is billed every two months.inter
or intra
.parameters_data='{"field1":"value1","field2":"value2"}';
headers_data = Map();
headers_data.put("X-com-zoho-subscriptions-organizationid", "10234695");
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://www.zohoapis.com/billing/v1/plans"
type: POST
headers: headers_data
content-type: application/json
parameters: parameters_data
connection: <connection_name>
]
info response;
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"field1\":\"value1\",\"field2\":\"value2\"}");
Request request = new Request.Builder()
.url("https://www.zohoapis.com/billing/v1/plans")
.post(body)
.addHeader("X-com-zoho-subscriptions-organizationid", "10234695")
.addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
const options = {
method: 'POST',
headers: {
'X-com-zoho-subscriptions-organizationid': '10234695',
Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f',
'content-type': 'application/json'
},
body: '{"field1":"value1","field2":"value2"}'
};
fetch('https://www.zohoapis.com/billing/v1/plans', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
import http.client
conn = http.client.HTTPSConnection("www.zohoapis.com")
payload = "{\"field1\":\"value1\",\"field2\":\"value2\"}"
headers = {
'X-com-zoho-subscriptions-organizationid': "10234695",
'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f",
'content-type': "application/json"
}
conn.request("POST", "/billing/v1/plans", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
const http = require("https");
const options = {
"method": "POST",
"hostname": "www.zohoapis.com",
"port": null,
"path": "/billing/v1/plans",
"headers": {
"X-com-zoho-subscriptions-organizationid": "10234695",
"Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f",
"content-type": "application/json"
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({field1: 'value1', field2: 'value2'}));
req.end();
curl --request POST \
--url https://www.zohoapis.com/billing/v1/plans \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \
--header 'X-com-zoho-subscriptions-organizationid: 10234695' \
--header 'content-type: application/json' \
--data '{"field1":"value1","field2":"value2"}'
{
"plan_code": "basic-monthly",
"name": "Basic",
"recurring_price": 400,
"unit": "kg",
"interval": 1,
"interval_unit": "months",
"billing_cycles": -1,
"trial_period": 1,
"setup_fee": 100,
"setup_fee_account_id": "903000987009903",
"tags": [
{
"tag_id": "460000000054182",
"tag_option_id": "460000000054280"
}
],
"custom_fields": [
{
"label": "cfitem",
"value": "Normal"
}
],
"product_id": "903000000045027",
"product_type": "goods",
"hsn_or_sac": "74191010",
"sat_item_key_code": 71121206,
"unitkey_code": "E48",
"item_tax_preferences": [
{
"tax_specification": "intra",
"tax_name": "GST",
"tax_percentage": 10,
"tax_id": "903000000065300"
}
],
"tax_id": "903000000065300",
"is_taxable": true,
"tax_exemption_id": "903000006345",
"tax_exemption_code": "GST FREE",
"description": "Basic monthly plan.",
"store_markup_description": "Mailbox Storage-100GB | User & Docs Storage-500GB | User",
"can_charge_setup_fee_immediately": true
}
{
"code": 0,
"message": "The plan has been created.",
"plan": {
"plan_code": "basic-monthly",
"name": "Basic",
"description": "Basic monthly plan.",
"store_markup_description": "Mailbox Storage-100GB | User & Docs Storage-500GB | User",
"status": "active",
"product_id": "903000000045027",
"account_id": "903000987009900",
"account_name": "Sales",
"tax_id": "903000000065300",
"trial_period": 1,
"setup_fee": 0,
"setup_fee_account_id": "903000987009903",
"setup_fee_account_name": "General Income",
"tags": [
{
"tag_option_id": "460000000054280",
"is_tag_mandatory": false,
"tag_name": "Colors",
"tag_id": "460000000054182",
"tag_option_name": "Black"
}
],
"custom_fields": [
{
"customfield_id": "2000000029001",
"is_active": "true",
"show_in_all_pdf": "true",
"value_formatted": "Normal",
"data_type": "string",
"index": 1,
"label": "cfitem",
"show_on_pdf": false,
"placeholder": "cf_cfitem",
"value": "Normal"
}
],
"recurring_price": 400,
"unit": "kg",
"interval": 1,
"interval_unit": "months",
"billing_cycles": -1,
"product_type": "goods",
"hsn_or_sac": "74191010",
"sat_item_key_code": 71121206,
"unitkey_code": "E48",
"item_tax_preferences": [
{
"tax_specification": "intra",
"tax_name": "GST",
"tax_percentage": 10,
"tax_id": "903000000065300"
}
],
"addons": [
{
"addon_code": "Email-basic",
"name": "Monthly_Addon",
"status": "active",
"pricing_scheme": "unit",
"unit_name": "Email",
"price_brackets": [
{
"start_quantity": 1,
"end_quantity": 50,
"price": 10
}
]
}
],
"url": "https://billing.zoho.com/subscribe/3b884751f87f05e584c3952b6388e7f96a2bba0f6b0532177e00f0ba8db832fc/basic-monthly",
"created_time": "2016-06-05T17:40:49-0700",
"updated_time": "2016-06-05T24:40:49-0700"
}
}
List all plans
List of all plans created.
OAuth Scope : ZohoSubscriptions.plans.READ
Query Parameters
filter_by
. The allowed values for filter_by are PlanStatus.(All
, ACTIVE
and INACTIVE
).product_id
. headers_data = Map();
headers_data.put("X-com-zoho-subscriptions-organizationid", "10234695");
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://www.zohoapis.com/billing/v1/plans"
type: GET
headers: headers_data
connection: <connection_name>
]
info response;
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://www.zohoapis.com/billing/v1/plans")
.get()
.addHeader("X-com-zoho-subscriptions-organizationid", "10234695")
.addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
.build();
Response response = client.newCall(request).execute();
const options = {
method: 'GET',
headers: {
'X-com-zoho-subscriptions-organizationid': '10234695',
Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
}
};
fetch('https://www.zohoapis.com/billing/v1/plans', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
import http.client
conn = http.client.HTTPSConnection("www.zohoapis.com")
headers = {
'X-com-zoho-subscriptions-organizationid': "10234695",
'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"
}
conn.request("GET", "/billing/v1/plans", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
const http = require("https");
const options = {
"method": "GET",
"hostname": "www.zohoapis.com",
"port": null,
"path": "/billing/v1/plans",
"headers": {
"X-com-zoho-subscriptions-organizationid": "10234695",
"Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
curl --request GET \
--url https://www.zohoapis.com/billing/v1/plans \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \
--header 'X-com-zoho-subscriptions-organizationid: 10234695'
{
"code": 0,
"message": "success",
"plans": [
{
"plan_code": "basic-monthly",
"name": "Basic",
"recurring_price": 400,
"unit": "kg",
"interval": 1,
"interval_unit": "months",
"billing_cycles": -1,
"trial_period": 0,
"setup_fee": 0,
"setup_fee_account_id": "903000987009903",
"setup_fee_account_name": "General Income",
"product_id": "903000000045027",
"tax_id": "903000000065300",
"product_type": "goods",
"hsn_or_sac": "74191010",
"sat_item_key_code": 71121206,
"unitkey_code": "E48",
"item_tax_preferences": [
{
"tax_specification": "intra",
"tax_name": "GST",
"tax_percentage": 10,
"tax_id": "903000000065300"
}
],
"description": "Basic monthly plan.",
"store_markup_description": "Mailbox Storage-100GB | User & Docs Storage-500GB | User",
"status": "active",
"addons": [
{
"addon_code": "Email-basic",
"name": "Basic"
}
],
"created_time": "2016-06-05T17:40:49-0700",
"updated_time": "2016-06-05T24:40:49-0700"
},
{...},
{...}
]
}
Update a plan
Update details of an existing plan.
OAuth Scope : ZohoSubscriptions.plans.UPDATE
Arguments
months
or years
. For interval=2 and interval_unit=months, the customer is billed every two months.addon_code
and name
as properties.inter
or intra
.parameters_data='{"field1":"value1","field2":"value2"}';
headers_data = Map();
headers_data.put("X-com-zoho-subscriptions-organizationid", "10234695");
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://www.zohoapis.com/billing/v1/plans/basic-monthly"
type: PUT
headers: headers_data
content-type: application/json
parameters: parameters_data
connection: <connection_name>
]
info response;
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"field1\":\"value1\",\"field2\":\"value2\"}");
Request request = new Request.Builder()
.url("https://www.zohoapis.com/billing/v1/plans/basic-monthly")
.put(body)
.addHeader("X-com-zoho-subscriptions-organizationid", "10234695")
.addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
const options = {
method: 'PUT',
headers: {
'X-com-zoho-subscriptions-organizationid': '10234695',
Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f',
'content-type': 'application/json'
},
body: '{"field1":"value1","field2":"value2"}'
};
fetch('https://www.zohoapis.com/billing/v1/plans/basic-monthly', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
import http.client
conn = http.client.HTTPSConnection("www.zohoapis.com")
payload = "{\"field1\":\"value1\",\"field2\":\"value2\"}"
headers = {
'X-com-zoho-subscriptions-organizationid': "10234695",
'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f",
'content-type': "application/json"
}
conn.request("PUT", "/billing/v1/plans/basic-monthly", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
const http = require("https");
const options = {
"method": "PUT",
"hostname": "www.zohoapis.com",
"port": null,
"path": "/billing/v1/plans/basic-monthly",
"headers": {
"X-com-zoho-subscriptions-organizationid": "10234695",
"Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f",
"content-type": "application/json"
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({field1: 'value1', field2: 'value2'}));
req.end();
curl --request PUT \
--url https://www.zohoapis.com/billing/v1/plans/basic-monthly \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \
--header 'X-com-zoho-subscriptions-organizationid: 10234695' \
--header 'content-type: application/json' \
--data '{"field1":"value1","field2":"value2"}'
{
"plan_code": "basic-monthly",
"name": "Basic",
"recurring_price": 400,
"unit": "kg",
"interval": 1,
"interval_unit": "months",
"billing_cycles": -1,
"trial_period": 0,
"setup_fee": 0,
"setup_fee_account_id": "903000987009905",
"tags": [
{
"tag_id": "460000000054182",
"tag_option_id": "460000000054278"
}
],
"custom_fields": [
{
"label": "cfitem",
"value": "test"
}
],
"addons": [
{
"addon_code": "Email-basic",
"name": "Monthly_Addon"
}
],
"product_type": "goods",
"hsn_or_sac": "74191010",
"sat_item_key_code": 71121206,
"unitkey_code": "E48",
"item_tax_preferences": [
{
"tax_specification": "intra",
"tax_name": "GST",
"tax_percentage": 10,
"tax_id": "903000000065300"
}
],
"tax_id": "903000000065300",
"is_taxable": true,
"tax_exemption_id": "903000006345",
"tax_exemption_code": "GST FREE",
"description": "Basic monthly plan.",
"store_markup_description": "Mailbox Storage-100GB | User & Docs Storage-500GB | User",
"can_charge_setup_fee_immediately": true
}
{
"code": 0,
"message": "The plan details has been updated.",
"plan": {
"plan_code": "basic-monthly",
"name": "Basic",
"description": "Basic monthly plan.",
"store_markup_description": "Mailbox Storage-100GB | User & Docs Storage-500GB | User",
"can_charge_setup_fee_immediately": true,
"status": "active",
"product_id": "903000000045027",
"account_id": "903000987009900",
"account_name": "Sales",
"trial_period": 0,
"setup_fee": 0,
"setup_fee_account_id": "903000987009905",
"setup_fee_account_name": "Sales",
"tags": [
{
"tag_option_id": "460000000054278",
"is_tag_mandatory": false,
"tag_name": "Colors",
"tag_id": "460000000054182",
"tag_option_name": "Green"
}
],
"custom_fields": [
{
"customfield_id": "2000000029001",
"is_active": "true",
"show_in_all_pdf": "true",
"value_formatted": "test",
"data_type": "string",
"index": 1,
"label": "cfitem",
"show_on_pdf": false,
"placeholder": "cf_cfitem",
"value": "test"
}
],
"recurring_price": 400,
"unit": "kg",
"interval": 1,
"interval_unit": "months",
"billing_cycles": -1,
"url": "https://billing.zoho.com/subscribe/3b884751f87f05e584c3952b6388e7f96a2bba0f6b0532177e00f0ba8db832fc/basic-monthly",
"tax_id": "903000000065300",
"product_type": "goods",
"hsn_or_sac": "74191010",
"sat_item_key_code": 71121206,
"unitkey_code": "E48",
"item_tax_preferences": [
{
"tax_specification": "intra",
"tax_name": "GST",
"tax_percentage": 10,
"tax_id": "903000000065300"
}
],
"created_time": "2016-06-05T17:40:49-0700",
"updated_time": "2016-06-05T24:40:49-0700"
}
}
Retrieve a plan
Retrieve details of an existing plan.
OAuth Scope : ZohoSubscriptions.plans.READ
headers_data = Map();
headers_data.put("X-com-zoho-subscriptions-organizationid", "10234695");
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://www.zohoapis.com/billing/v1/plans/basic-monthly"
type: GET
headers: headers_data
connection: <connection_name>
]
info response;
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://www.zohoapis.com/billing/v1/plans/basic-monthly")
.get()
.addHeader("X-com-zoho-subscriptions-organizationid", "10234695")
.addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
.build();
Response response = client.newCall(request).execute();
const options = {
method: 'GET',
headers: {
'X-com-zoho-subscriptions-organizationid': '10234695',
Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
}
};
fetch('https://www.zohoapis.com/billing/v1/plans/basic-monthly', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
import http.client
conn = http.client.HTTPSConnection("www.zohoapis.com")
headers = {
'X-com-zoho-subscriptions-organizationid': "10234695",
'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"
}
conn.request("GET", "/billing/v1/plans/basic-monthly", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
const http = require("https");
const options = {
"method": "GET",
"hostname": "www.zohoapis.com",
"port": null,
"path": "/billing/v1/plans/basic-monthly",
"headers": {
"X-com-zoho-subscriptions-organizationid": "10234695",
"Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
curl --request GET \
--url https://www.zohoapis.com/billing/v1/plans/basic-monthly \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \
--header 'X-com-zoho-subscriptions-organizationid: 10234695'
{
"code": 0,
"message": "success",
"plan": {
"plan_code": "basic-monthly",
"name": "Basic",
"description": "Basic monthly plan.",
"store_markup_description": "Mailbox Storage-100GB | User & Docs Storage-500GB | User",
"status": "active",
"product_id": "903000000045027",
"account_id": "903000987009900",
"account_name": "Sales",
"trial_period": 0,
"setup_fee": 0,
"setup_fee_account_id": "903000987009903",
"setup_fee_account_name": "General Income",
"tags": [
{
"tag_option_id": "460000000054280",
"is_tag_mandatory": false,
"tag_name": "Colors",
"tag_id": "460000000054182",
"tag_option_name": "Black"
}
],
"custom_fields": [
{
"customfield_id": "2000000029001",
"is_active": "true",
"show_in_all_pdf": "true",
"value_formatted": "Normal",
"data_type": "string",
"index": 1,
"label": "cfitem",
"show_on_pdf": false,
"placeholder": "cf_cfitem",
"value": "Normal"
}
],
"recurring_price": 400,
"unit": "kg",
"interval": 1,
"interval_unit": "months",
"billing_cycles": -1,
"url": "https://billing.zoho.com/subscribe/3b884751f87f05e584c3952b6388e7f96a2bba0f6b0532177e00f0ba8db832fc/basic-monthly",
"tax_id": "903000000065300",
"product_type": "goods",
"hsn_or_sac": "74191010",
"sat_item_key_code": 71121206,
"unitkey_code": "E48",
"item_tax_preferences": [
{
"tax_specification": "intra",
"tax_name": "GST",
"tax_percentage": 10,
"tax_id": "903000000065300"
}
],
"created_time": "2016-06-05T17:40:49-0700",
"updated_time": "2016-06-05T24:40:49-0700"
}
}
Delete a plan
Delete an existing plan. A plan can only be deleted if it has no transactions associated with it.
OAuth Scope : ZohoSubscriptions.plans.DELETE
headers_data = Map();
headers_data.put("X-com-zoho-subscriptions-organizationid", "10234695");
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://www.zohoapis.com/billing/v1/plans/basic-monthly"
type: DELETE
headers: headers_data
connection: <connection_name>
]
info response;
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://www.zohoapis.com/billing/v1/plans/basic-monthly")
.delete(null)
.addHeader("X-com-zoho-subscriptions-organizationid", "10234695")
.addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
.build();
Response response = client.newCall(request).execute();
const options = {
method: 'DELETE',
headers: {
'X-com-zoho-subscriptions-organizationid': '10234695',
Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
}
};
fetch('https://www.zohoapis.com/billing/v1/plans/basic-monthly', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
import http.client
conn = http.client.HTTPSConnection("www.zohoapis.com")
headers = {
'X-com-zoho-subscriptions-organizationid': "10234695",
'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"
}
conn.request("DELETE", "/billing/v1/plans/basic-monthly", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
const http = require("https");
const options = {
"method": "DELETE",
"hostname": "www.zohoapis.com",
"port": null,
"path": "/billing/v1/plans/basic-monthly",
"headers": {
"X-com-zoho-subscriptions-organizationid": "10234695",
"Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
curl --request DELETE \
--url https://www.zohoapis.com/billing/v1/plans/basic-monthly \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \
--header 'X-com-zoho-subscriptions-organizationid: 10234695'
{
"code": 0,
"message": "The plan has been deleted."
}
Mark as active
Change the status of the plan to active.
OAuth Scope : ZohoSubscriptions.plans.CREATE
headers_data = Map();
headers_data.put("X-com-zoho-subscriptions-organizationid", "10234695");
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://www.zohoapis.com/billing/v1/plans/basic-monthly/markasactive"
type: POST
headers: headers_data
connection: <connection_name>
]
info response;
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://www.zohoapis.com/billing/v1/plans/basic-monthly/markasactive")
.post(null)
.addHeader("X-com-zoho-subscriptions-organizationid", "10234695")
.addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
.build();
Response response = client.newCall(request).execute();
const options = {
method: 'POST',
headers: {
'X-com-zoho-subscriptions-organizationid': '10234695',
Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
}
};
fetch('https://www.zohoapis.com/billing/v1/plans/basic-monthly/markasactive', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
import http.client
conn = http.client.HTTPSConnection("www.zohoapis.com")
headers = {
'X-com-zoho-subscriptions-organizationid': "10234695",
'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"
}
conn.request("POST", "/billing/v1/plans/basic-monthly/markasactive", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
const http = require("https");
const options = {
"method": "POST",
"hostname": "www.zohoapis.com",
"port": null,
"path": "/billing/v1/plans/basic-monthly/markasactive",
"headers": {
"X-com-zoho-subscriptions-organizationid": "10234695",
"Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
curl --request POST \
--url https://www.zohoapis.com/billing/v1/plans/basic-monthly/markasactive \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \
--header 'X-com-zoho-subscriptions-organizationid: 10234695'
{
"code": 0,
"message": "The plan has been marked as active."
}
Mark as inactive
Change the status of the plan to inactive.
OAuth Scope : ZohoSubscriptions.plans.CREATE
headers_data = Map();
headers_data.put("X-com-zoho-subscriptions-organizationid", "10234695");
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://www.zohoapis.com/billing/v1/plans/basic-monthly/markasinactive"
type: POST
headers: headers_data
connection: <connection_name>
]
info response;
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://www.zohoapis.com/billing/v1/plans/basic-monthly/markasinactive")
.post(null)
.addHeader("X-com-zoho-subscriptions-organizationid", "10234695")
.addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
.build();
Response response = client.newCall(request).execute();
const options = {
method: 'POST',
headers: {
'X-com-zoho-subscriptions-organizationid': '10234695',
Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
}
};
fetch('https://www.zohoapis.com/billing/v1/plans/basic-monthly/markasinactive', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
import http.client
conn = http.client.HTTPSConnection("www.zohoapis.com")
headers = {
'X-com-zoho-subscriptions-organizationid': "10234695",
'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"
}
conn.request("POST", "/billing/v1/plans/basic-monthly/markasinactive", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
const http = require("https");
const options = {
"method": "POST",
"hostname": "www.zohoapis.com",
"port": null,
"path": "/billing/v1/plans/basic-monthly/markasinactive",
"headers": {
"X-com-zoho-subscriptions-organizationid": "10234695",
"Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
curl --request POST \
--url https://www.zohoapis.com/billing/v1/plans/basic-monthly/markasinactive \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \
--header 'X-com-zoho-subscriptions-organizationid: 10234695'
{
"code": 0,
"message": "The plan has been marked as inactive."
}