API Docs
/
No Results Found
Subscriptions

Subscriptions

A subscription enables you to charge customers at specified intervals for a plan of their choice.

End Points
Create a subscription
List all subscriptions
Update a subscription
Retrieve a subscription
Delete a subscription
Cancel a subscription
Reactivate subscription
View Scheduled Changes
Subscription Activities
Buy one-time addon
Associate a coupon
Remove a coupon
Update Card
Remove Card
Add Charge
Add contact person
Postpone renewal
Add/Edit description for a item in line items list
Change to Online/Offline mode
Update Reference
Update Sales Person
Update Custom Fields
Add a note
Delete a note

Attribute

subscription_id
string
Unique ID generated for a subscription.
name
string
Name generated by concatenation of the product name and the selected plan.
status
string
The status of the subscription. It can be live, trial, dunning, unpaid, non_renewing, cancelled, creation_failed, cancelled_from_dunning, expired, trial_expired or future.
amount
double
The amount that needs to be charged for the subscription.
created_at
string
Date at which the subscription was created.
activated_at
string
Date at which the subscription was activated.
current_term_starts_at
string
Date on which the current term of the subscription started.
current_term_ends_at
string
Date on which the current term of the subscription ends.
last_billing_at
string
The date on which the customer was billed last.
next_billing_at
string
The date on which the customer will be billed next. This will also be the date on which the next term of the subscription starts.
expires_at
string
This is applicable only when billing_cycle is set for a plan. A subscription expires on the last day of the last billing cycle.
interval
string
Indicates the number of intervals between each billing. If interval=2, the customer would be billed every two months or years depending on the value for interval_unit.
interval_unit
string
It can be either months or years. For interval=2 and interval_unit=months, the customer is billed every two months.
auto_collect
boolean
auto_collect is set to true for creating an online subscription which will charge the customer’s card automatically on every renewal. To create an offline subscriptions, set auto_collect to false.
created_time
string
Time at which the subscription was created.
updated_time
string
Time at which the subscription details were last updated.
reference_id
string
A string of your choice is required to easily identify and keep track of your subscriptions.
place_of_supply
string
India GST only
Place of Supply for the customer's subscription.
salesperson_id
string
Unique Id of the sales person assigned for the subscription.
salesperson_name
string
Name of the sales person assigned for the subscription.
child_invoice_id
string
Invoice ID of the most recent invoice to which the subscription is associated with.
currency_code
string
Currency code of the currency in which the customer wants to pay. If currency_code is not specified here, the currency chosen in your Zoho Billing organization will be used for billing. currency_id and currency_symbol are set automatically in accordance to the currency_code.
currency_symbol
string
Symbol of the customer's currency.
end_of_term
boolean
If there are any changes in the plan's subscriptions, those subscription changes can be made immediately if end_of_term is set to false. If end_of_term is set to true, the subscription changes take effect only after the current term of the subscription ends.
product_id
string
Product ID of the product to which the plan is associated with.
product_name
string
Name of the product which the plan belongs to.
plan
object
Plan object for which the subscription is to be created. This contains plan_code, name, price, quantity.
Show Sub-Attributes arrow
plan_code
string
Plan code of the plan that is to be subscribed to the customer.
name
string
Name generated by concatenation of the product name and the selected plan.
quantity
integer
Required quantity of the chosen plan.
price
double
Price of a plan for a particular subscription. If a value is provided here, the plan’s price for this subscription will be changed to the given value. If no value is provided, the plan’s price would be the same as what it was when it was created.
tags
array
Show Sub-Attributes arrow
tag_id
long
ID of the Tag
tag_option_id
long
Id of the Tag Option
item_custom_fields
array
Custom fields for a item.
Show Sub-Attributes arrow
label
string
Label of the Custom Field
value
string
Value of the Custom Field
discount
double
Discount amount applied for the plan.
total
double
Total amount for the plan.
setup_fee
double
, default is 0 only if exclude_setup_fee is true
Setup fee for the plan.
plan_description
string
Description of the plan exclusive to this subscription. This will be displayed in place of the plan name in invoices generated for this subscription.
tax_id
string
Unique ID of the tax or tax group that can be collected from the contact. Tax can be given only if is_taxable is true.
trial_days
integer
, default is 0 only if exclude_trial is true
Number of free trial days granted to a customer subscribed to this plan. Trial days for the subscription mentioned here will override the number of trial days provided at the time plan creation. This will be applicable even if exclude_trial=true.
addons
array
List of addon objects which are to be included in the subscription. Each object contains addon_code, name, price and quantity.
Show Sub-Attributes arrow
addon_code
string
Addon code of the addon.
name
Name of the addon.
addon_description
string
Description of the addon exclusive to this subscription. This will be displayed in place of the addon name in invoices generated for this subscription.
quantity
integer
Required quantity of the chosen addon.
tags
array
Show Sub-Attributes arrow
tag_id
long
ID of the Tag
tag_option_id
long
Id of the Tag Option
item_custom_fields
array
Custom fields for a item.
Show Sub-Attributes arrow
label
string
Label of the Custom Field
value
string
Value of the Custom Field
price
double
A value can be provided here if the per unit addon price has to be overridden for this subscription.
discount
Discount applied for the addon.
total
Total amount for the addon.
tax_id
Unique ID of the tax applied for the addon.
coupon
object
The object containing the details of the added coupon. coupon_code and discount_amount applied to the invoice total.
Show Sub-Attributes arrow
coupon_code
string
The coupon code of the coupon which is to be applied to the subscription.
discount_amount
double
The discount amount included in an invoice on applying a coupon.
card
object
Customer's card object. This contains payment_gateway, last_four_digits, expiry_month and expiry_year.
Show Sub-Attributes arrow
card_id
Customer's card ID.
last_four_digits
integer
Last four digits of the customer's card.
payment_gateway
string
Payment gateway through which payment needs to be made. Supported payment gateway values test_gateway, payflow_pro, stripe, 2checkout, authorize_net, payments_pro, forte, worldpay, wepay.
expiry_month
integer
Expiry month of the customer's card.
expiry_year
integer
Expiry year of the customer's card.
payment_terms
integer
Payment Due details for the invoices.
payment_terms_label
string
Label for the paymet due details.
can_add_bank_account
boolean
Set to true if Bank account can be added for the customer to perform ACH transactions.
customer
object
Customer object of the customer for whom you want to create a subscription. Each object contains display_name, company_name, first_name, last_name, email, fax, currency_code and billing_address.
Show Sub-Attributes arrow
customer_id
A unique ID generated by the server. This can be used as an identifier.
display_name
string
This will be name which will be displayed in the interface and invoices.
salutation
string
Salutation of the customer.
first_name
string
First name of the customer.
last_name
string
Last name of the customer.
email
string
Email address of the customer.
company_name
string
Registered name of the company the customer represents.
billing_address
object
Customer's billing address object. It contains attention, street, city, state,zip, country and fax.
Show Sub-Attributes arrow
attention
string
Attention of the customer's billing address.
street
string
Street of the customer's billing address.
city
string
City of the customer's billing address.
state
string
State of the customer's billing address.
country
string
Country of the customer's billing address.
zip
string
Zip code of the customer's billing address.
fax
string
Fax number for the customer's billing address.
shipping_address
object
Customer's shipping address object. It contains attention, street, city, state,zip, country and fax.
Show Sub-Attributes arrow
attention
string
Attention of the customer’s shipping address.
street
string
Street of the customer’s shipping address.
city
string
City of the customer’s shipping address.
state
string
State of the customer’s shipping address.
zip
string
Zip code of the customer’s shipping address.
country
string
Country of the customer’s shipping address.
fax
string
Fax number of the customer’s shipping address.
payment_terms
integer
Payment Due details for the invoices.
payment_terms_label
string
Label for the paymet due details.
custom_fields
array
Additional fields for the invoices.
Show Sub-Attributes arrow
index
integer
Index of the custom field. It can hold any value from 1 to 10.
label
string
Label of the Custom Field
value
string
Value of the Custom Field
data_type
string
Data type of the custom field.
taxes
array
Taxes associated wit the subscription.
Show Sub-Attributes arrow
tax_id
string
Unique ID of the tax or tax group that can be collected from the contact. Tax can be given only if is_taxable is true.
tax_name
string
Name of the tax to which subscription is associated.
tax_amount
string
Tax amount applied to the subscription.
contactpersons
array
List of contact person objects. Each object contains contactperson_id.
Show Sub-Attributes arrow
contactperson_id
string
Contact person ID of the customer’s contact person.
notes
array
List of objects containing note_id, description, commented_by and commented_time
Show Sub-Attributes arrow
note_id
string
Unique ID generated for a note.
description
string
Comments about the subscription made by the user.
commented_by
string
Name of the user who added the comment.
commented_time
string
Time at which the comment was added.
payment_gateways
array
List of payment gateways configured for the customer.
Show Sub-Attributes arrow
payment_gateway
Payment gateway associated with the subscription.Supported payment gateway values test_gateway, payflow_pro, stripe, 2checkout, authorize_net, payments_pro, forte, worldpay, wepay.
unbilled_charge_id
string
A unique ID if the subscription has any unbilled charges for the duration.
can_charge_setup_fee_immediately
boolean
If set to "true", a separate invoice will be raised for the setup fee as soon as the subscription's trial period starts. Set the value as "false", or remove this optional argument if you want the setup fee to be billed at the end of the trial period, along with the other subscription related charges.

Example

{ "subscription_id": "90300000079200", "name": "GatorHost-Basic", "status": "live", "amount": 50, "created_at": "2016-06-11", "activated_at": "2016-06-15", "current_term_starts_at": "2016-06-05", "current_term_ends_at": "2016-06-05", "last_billing_at": "2016-06-05", "next_billing_at": "2016-06-30", "expires_at": "2016-06-05", "interval": 1, "interval_unit": "months", "auto_collect": true, "created_time": "2016-06-11T17:57:13-0700", "updated_time": "2016-06-04T16:44:15-0700", "reference_id": "bowmanfurniture", "place_of_supply": "TN", "salesperson_id": "903000000058001", "salesperson_name": "Franklin", "child_invoice_id": "90300000079210", "currency_code": "USD", "currency_symbol": "$", "end_of_term": false, "product_id": "90300000079065", "product_name": "Bowman Furniture", "plan": { "plan_code": "basic-monthly", "name": "GatorHost-Basic", "quantity": 1, "price": 50, "tags": [ { "tag_id": 0, "tag_option_id": 0 } ], "item_custom_fields": [ { "label": "string", "value": "string" } ], "discount": 20, "total": 50, "setup_fee": 20, "plan_description": "Monthly Basic plan", "tax_id": "903000002345", "trial_days": 0 }, "addons": [ { "addon_code": "Email-basic", "name": "Monthly Addon", "addon_description": "Monthly addon.", "quantity": 1, "tags": [ { "tag_id": 0, "tag_option_id": 0 } ], "item_custom_fields": [ { "label": "string", "value": "string" } ], "price": 50, "discount": null, "total": null, "tax_id": null } ], "coupon": { "coupon_code": "Flat10", "discount_amount": 44 }, "card": { "card_id": "9030000079226", "last_four_digits": 2145, "payment_gateway": "payflow_pro", "expiry_month": 9, "expiry_year": 2030 }, "payment_terms": 0, "payment_terms_label": "Due On Receipt", "can_add_bank_account": true, "customer": { "customer_id": "903000000000099", "display_name": "Bowman Furniture", "salutation": "Mr.", "first_name": "Benjamin", "last_name": "George", "email": "benjamin.george@bowmanfurniture.com", "company_name": "Bowman Furniture", "billing_address": { "attention": "Benjamin George", "street": "Harrington Bay Street", "city": "Salt Lake City", "state": "CA", "country": "U.S.A", "zip": 92612, "fax": 4527389 }, "shipping_address": { "attention": "Benjamin George", "street": "Harrington Bay Street", "city": "Salt Lake City", "state": "CA", "zip": 92612, "country": "U.S.A", "fax": 4527389 }, "payment_terms": 0, "payment_terms_label": "Due On Receipt" }, "custom_fields": [ { "index": 1, "label": "string", "value": "string", "data_type": "text" } ], "taxes": [ { "tax_id": "903000002345", "tax_name": "GST", "tax_amount": "2.50" } ], "contactpersons": [ { "contactperson_id": "903000000000099" } ], "notes": [ { "note_id": "903000076543", "description": "", "commented_by": "Benjamin", "commented_time": "2016-06-11T17:57:13-0700" } ], "payment_gateways": [ { "payment_gateway": null } ], "unbilled_charge_id": "903000000000099", "can_charge_setup_fee_immediately": false }

Create a subscription

Create a new subscription. To create a subscription for a new customer, you have to pass the customer object. To create a subscription for a existing customer pass the customer_id of that customer.
OAuth Scope : ZohoSubscriptions.subscriptions.CREATE

Arguments

add_to_unbilled_charges
boolean
When the value is given as true, the subscription would be created and charges for the current billing cycle will be put as unbilled. This can be converted to invoice at any later point of time.
customer
object
(Required) for creating a subscription for new customer.
Customer object of the customer for whom you want to create a subscription. Each object contains display_name, company_name, first_name, last_name, email, fax, currency_code and billing_address.
Show Sub-Attributes arrow
display_name
string
(Required)
This will be name which will be displayed in the interface and invoices.
salutation
string
Salutation of the customer.
first_name
string
First name of the customer.
last_name
string
Last name of the customer.
email
string
(Required)
Email address of the customer.
company_name
string
Registered name of the company the customer represents.
billing_address
object
Customer's billing address object. It contains attention, street, city, state,zip, country and fax.
Show Sub-Attributes arrow
attention
string
Attention of the customer's billing address.
street
string
Street of the customer's billing address.
city
string
City of the customer's billing address.
state
string
State of the customer's billing address.
country
string
Country of the customer's billing address.
zip
string
Zip code of the customer's billing address.
fax
string
Fax number for the customer's billing address.
shipping_address
object
Customer's shipping address object. It contains attention, street, city, state,zip, country and fax.
Show Sub-Attributes arrow
attention
string
Attention of the customer’s shipping address.
street
string
Street of the customer’s shipping address.
city
string
City of the customer’s shipping address.
state
string
State of the customer’s shipping address.
zip
string
Zip code of the customer’s shipping address.
country
string
Country of the customer’s shipping address.
fax
string
Fax number of the customer’s shipping address.
payment_terms
integer
Payment Due details for the invoices.
payment_terms_label
string
Label for the paymet due details.
custom_fields
array
Additional fields for the invoices.
Show Sub-Attributes arrow
label
string
(Required)
Label of the Custom Field
value
string
(Required)
Value of the Custom Field
place_of_contact
string
India GST only
Customer's place of contact.
gst_no
string
India GST only
GSTIN Number for the customer.
gst_treatment
string
India GST only
GST Treatment for the customer.
Allowed values for gst_treatment :
business_gst, business_none, consumer, overseas
business_gst - For a GST Registered business owner.
business_none - For a GST unregistered business owner.
consumer - For a consumer.
overseas - Customer for whom you export your goods/services.
vat_treatment
string
VAT only
(Optional) VAT treatment for the invoices. VAT treatment denotes the location of the customer, if the customer resides in UK then the VAT treatment is uk. If the customer is in an EU country & VAT registered, you are resides in Northen Ireland and selling Goods then his VAT treatment is eu_vat_registered, if he resides outside of the UK then his VAT treatment is overseas (For Pre Brexit, this can be split as eu_vat_registered, eu_vat_not_registered and non_eu).
vat_reg_no
string
VAT only
VAT Registration number of a contact with length should be between 2 and 12 characters.
country_code
string
VAT only
Two letter country code of a contact with VAT treatment as eu_vat_registered. (This node is only available for EU VAT registered customers.)
is_taxable
string
Sales Tax , GST only
Set to true if customer's transactions must be tax inclusive.
tax_id
string
Unique ID of the tax or tax group that can be collected from the contact. Tax can be given only if is_taxable is true.
tax_authority_id
string
(Required) for applying Tax exemption to a customer.
Sales Tax only
Unique ID of the tax authority. Tax authority depends on the location of the customer. For example, if the customer is located in NY, then the tax authority is NY tax authority.
tax_authority_name
string
(Required) for applying Tax exemption to a customer.
Sales Tax only
Unique name of the tax authority. Either tax_authority_id or tax_authority_name can be given.
tax_exemption_id
string
Sales Tax , GST only
Unique ID of the tax exemption.
tax_exemption_code
string
Sales Tax , GST only
Unique code of the tax exemption.
customer_id
(Required) for creating a subscription for existing customer.
Customer ID of the customer for whom a subscription needs to be created.
payment_terms
integer
Payment Due details for the invoices.
payment_terms_label
string
Label for the paymet due details.
custom_fields
array
Additional fields for the invoices.
Show Sub-Attributes arrow
label
string
Label of the Custom Field
value
string
Value of the Custom Field
contactpersons
array
List of contact person objects. Each object contains contactperson_id.
Show Sub-Attributes arrow
contactperson_id
string
(Required)
Contact person ID of the customer’s contact person.
card_id
(Required) if auto_collect is true
Enter the card_id of the card which has to be updated.
starts_at
string
Generally the subscription will start on the day it is created. But, the date can also be a future or past date depending upon your usecase. For future dates, the subscription status would be Future till the starts_at date. And for past dates, the subscription status can be Trial, Live or Expired depending on the subscription interval that you have selected.
exchange_rate
double
, default is the exchange rate provided in settings.
This will be the exchange rate provided for the organization's currency and the customer's currency. The subscription fee would be the multiplicative product of the original price and the exchange rate.
place_of_supply
string
India GST only
Place of Supply for the customer's subscription.
plan
object
(Required)
Plan object for which the subscription is to be created. This contains plan_code, name, price, quantity.
Show Sub-Attributes arrow
plan_code
string
(Required)
Plan code of the plan that is to be subscribed to the customer.
plan_description
string
Description of the plan exclusive to this subscription. This will be displayed in place of the plan name in invoices generated for this subscription.
price
double
Price of a plan for a particular subscription. If a value is provided here, the plan’s price for this subscription will be changed to the given value. If no value is provided, the plan’s price would be the same as what it was when it was created.
setup_fee
double
, default is 0 only if exclude_setup_fee is true
Setup fee for the plan.
setup_fee_tax_id
string
Unique ID for tax of setup fee. setup_fee_tax_id must be empty for applying tax Exemption.
tags
array
Show Sub-Attributes arrow
tag_id
long
ID of the Tag
tag_option_id
long
Id of the Tag Option
item_custom_fields
array
Custom fields for a item.
Show Sub-Attributes arrow
label
string
Label of the Custom Field
value
string
Value of the Custom Field
quantity
integer
Required quantity of the chosen plan.
tax_id
(Required) for applying tax or tax exemption to a plan
Unique ID of Tax or Tax Group that must be associated with the plan. tax_id must be empty for applying tax Exemption.
tax_exemption_id
string
Sales Tax , GST only
Unique ID of the tax exemption.
tax_exemption_code
string
Sales Tax , GST only
Unique code of the tax exemption.
tds_tax_id
string
🇲🇽 Mexico
only
ID of the TDS tax.
sat_item_key_code
string
🇲🇽 Mexico
only
Add SAT Item Key Code for your goods/services. Download the CFDI Catalogs.
unitkey_code
string
🇲🇽 Mexico
only
Add SAT Unit Key Code for your goods/services. Download the CFDI Catalogs.
setup_fee_tax_exemption_id
string
Sales Tax , GST only
Unique Tax Exemption ID that must be applied to setup fee.
setup_fee_tax_exemption_code
string
Sales Tax , GST only
Unique code of the tax exemption that must be applied to setup fee.
exclude_trial
boolean
This is set to true if the respective plan's trial period needs to be excluded for this subscription.
exclude_setup_fee
boolean
This is set to true if the respective plan's setup fee needs to be excluded for this subscription.
billing_cycles
integer
billing_cycles specified at the time of creation of the plan would be the default value. If this needs to be overridden for this particular subscription, a value can be provided here.
trial_days
integer
, default is 0 only if exclude_trial is true
Number of free trial days granted to a customer subscribed to this plan. Trial days for the subscription mentioned here will override the number of trial days provided at the time plan creation. This will be applicable even if exclude_trial=true.
addons
array
List of addon objects which are to be included in the subscription. Each object contains addon_code, name, price and quantity.
Show Sub-Attributes arrow
addon_code
string
(Required)
Addon code of the addon.
addon_description
string
Description of the addon exclusive to this subscription. This will be displayed in place of the addon name in invoices generated for this subscription.
price
double
Price of a plan for a particular subscription. If a value is provided here, the plan’s price for this subscription will be changed to the given value. If no value is provided, the plan’s price would be the same as what it was when it was created.
quantity
Required quantity of the chosen addon.
tags
array
Show Sub-Attributes arrow
tag_id
long
ID of the Tag
tag_option_id
long
Id of the Tag Option
item_custom_fields
array
Custom fields for a item.
Show Sub-Attributes arrow
label
string
Label of the Custom Field
value
string
Value of the Custom Field
tax_id
(Required) for applying tax or tax exemption to a addon
Unique ID of Tax or Tax Group that must be associated with the addon. tax_id must be empty for applying tax Exemption.
tax_exemption_id
string
Sales Tax , GST only
Unique ID of the tax exemption.
tax_exemption_code
string
Sales Tax , GST only
Unique code of the tax exemption.
tds_tax_id
string
🇲🇽 Mexico
only
ID of the TDS tax.
sat_item_key_code
string
🇲🇽 Mexico
only
Add SAT Item Key Code for your goods/services. Download the CFDI Catalogs.
unitkey_code
string
🇲🇽 Mexico
only
Add SAT Unit Key Code for your goods/services. Download the CFDI Catalogs.
coupon_code
string
The coupon code of the coupon which is to be applied to the subscription.
auto_collect
boolean
auto_collect is set to true for creating an online subscription which will charge the customer’s card automatically on every renewal. To create an offline subscriptions, set auto_collect to false.
reference_id
string
A string of your choice is required to easily identify and keep track of your subscriptions.
salesperson_name
string
Name of the sales person assigned for the subscription.
payment_gateways
array
List of payment gateways configured for the customer.
Show Sub-Attributes arrow
payment_gateway
Payment gateway associated with the subscription.Supported payment gateway values test_gateway, payflow_pro, stripe, 2checkout, authorize_net, payments_pro, forte, worldpay, wepay.
create_backdated_invoice
boolean
To allow creation of invoice for current billing cycle for back dated subscriptions.
can_charge_setup_fee_immediately
boolean
If set to "true", a separate invoice will be raised for the setup fee as soon as the subscription's trial period starts. Set the value as "false", or remove this optional argument if you want the setup fee to be billed at the end of the trial period, along with the other subscription related charges.
template_id
string
Defaulte Invoice Template ID for all the invoices created from the subscription.
cfdi_usage
string
🇲🇽 Mexico
only
Choose CFDI Usage. Allowed values:
acquisition_of_merchandise, return_discount_bonus, general_expense, buildings, furniture_office_equipment, transport_equipment, computer_equipmentdye_molds_tools, telephone_communication, satellite_communication, other_machinery_equipment, hospital_expense, medical_expense_disability, funeral_expense, donation, interest_mortage_loans, contribution_sar, medical_expense_insurance_pormium, school_transportation_expense, deposit_saving_account, payment_educational_service, no_tax_effect, payment, payroll.
allow_partial_payments
boolean
🇲🇽 Mexico
only
Boolean to check if partial payments are allowed for the contact
account_id
string
(Required) if auto_collect node is true and any other payment method is not specified
Account ID of the bank account from which payment is made by the customer.

Request Example

Click to copy
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/subscriptions" 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/subscriptions") .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/subscriptions', 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/subscriptions", 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/subscriptions", "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/subscriptions \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'X-com-zoho-subscriptions-organizationid: 10234695' \ --header 'content-type: application/json' \ --data '{"field1":"value1","field2":"value2"}'

Body Parameters

Click to copy
{ "add_to_unbilled_charges": true, "customer": { "display_name": "Bowman Furniture", "salutation": "Mr.", "first_name": "Benjamin", "last_name": "George", "email": "benjamin.george@bowmanfurniture.com", "company_name": "Bowman Furniture", "billing_address": { "attention": "Benjamin George", "street": "Harrington Bay Street", "city": "Salt Lake City", "state": "CA", "country": "U.S.A", "zip": 92612, "fax": 4527389 }, "shipping_address": { "attention": "Benjamin George", "street": "Harrington Bay Street", "city": "Salt Lake City", "state": "CA", "zip": 92612, "country": "U.S.A", "fax": 4527389 }, "payment_terms": 0, "payment_terms_label": "Due On Receipt", "custom_fields": [ { "label": "string", "value": "string" } ], "place_of_contact": "TN", "gst_no": "33AAAAA0000A1Z5", "gst_treatment": "business_gst", "vat_treatment": "overseas", "vat_reg_no": 51423456782, "country_code": "DE", "is_taxable": true, "tax_id": "903000002345", "tax_authority_id": "903000006345", "tax_authority_name": "ATO", "tax_exemption_id": "903000006345", "tax_exemption_code": "GST FREE" }, "customer_id": null, "payment_terms": 0, "payment_terms_label": "Due On Receipt", "custom_fields": [ { "label": "string", "value": "string" } ], "contactpersons": [ { "contactperson_id": "903000000000099" } ], "card_id": "9030000079226", "starts_at": "2016-06-05", "exchange_rate": 2, "place_of_supply": "TN", "plan": { "plan_code": "basic-monthly", "plan_description": "Monthly Basic plan", "price": 50, "setup_fee": 20, "setup_fee_tax_id": "9030000123123", "tags": [ { "tag_id": 0, "tag_option_id": 0 } ], "item_custom_fields": [ { "label": "string", "value": "string" } ], "quantity": 1, "tax_id": null, "tax_exemption_id": "903000006345", "tax_exemption_code": "GST FREE", "tds_tax_id": 982000000557012, "sat_item_key_code": 71121206, "unitkey_code": "E48", "setup_fee_tax_exemption_id": "9030000123098", "setup_fee_tax_exemption_code": "GST FREE", "exclude_trial": false, "exclude_setup_fee": false, "billing_cycles": -1, "trial_days": 0 }, "addons": [ { "addon_code": "Email-basic", "addon_description": "Monthly addon.", "price": 50, "quantity": null, "tags": [ { "tag_id": 0, "tag_option_id": 0 } ], "item_custom_fields": [ { "label": "string", "value": "string" } ], "tax_id": null, "tax_exemption_id": "903000006345", "tax_exemption_code": "GST FREE", "tds_tax_id": 982000000557012, "sat_item_key_code": 71121206, "unitkey_code": "E48" } ], "coupon_code": "Flat10", "auto_collect": true, "reference_id": "bowmanfurniture", "salesperson_name": "Franklin", "payment_gateways": [ { "payment_gateway": null } ], "create_backdated_invoice": true, "can_charge_setup_fee_immediately": false, "template_id": 903000000063009, "cfdi_usage": "acquisition_of_merchandise", "allow_partial_payments": true, "account_id": "90300000792007" }

Response Example

{ "code": 0, "message": "Subscription has been created successfully.", "subscription": { "subscription_id": "90300000079200", "name": "GatorHost-Basic", "status": "live", "amount": 50, "created_at": "2016-06-11", "activated_at": "2016-06-15", "current_term_starts_at": "2016-06-05", "current_term_ends_at": "2016-06-05", "last_billing_at": "2016-06-05", "next_billing_at": "2016-06-30", "expires_at": "2016-06-05", "interval": 1, "interval_unit": "months", "auto_collect": true, "created_time": "2016-06-11T17:57:13-0700", "updated_time": "2016-06-04T16:44:15-0700", "reference_id": "bowmanfurniture", "place_of_supply": "TN", "salesperson_id": "903000000058001", "salesperson_name": "Franklin", "child_invoice_id": "90300000079210", "currency_code": "USD", "currency_symbol": "$", "end_of_term": false, "product_id": "90300000079065", "product_name": "Bowman Furniture", "plan": { "plan_code": "basic-monthly", "name": "GatorHost-Basic", "quantity": 1, "price": 50, "tags": [ { "tag_id": 0, "tag_option_id": 0 } ], "item_custom_fields": [ { "label": "string", "value": "string" } ], "discount": 20, "total": 50, "setup_fee": 20, "plan_description": "Monthly Basic plan", "tax_id": "903000002345", "trial_days": 0 }, "addons": [ { "addon_code": "Email-basic", "name": "Monthly Addon", "addon_description": "Monthly addon.", "quantity": 1, "tags": [ { "tag_id": 0, "tag_option_id": 0 } ], "item_custom_fields": [ { "label": "string", "value": "string" } ], "price": 50, "discount": null, "total": null, "tax_id": null } ], "coupon": { "coupon_code": "Flat10", "discount_amount": 44 }, "card": { "card_id": "9030000079226", "last_four_digits": 2145, "payment_gateway": "payflow_pro", "expiry_month": 9, "expiry_year": 2030 }, "payment_terms": 0, "payment_terms_label": "Due On Receipt", "can_add_bank_account": true, "customer": { "customer_id": "903000000000099", "display_name": "Bowman Furniture", "salutation": "Mr.", "first_name": "Benjamin", "last_name": "George", "email": "benjamin.george@bowmanfurniture.com", "company_name": "Bowman Furniture", "billing_address": { "attention": "Benjamin George", "street": "Harrington Bay Street", "city": "Salt Lake City", "state": "CA", "country": "U.S.A", "zip": 92612, "fax": 4527389 }, "shipping_address": { "attention": "Benjamin George", "street": "Harrington Bay Street", "city": "Salt Lake City", "state": "CA", "zip": 92612, "country": "U.S.A", "fax": 4527389 }, "payment_terms": 0, "payment_terms_label": "Due On Receipt" }, "custom_fields": [ { "index": 1, "label": "string", "value": "string", "data_type": "text" } ], "taxes": [ { "tax_id": "903000002345", "tax_name": "GST", "tax_amount": "2.50" } ], "contactpersons": [ { "contactperson_id": "903000000000099" } ], "notes": [ { "note_id": "903000076543", "description": "", "commented_by": "Benjamin", "commented_time": "2016-06-11T17:57:13-0700" } ], "payment_gateways": [ { "payment_gateway": null } ], "unbilled_charge_id": "903000000000099", "can_charge_setup_fee_immediately": false } }

List all subscriptions

List of subscriptions that match the given subscription status.

To list the subscriptions of a particular customer append a param customer_id={customer_id}.

To list subscriptions based on Reference#, append the param reference_contains={reference_value}.
OAuth Scope : ZohoSubscriptions.subscriptions.READ

Query Parameters

filter_by
The possible values for SubscriptionStatus are All, ACTIVE, LIVE, FUTURE, TRIAL, PAST_DUE, UNPAID, NON_RENEWING, CANCELLED_FROM_DUNNING, CANCELLED, EXPIRED, TRIAL_EXPIRED, CANCELLED_LAST_MONTH, CANCELLED_THIS_MONTH.

To list subscriptions based on Online/Offline, pass the filter_by param value as SubscriptionMode.ONLINE or SubscriptionMode.OFFLINE.

Request Example

Click to copy
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/subscriptions" 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/subscriptions") .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/subscriptions', 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/subscriptions", 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/subscriptions", "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/subscriptions \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'X-com-zoho-subscriptions-organizationid: 10234695'

Response Example

{ "code": 0, "message": "success", "subscriptions": [ { "customer_id": "903000000000099", "customer_name": "Benjamin", "email": "benjamin.george@bowmanfurniture.com", "plan_name": "Basic Monthly", "subscription_id": "90300000079200", "name": "GatorHost-Basic", "status": "live", "amount": 50, "created_at": "2016-06-11", "activated_at": "2016-06-15", "current_term_ends_at": "2016-06-05", "current_term_starts_at": "2016-06-05", "last_billing_at": "2016-06-05", "next_billing_at": "2016-06-30", "expires_at": "2016-06-05", "interval": 1, "interval_unit": "months", "auto_collect": true, "created_time": "2016-06-11T17:57:13-0700", "updated_time": "2016-06-04T16:44:15-0700", "reference_id": "bowmanfurniture", "salesperson_id": "903000000058001", "salesperson_name": "Franklin", "currency_code": "USD", "currency_symbol": "$" }, {...}, {...} ] }

Update a subscription

Update details of an existing subscription.
OAuth Scope : ZohoSubscriptions.subscriptions.UPDATE

Arguments

card_id
(Required) if auto_collect is true.
Enter the card_id of the card which has to be updated.
exchange_rate
double
, default is the exchange rate provided in settings.
This will be the exchange rate provided for the organization's currency and the customer's currency. The subscription fee would be the multiplicative product of the original price and the exchange rate.
plan
object
(Required)
Plan object for which the subscription is to be created. This contains plan_code, name, price, quantity.
Show Sub-Attributes arrow
plan_code
string
(Required)
Plan code of the plan that is to be subscribed to the customer.
plan_description
string
Description of the plan exclusive to this subscription. This will be displayed in place of the plan name in invoices generated for this subscription.
price
double
Price of a plan for a particular subscription. If a value is provided here, the plan’s price for this subscription will be changed to the given value. If no value is provided, the plan’s price would be the same as what it was when it was created.
setup_fee
double
, default is 0 only if exclude_setup_fee is true
Setup fee for the plan.
quantity
integer
Required quantity of the chosen plan.
tags
array
Show Sub-Attributes arrow
tag_id
long
ID of the Tag
tag_option_id
long
Id of the Tag Option
item_custom_fields
array
Custom fields for a item.
Show Sub-Attributes arrow
label
string
Label of the Custom Field
value
string
Value of the Custom Field
tax_id
(Required) for applying tax or tax exemption to a plan
Unique ID of Tax or Tax Group that must be associated with the plan. tax_id must be empty for applying tax Exemption.
tax_exemption_id
string
Sales Tax , GST only
Unique ID of the tax exemption.
tax_exemption_code
string
Sales Tax , GST only
Unique code of the tax exemption.
tds_tax_id
string
🇲🇽 Mexico
only
ID of the TDS tax.
sat_item_key_code
string
🇲🇽 Mexico
only
Add SAT Item Key Code for your goods/services. Download the CFDI Catalogs.
unitkey_code
string
🇲🇽 Mexico
only
Add SAT Unit Key Code for your goods/services. Download the CFDI Catalogs.
setup_fee_tax_exemption_id
string
Sales Tax , GST only
Unique Tax Exemption ID that must be applied to setup fee.
setup_fee_tax_exemption_code
string
Sales Tax , GST only
Unique code of the tax exemption that must be applied to setup fee.
exclude_trial
boolean
This is set to true if the respective plan's trial period needs to be excluded for this subscription.
exclude_setup_fee
boolean
This is set to true if the respective plan's setup fee needs to be excluded for this subscription.
billing_cycles
integer
billing_cycles specified at the time of creation of the plan would be the default value. If this needs to be overridden for this particular subscription, a value can be provided here.
trial_days
integer
, default is 0 only if exclude_trial is true
Number of free trial days granted to a customer subscribed to this plan. Trial days for the subscription mentioned here will override the number of trial days provided at the time plan creation. This will be applicable even if exclude_trial=true.
addons
array
List of addon objects which are to be included in the subscription. Each object contains addon_code, name, price and quantity.
Show Sub-Attributes arrow
addon_code
string
(Required)
Addon code of the addon.
addon_description
string
Description of the addon exclusive to this subscription. This will be displayed in place of the addon name in invoices generated for this subscription.
price
double
Price of a plan for a particular subscription. If a value is provided here, the plan’s price for this subscription will be changed to the given value. If no value is provided, the plan’s price would be the same as what it was when it was created.
quantity
Required quantity of the chosen addon.
tags
array
Show Sub-Attributes arrow
tag_id
long
ID of the Tag
tag_option_id
long
Id of the Tag Option
item_custom_fields
array
Custom fields for a item.
Show Sub-Attributes arrow
label
string
Label of the Custom Field
value
string
Value of the Custom Field
tax_id
(Required) for applying tax or tax exemption to a addon
Unique ID of Tax or Tax Group that must be associated with the addon. tax_id must be empty for applying tax Exemption.
tax_exemption_id
string
Sales Tax , GST only
Unique ID of the tax exemption.
tax_exemption_code
string
Sales Tax , GST only
Unique code of the tax exemption.
tds_tax_id
string
🇲🇽 Mexico
only
ID of the TDS tax.
sat_item_key_code
string
🇲🇽 Mexico
only
Add SAT Item Key Code for your goods/services. Download the CFDI Catalogs.
unitkey_code
string
🇲🇽 Mexico
only
Add SAT Unit Key Code for your goods/services. Download the CFDI Catalogs.
auto_collect
boolean
auto_collect is set to true for creating an online subscription which will charge the customer’s card automatically on every renewal. To create an offline subscriptions, set auto_collect to false.
coupon_code
string
The coupon code of the coupon which is to be applied to the subscription.
reference_id
string
A string of your choice is required to easily identify and keep track of your subscriptions.
salesperson_id
string
Unique Id of the sales person assigned for the subscription.
salesperson_name
string
Name of the sales person assigned for the subscription.
end_of_term
boolean
If there are any changes in the plan's subscriptions, those subscription changes can be made immediately if end_of_term is set to false. If end_of_term is set to true, the subscription changes take effect only after the current term of the subscription ends.
contactpersons
array
List of contact person objects. Each object contains contactperson_id.
Show Sub-Attributes arrow
contactperson_id
string
(Required)
Contact person ID of the customer’s contact person.
payment_terms
integer
Payment Due details for the invoices.
payment_terms_label
string
Label for the paymet due details.
payment_gateways
array
List of payment gateways configured for the customer.
Show Sub-Attributes arrow
payment_gateway
Payment gateway associated with the subscription.Supported payment gateway values test_gateway, payflow_pro, stripe, 2checkout, authorize_net, payments_pro, forte, worldpay, wepay.
custom_fields
array
Additional fields for the invoices.
Show Sub-Attributes arrow
index
integer
Index of the custom field. It can hold any value from 1 to 10.
label
string
Label of the Custom Field
value
string
Value of the Custom Field
data_type
string
Data type of the custom field.
template_id
string
Defaulte Invoice Template ID for all the invoices created from the subscription.
can_charge_setup_fee_immediately
boolean
If set to "true", a separate invoice will be raised for the setup fee as soon as the subscription's trial period starts. Set the value as "false", or remove this optional argument if you want the setup fee to be billed at the end of the trial period, along with the other subscription related charges.
cfdi_usage
string
🇲🇽 Mexico
only
Choose CFDI Usage. Allowed values:
acquisition_of_merchandise, return_discount_bonus, general_expense, buildings, furniture_office_equipment, transport_equipment, computer_equipmentdye_molds_tools, telephone_communication, satellite_communication, other_machinery_equipment, hospital_expense, medical_expense_disability, funeral_expense, donation, interest_mortage_loans, contribution_sar, medical_expense_insurance_pormium, school_transportation_expense, deposit_saving_account, payment_educational_service, no_tax_effect, payment, payroll.
allow_partial_payments
boolean
🇲🇽 Mexico
only
Boolean to check if partial payments are allowed for the contact
customer_id
string
(Required)
Customer ID of the customer for whom a subscription needs to be created.
account_id
string
(Required) if auto_collect node is true and any other payment method is not specified
Account ID of the bank account from which payment is made by the customer.

Request Example

Click to copy
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/subscriptions/90300000079200" 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/subscriptions/90300000079200") .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/subscriptions/90300000079200', 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/subscriptions/90300000079200", 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/subscriptions/90300000079200", "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/subscriptions/90300000079200 \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'X-com-zoho-subscriptions-organizationid: 10234695' \ --header 'content-type: application/json' \ --data '{"field1":"value1","field2":"value2"}'

Body Parameters

Click to copy
{ "card_id": "9030000079226", "exchange_rate": 2, "plan": { "plan_code": "basic-monthly", "plan_description": "Monthly Basic plan", "price": 50, "setup_fee": 20, "quantity": 1, "tags": [ { "tag_id": 0, "tag_option_id": 0 } ], "item_custom_fields": [ { "label": "string", "value": "string" } ], "tax_id": null, "tax_exemption_id": "903000006345", "tax_exemption_code": "GST FREE", "tds_tax_id": 982000000557012, "sat_item_key_code": 71121206, "unitkey_code": "E48", "setup_fee_tax_exemption_id": "9030000123098", "setup_fee_tax_exemption_code": "GST FREE", "exclude_trial": false, "exclude_setup_fee": false, "billing_cycles": -1, "trial_days": 0 }, "addons": [ { "addon_code": "Email-basic", "addon_description": "Monthly addon.", "price": 50, "quantity": null, "tags": [ { "tag_id": 0, "tag_option_id": 0 } ], "item_custom_fields": [ { "label": "string", "value": "string" } ], "tax_id": null, "tax_exemption_id": "903000006345", "tax_exemption_code": "GST FREE", "tds_tax_id": 982000000557012, "sat_item_key_code": 71121206, "unitkey_code": "E48" } ], "auto_collect": true, "coupon_code": "Flat10", "reference_id": "bowmanfurniture", "salesperson_id": "903000000058001", "salesperson_name": "Franklin", "end_of_term": false, "contactpersons": [ { "contactperson_id": "903000000000099" } ], "payment_terms": 0, "payment_terms_label": "Due On Receipt", "payment_gateways": [ { "payment_gateway": null } ], "custom_fields": [ { "index": 1, "label": "string", "value": "string", "data_type": "text" } ], "template_id": 903000000063009, "can_charge_setup_fee_immediately": false, "cfdi_usage": "acquisition_of_merchandise", "allow_partial_payments": true, "customer_id": "903000000000099", "account_id": "90300000792007" }

Response Example

{ "code": 0, "message": "Subscription has been updated successfully.", "subscription": { "subscription_id": "90300000079200", "name": "GatorHost-Basic", "status": "live", "amount": 50, "created_at": "2016-06-11", "activated_at": "2016-06-15", "current_term_starts_at": "2016-06-05", "current_term_ends_at": "2016-06-05", "last_billing_at": "2016-06-05", "next_billing_at": "2016-06-30", "expires_at": "2016-06-05", "interval": 1, "interval_unit": "months", "auto_collect": true, "created_time": "2016-06-11T17:57:13-0700", "updated_time": "2016-06-04T16:44:15-0700", "reference_id": "bowmanfurniture", "salesperson_id": "903000000058001", "salesperson_name": "Franklin", "child_invoice_id": "90300000079210", "currency_code": "USD", "currency_symbol": "$", "end_of_term": false, "product_id": "90300000079065", "product_name": "Bowman Furniture", "plan": { "plan_code": "basic-monthly", "name": "GatorHost-Basic", "quantity": 1, "price": 50, "tags": [ { "tag_id": 0, "tag_option_id": 0 } ], "item_custom_fields": [ { "label": "string", "value": "string" } ], "discount": 20, "total": 50, "setup_fee": 20, "plan_description": "Monthly Basic plan", "tax_id": "903000002345", "trial_days": 0 }, "addons": [ { "addon_code": "Email-basic", "name": "Monthly Addon", "addon_description": "Monthly addon.", "quantity": 1, "tags": [ { "tag_id": 0, "tag_option_id": 0 } ], "item_custom_fields": [ { "label": "string", "value": "string" } ], "price": 10, "discount": null, "total": null, "tax_id": null } ], "coupon": { "coupon_code": "Flat10", "discount_amount": 44 }, "card": { "card_id": "90300000079226", "last_four_digits": 2145, "payment_gateway": "payflow_pro", "expiry_month": 9, "expiry_year": 2030 }, "payment_terms": 0, "payment_terms_label": "Due On Receipt", "can_add_bank_account": true, "customer": { "display_name": "Bowman Furniture", "salutation": "Mr.", "first_name": "Benjamin", "last_name": "George", "email": "benjamin.george@bowmanfurniture.com", "company_name": "Bowman Furniture", "billing_address": { "attention": "Benjamin George", "street": "Harrington Bay Street", "city": "Salt Lake City", "state": "CA", "country": "U.S.A", "zip": 92612, "fax": 4527389 }, "shipping_address": { "attention": "Benjamin George", "street": "Harrington Bay Street", "city": "Salt Lake City", "state": "CA", "zip": 92612, "country": "U.S.A", "fax": 4527389 }, "payment_terms": 0, "payment_terms_label": "Due On Receipt" }, "custom_fields": [ { "index": 1, "label": "string", "value": "string", "data_type": "text" } ], "taxes": [ { "tax_id": "903000002345", "tax_name": "GST", "tax_amount": "2.50" } ], "contactpersons": [ { "contactperson_id": "903000000000099" } ], "notes": [ { "note_id": "903000076543", "description": "", "commented_by": "Benjamin", "commented_time": "2016-06-11T17:57:13-0700" } ], "payment_gateways": [ { "payment_gateway": null } ], "can_charge_setup_fee_immediately": false } }

Retrieve a subscription

Details of an existing subscription.
OAuth Scope : ZohoSubscriptions.subscriptions.READ

Request Example

Click to copy
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/subscriptions/90300000079200" 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/subscriptions/90300000079200") .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/subscriptions/90300000079200', 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/subscriptions/90300000079200", 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/subscriptions/90300000079200", "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/subscriptions/90300000079200 \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'X-com-zoho-subscriptions-organizationid: 10234695'

Response Example

{ "code": 0, "message": "success", "subscription": { "subscription_id": "90300000079200", "unbilled_charge_id": "903000000000099", "name": "GatorHost-Basic", "status": "live", "amount": 50, "created_at": "2016-06-11", "activated_at": "2016-06-15", "current_term_starts_at": "2016-06-05", "current_term_ends_at": "2016-06-05", "last_billing_at": "2016-06-05", "next_billing_at": "2016-06-30", "expires_at": "2016-06-05", "interval": 1, "interval_unit": "months", "auto_collect": true, "created_time": "2016-06-11T17:57:13-0700", "updated_time": "2016-06-04T16:44:15-0700", "reference_id": "bowmanfurniture", "salesperson_id": "903000000058001", "salesperson_name": "Franklin", "child_invoice_id": "90300000079210", "currency_code": "USD", "currency_symbol": "$", "end_of_term": false, "product_id": "90300000079065", "product_name": "Bowman Furniture", "plan": { "plan_code": "basic-monthly", "name": "GatorHost-Basic", "quantity": 1, "item_custom_fields": [ { "label": "string", "value": "string" } ], "price": 50, "tags": [ { "tag_id": 0, "tag_option_id": 0 } ], "discount": 20, "total": 50, "setup_fee": 20, "plan_description": "Monthly Basic plan", "tax_id": "903000002345", "trial_days": 0 }, "addons": [ { "addon_code": "Email-basic", "name": "Monthly Addon", "addon_description": "Monthly addon.", "quantity": 1, "tags": [ { "tag_id": 0, "tag_option_id": 0 } ], "item_custom_fields": [ { "label": "string", "value": "string" } ], "price": 10, "discount": null, "total": null, "tax_id": null } ], "coupon": { "coupon_code": "Flat10", "discount_amount": 44 }, "card": { "card_id": "90300000079226", "last_four_digits": 2145, "payment_gateway": "payflow_pro", "expiry_month": 9, "expiry_year": 2030 }, "payment_terms": 0, "payment_terms_label": "Due On Receipt", "can_add_bank_account": true, "customer": { "customer_id": "903000000000099", "display_name": "Bowman Furniture", "first_name": "Benjamin", "last_name": "George", "email": "benjamin.george@bowmanfurniture.com", "company_name": "Bowman Furniture", "billing_address": { "attention": "Benjamin George", "street": "Harrington Bay Street", "city": "Salt Lake City", "state": "CA", "country": "U.S.A", "zip": 92612, "fax": 4527389 }, "shipping_address": { "attention": "Benjamin George", "street": "Harrington Bay Street", "city": "Salt Lake City", "state": "CA", "zip": 92612, "country": "U.S.A", "fax": 4527389 }, "payment_terms": 0, "payment_terms_label": "Due On Receipt" }, "custom_fields": [ { "index": 1, "label": "string", "value": "string", "data_type": "text" } ], "taxes": [ { "tax_id": "903000002345", "tax_name": "GST", "tax_amount": "2.50" } ], "contactpersons": [ { "contactperson_id": "903000000000099" } ], "notes": [ { "note_id": "903000076543", "description": "", "commented_by": "Benjamin", "commented_time": "2016-06-11T17:57:13-0700" } ], "payment_gateways": [ { "payment_gateway": null } ] } }

Delete a subscription

Delete an existing subscription.
OAuth Scope : ZohoSubscriptions.subscriptions.DELETE

Request Example

Click to copy
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/subscriptions/90300000079200" 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/subscriptions/90300000079200") .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/subscriptions/90300000079200', 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/subscriptions/90300000079200", 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/subscriptions/90300000079200", "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/subscriptions/90300000079200 \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'X-com-zoho-subscriptions-organizationid: 10234695'

Response Example

{ "code": 0, "message": "The subscription has been deleted." }

Cancel a subscription

Your subscription can be either cancelled immediately or at the end of the current term based on the value of `cancel_at_end`.
OAuth Scope : ZohoSubscriptions.subscriptions.CREATE

Query Parameters

cancel_at_end
If `cancel_at_end` is set to true then the `status` of the subscription is changed to non_renewing and if it is false, the `status` would be cancelled.

Request Example

Click to copy
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/subscriptions/90300000079200/cancel" 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/subscriptions/90300000079200/cancel") .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/subscriptions/90300000079200/cancel', 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/subscriptions/90300000079200/cancel", 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/subscriptions/90300000079200/cancel", "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/subscriptions/90300000079200/cancel \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'X-com-zoho-subscriptions-organizationid: 10234695'

Response Example

{ "code": 0, "message": "Your subscription will be canceled at the end of this term.", "subscription": { "subscription_id": "90300000079200", "name": "GatorHost-Basic", "status": "live", "amount": 50, "created_at": "2016-06-11", "activated_at": "2016-06-15", "current_term_starts_at": "2016-06-05", "current_term_ends_at": "2016-06-05", "last_billing_at": "2016-06-05", "next_billing_at": "2016-06-30", "expires_at": "2016-06-05", "interval": 1, "interval_unit": "months", "auto_collect": true, "created_time": "2016-06-11T17:57:13-0700", "updated_time": "2016-06-04T16:44:15-0700", "reference_id": "bowmanfurniture", "salesperson_id": "903000000058001", "salesperson_name": "Franklin", "child_invoice_id": "90300000079210", "currency_code": "USD", "currency_symbol": "$", "end_of_term": false, "product_id": "90300000079065", "product_name": "Bowman Furniture", "plan": { "plan_code": "basic-monthly", "name": "GatorHost-Basic", "quantity": 1, "price": 50, "discount": 20, "total": 50, "setup_fee": 20, "plan_description": "Monthly Basic plan", "tax_id": "903000002345", "trial_days": 0 }, "addons": [ { "addon_code": "Email-basic", "name": "Monthly Addon", "addon_description": "Monthly addon.", "quantity": 1, "price": 10, "discount": null, "total": null, "tax_id": null } ], "coupon": { "coupon_code": "Flat10", "discount_amount": 44 }, "card": { "card_id": "9030000079226", "last_four_digits": 2145, "payment_gateway": "payflow_pro", "expiry_month": 9, "expiry_year": 2030 }, "payment_terms": 0, "payment_terms_label": "Due On Receipt", "can_add_bank_account": true, "customer": { "customer_id": "903000000099", "display_name": "Bowman Furniture", "salutation": "Mr.", "first_name": "Benjamin", "last_name": "George", "email": "benjamin.george@bowmanfurniture.com", "company_name": "Bowman Furniture", "billing_address": { "attention": "Benjamin George", "street": "Harrington Bay Street", "city": "Salt Lake City", "state": "CA", "country": "U.S.A", "zip": 92612, "fax": 4527389 }, "shipping_address": { "attention": "Benjamin George", "street": "Harrington Bay Street", "city": "Salt Lake City", "state": "CA", "zip": 92612, "country": "U.S.A", "fax": 4527389 }, "payment_terms": 0, "payment_terms_label": "Due On Receipt" }, "custom_fields": [ { "index": 1, "label": "string", "value": "string", "data_type": "text" } ], "taxes": [ { "tax_id": "903000002345", "tax_name": "GST", "tax_amount": "2.50" } ], "contactpersons": [ { "contactperson_id": "903000000000099" } ], "notes": [ { "note_id": "903000076543", "description": "", "commented_by": "Benjamin", "commented_time": "2016-06-11T17:57:13-0700" } ], "payment_gateways": [ { "payment_gateway": null } ] } }

Reactivate subscription

Reactivate a subscription. You can reactivate a subscription only if the `status` of the subscription is non-renewing.
OAuth Scope : ZohoSubscriptions.subscriptions.CREATE

Request Example

Click to copy
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/subscriptions/90300000079200/reactivate" 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/subscriptions/90300000079200/reactivate") .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/subscriptions/90300000079200/reactivate', 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/subscriptions/90300000079200/reactivate", 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/subscriptions/90300000079200/reactivate", "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/subscriptions/90300000079200/reactivate \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'X-com-zoho-subscriptions-organizationid: 10234695'

Response Example

{ "code": 0, "message": "Subscription has been reactivated successfully.", "subscription": { "subscription_id": "90300000079200", "name": "GatorHost-Basic", "status": "live", "amount": 50, "created_at": "2016-06-11", "activated_at": "2016-06-15", "current_term_starts_at": "2016-06-05", "current_term_ends_at": "2016-06-05", "last_billing_at": "2016-06-05", "next_billing_at": "2016-06-30", "expires_at": "2016-06-05", "interval": 1, "interval_unit": "months", "auto_collect": true, "created_time": "2016-06-11T17:57:13-0700", "updated_time": "2016-06-04T16:44:15-0700", "reference_id": "bowmanfurniture", "salesperson_id": "903000000058001", "salesperson_name": "Franklin", "child_invoice_id": "90300000079210", "currency_code": "USD", "currency_symbol": "$", "end_of_term": false, "product_id": "90300000079065", "product_name": "Bowman Furniture", "plan": { "plan_code": "basic-monthly", "name": "GatorHost-Basic", "quantity": 1, "price": 50, "tags": [ { "tag_id": 0, "tag_option_id": 0 } ], "item_custom_fields": [ { "label": "string", "value": "string" } ], "discount": 20, "total": 50, "setup_fee": 20, "plan_description": "Monthly Basic plan", "billing_cycles": -1, "trial_days": 0 }, "addons": [ { "addon_code": "Email-basic", "name": "Monthly Addon", "addon_description": "Monthly addon.", "quantity": 1, "tags": [ { "tag_id": 0, "tag_option_id": 0 } ], "item_custom_fields": [ { "label": "string", "value": "string" } ], "price": 10, "discount": null, "total": null } ], "coupon": { "coupon_code": "Flat10", "discount_amount": 44 }, "card": { "card_id": "90300000079226", "last_four_digits": 2145, "payment_gateway": "payflow_pro", "expiry_month": 9, "expiry_year": 2030 }, "payment_terms": 0, "payment_terms_label": "Due On Receipt", "can_add_bank_account": true, "customer": { "customer_id": "903000000000099", "display_name": "Bowman Furniture", "first_name": "Benjamin", "last_name": "George", "email": "benjamin.george@bowmanfurniture.com", "company_name": "Bowman Furniture", "billing_address": { "attention": "Benjamin George", "street": "Harrington Bay Street", "city": "Salt Lake City", "state": "CA", "country": "U.S.A", "zip": 92612, "fax": 4527389 }, "shipping_address": { "attention": "Benjamin George", "street": "Harrington Bay Street", "city": "Salt Lake City", "state": "CA", "zip": 92612, "country": "U.S.A", "fax": 4527389 }, "payment_terms": 0, "payment_terms_label": "Due On Receipt" }, "custom_fields": [ { "index": 1, "label": "string", "value": "string", "data_type": "text" } ], "taxes": [ { "tax_id": "903000002345", "tax_name": "GST", "tax_amount": "2.50" } ], "contactpersons": [ { "contactperson_id": "903000000000099" } ], "notes": [ { "note_id": "903000076543", "description": "string", "commented_by": "Benjamin", "commented_time": "2016-06-11T17:57:13-0700" } ], "payment_gateways": [ { "payment_gateway": null } ] } }

View Scheduled Changes

To view the End of Term changes.
OAuth Scope : ZohoSubscriptions.subscriptions.READ

Request Example

Click to copy
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/subscriptions/90300000079200/scheduledchanges" 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/subscriptions/90300000079200/scheduledchanges") .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/subscriptions/90300000079200/scheduledchanges', 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/subscriptions/90300000079200/scheduledchanges", 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/subscriptions/90300000079200/scheduledchanges", "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/subscriptions/90300000079200/scheduledchanges \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'X-com-zoho-subscriptions-organizationid: 10234695'

Response Example

{ "code": 0, "message": "success", "subscription": { "subscription_id": "90300000079200", "name": "GatorHost-Basic", "status": "live", "amount": 50, "created_at": "2016-06-11", "activated_at": "2016-06-15", "current_term_ends_at": "2016-06-05", "current_term_starts_at": "2016-06-05", "last_billing_at": "2016-06-05", "next_billing_at": "2016-06-30", "expires_at": "2016-06-05", "interval": 1, "interval_unit": "months", "auto_collect": true, "created_time": "2016-06-11T17:57:13-0700", "updated_time": "2016-06-04T16:44:15-0700", "reference_id": "bowmanfurniture", "salesperson_id": "903000000058001", "salesperson_name": "Franklin", "currency_code": "USD", "currency_symbol": "$", "product_id": "90300000079065", "plan": { "plan_code": "basic-monthly", "name": "GatorHost-Basic", "quantity": 1, "price": 50, "discount": 20, "total": 50, "setup_fee": 20, "plan_description": "Monthly Basic plan", "tax_id": "903000002345", "trial_days": 0 }, "addons": [ { "addon_code": "Email-basic", "name": "Monthly Addon", "addon_description": "Monthly addon.", "quantity": 1, "price": 10, "discount": null, "total": null, "tax_id": null } ], "taxes": [ { "tax_id": "903000002345", "tax_name": "GST", "tax_amount": "2.50" } ], "coupon": { "coupon_code": "Flat10", "discount_amount": 44 }, "tax_id": "903000002345" } }

Subscription Activities

List of all the recent activities associated to a subscription.
OAuth Scope : ZohoSubscriptions.subscriptions.READ

Request Example

Click to copy
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/subscriptions/90300000079200/recentactivities" 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/subscriptions/90300000079200/recentactivities") .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/subscriptions/90300000079200/recentactivities', 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/subscriptions/90300000079200/recentactivities", 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/subscriptions/90300000079200/recentactivities", "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/subscriptions/90300000079200/recentactivities \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'X-com-zoho-subscriptions-organizationid: 10234695'

Response Example

{ "code": 0, "message": "success", "activities": [ { "activity_id": "90300000745213", "description": "Invoice created - INV-000241", "activity_time": "2016-06-11T17:57:13-0700", "commented_by": "Zoho Billing" }, {...}, {...} ] }

Buy one-time addon

Include a one-time addon in the subscription.
OAuth Scope : ZohoSubscriptions.subscriptions.CREATE

Arguments

addons
array
(Required)
List of addon objects which are to be included in the subscription. Each object contains addon_code, name, price and quantity.
Show Sub-Attributes arrow
addon_code
string
(Required)
Addon code of the addon.
quantity
integer
Required quantity of the chosen addon.
tags
array
Show Sub-Attributes arrow
tag_id
long
ID of the Tag
tag_option_id
long
Id of the Tag Option
item_custom_fields
array
Custom fields for a item.
Show Sub-Attributes arrow
label
string
Label of the Custom Field
value
string
Value of the Custom Field
price
double
A value can be provided here if the per unit addon price has to be overridden for this subscription.
tax_id
(Required) for applying tax or tax exemption to a addon
Unique ID of Tax or Tax Group that must be associated with the addon. tax_id must be empty for applying tax Exemption.
tax_exemption_id
Unique ID of the tax exemption applied for the addon. To apply tax exemption also include tax_id as empty string.
tax_exemption_code
Unique Code of the tax exemption applied for the addon. To apply tax exemption also include tax_id as empty string.
product_type
string
VAT only
Product type for UK Edition.
exchange_rate
double
, default is the exchange rate provided in settings.
This will be the exchange rate provided for the organization's currency and the customer's currency. The subscription fee would be the multiplicative product of the original price and the exchange rate.
coupon_code
The coupon code of the coupon which is to be applied to the one-time addon.
add_to_unbilled_charges
boolean
When the value is given as true, the charges for the add-on will be put as unbilled. If the subscription already has unbilled-charges, this will be added as another line item to it. The unbilled charge can be converted to invoice at any later point of time.

Request Example

Click to copy
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/subscriptions/90300000079200/buyonetimeaddon" 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/subscriptions/90300000079200/buyonetimeaddon") .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/subscriptions/90300000079200/buyonetimeaddon', 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/subscriptions/90300000079200/buyonetimeaddon", 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/subscriptions/90300000079200/buyonetimeaddon", "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/subscriptions/90300000079200/buyonetimeaddon \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'X-com-zoho-subscriptions-organizationid: 10234695' \ --header 'content-type: application/json' \ --data '{"field1":"value1","field2":"value2"}'

Body Parameters

Click to copy
{ "addons": [ { "addon_code": "Email-basic", "quantity": 1, "tags": [ { "tag_id": 0, "tag_option_id": 0 } ], "item_custom_fields": [ { "label": "string", "value": "string" } ], "price": 10, "tax_id": null, "tax_exemption_id": null, "tax_exemption_code": null, "product_type": "goods" } ], "exchange_rate": 2, "coupon_code": null, "add_to_unbilled_charges": true }

Response Example

{ "code": 0, "message": "One-time addon has been purchased successfully.", "invoice": { "invoice_id": "9030000079426", "number": "INV-384", "status": "live", "invoice_date": "2016-06-15", "due_date": "2016-06-15", "payment_expected_date": "10-05-2016", "ach_payment_initiated": true, "invoice_items": [ { "item_id": "90300000079434", "name": "GatorHost-Basic", "description": "One time addon purchased", "code": "basic-monthly", "price": 50, "quantity": 1, "tags": [ { "tag_id": 0, "tag_option_id": 0 } ], "item_custom_fields": [ { "label": "string", "value": "string" } ], "discount_amount": 44, "item_total": 50 } ], "transaction_type": "invoice", "customer_id": "903000000000099", "customer_name": "Benjamin", "email": "benjamin.george@bowmanfurniture.com", "total": 50, "payment_made": 370, "balance": 0, "coupons": [ { "coupon_code": "Flat10", "coupon_name": "Flat 10", "discount_amount": 44 } ], "credits_applied": 0, "credits": [ { "creditnote_id": "9030000079876", "creditnotes_number": "CN-26", "credited_date": "2016-06-15", "credited_amount": 15 } ], "taxes": [ { "tax_id": "903000002345", "tax_name": "GST", "tax_amount": "2.50" } ], "custom_fields": [ { "index": 1, "label": "string", "value": "string", "data_type": "text" } ], "salesperson_id": "903000000058001", "salesperson_name": "Franklin", "write_off_amount": 0, "payments": [ { "payment_id": "90300000079467", "payment_mode": "autotransaction", "invoice_payment_id": "9030000079469", "gateway_transaction_id": "9030000056453", "description": "", "date": "2016-06-15", "reference_number": "INV-384", "amount": 50, "exchange_rate": 2 } ], "currency_code": "USD", "currency_symbol": "$", "created_time": "2016-06-11T17:57:13-0700", "updated_time": "2016-06-04T16:44:15-0700", "billing_address": { "attention": "Benjamin George", "street": "Harrington Bay Street", "city": "Salt Lake City", "state": "CA", "country": "U.S.A", "zip": 92612, "fax": 4527389 }, "shipping_address": { "attention": "Benjamin George", "street": "Harrington Bay Street", "city": "Salt Lake City", "state": "CA", "zip": 92612, "country": "U.S.A", "fax": 4527389 }, "comments": [ { "comment_id": "90300000003133", "description": "Invoice has been marked as void", "commented_by_id": "90300000002099", "commented_by": null, "comment_type": "system", "date": null, "time": "2016-06-11T17:57:13-0700", "operation_type": "add", "transaction_id": "9030000079467", "transaction_type": "invoice" } ] } }

Associate a coupon

Apply a coupon to a subscription which has been already created.
OAuth Scope : ZohoSubscriptions.subscriptions.CREATE

Request Example

Click to copy
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/subscriptions/90300000079200/coupons/Flat10" 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/subscriptions/90300000079200/coupons/Flat10") .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/subscriptions/90300000079200/coupons/Flat10', 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/subscriptions/90300000079200/coupons/Flat10", 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/subscriptions/90300000079200/coupons/Flat10", "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/subscriptions/90300000079200/coupons/Flat10 \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'X-com-zoho-subscriptions-organizationid: 10234695'

Response Example

{ "code": 0, "message": "The coupon has been added to the subscription." }

Remove a coupon

To remove coupon associated with a subscription.
OAuth Scope : ZohoSubscriptions.subscriptions.DELETE

Request Example

Click to copy
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/subscriptions/90300000079200/coupons" 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/subscriptions/90300000079200/coupons") .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/subscriptions/90300000079200/coupons', 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/subscriptions/90300000079200/coupons", 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/subscriptions/90300000079200/coupons", "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/subscriptions/90300000079200/coupons \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'X-com-zoho-subscriptions-organizationid: 10234695'

Response Example

{ "code": 0, "message": "The coupon has been removed from the subscription." }

Update Card

Update the card details of a customer. Once updated, the past card will no longer be charged.
OAuth Scope : ZohoSubscriptions.subscriptions.CREATE

Arguments

card_id
string
(Required) if auto_collect node is true and any other payment method is not specified
Enter the card_id of the card which has to be updated.
auto_collect
boolean
auto_collect is set to true for creating an online subscription which will charge the customer’s card automatically on every renewal. To create an offline subscriptions, set auto_collect to false.

Request Example

Click to copy
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/subscriptions/90300000079200/card" 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/subscriptions/90300000079200/card") .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/subscriptions/90300000079200/card', 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/subscriptions/90300000079200/card", 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/subscriptions/90300000079200/card", "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/subscriptions/90300000079200/card \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'X-com-zoho-subscriptions-organizationid: 10234695' \ --header 'content-type: application/json' \ --data '{"field1":"value1","field2":"value2"}'

Body Parameters

Click to copy
{ "card_id": "9030000079226", "auto_collect": true }

Response Example

{ "code": 0, "message": "Card has been updated successfully.", "subscription": { "subscription_id": "90300000079200", "name": "GatorHost-Basic", "status": "live", "amount": 50, "created_at": "2016-06-11", "activated_at": "2016-06-15", "current_term_starts_at": "2016-06-05", "current_term_ends_at": "2016-06-05", "last_billing_at": "2016-06-05", "next_billing_at": "2016-06-30", "expires_at": "2016-06-05", "interval": 1, "interval_unit": "months", "auto_collect": true, "created_time": "2016-06-11T17:57:13-0700", "updated_time": "2016-06-04T16:44:15-0700", "reference_id": "bowmanfurniture", "salesperson_id": "903000000058001", "salesperson_name": "Franklin", "child_invoice_id": "90300000079210", "currency_code": "USD", "currency_symbol": "$", "end_of_term": false, "product_id": "90300000079065", "product_name": "Bowman Furniture", "plan": { "plan_code": "basic-monthly", "name": "GatorHost-Basic", "quantity": 1, "price": 50, "discount": 20, "total": 50, "setup_fee": 20, "plan_description": "Monthly Basic plan", "tax_id": "903000002345", "trial_days": 0 }, "addons": [ { "addon_code": "Email-basic", "name": "Monthly Addon", "addon_description": "Monthly addon.", "quantity": 1, "price": 10, "discount": null, "total": null, "tax_id": null } ], "coupon": { "coupon_code": "Flat10", "discount_amount": 44 }, "card": { "card_id": "903000079226", "last_four_digits": 2145, "payment_gateway": "payflow_pro", "expiry_month": 9, "expiry_year": 2030 }, "payment_terms": 0, "payment_terms_label": "Due On Receipt", "can_add_bank_account": true, "customer": { "customer_id": "9030000000099", "display_name": "Bowman Furniture", "first_name": "Benjamin", "last_name": "George", "email": "benjamin.george@bowmanfurniture.com", "company_name": "Bowman Furniture", "billing_address": { "attention": "Benjamin George", "street": "Harrington Bay Street", "city": "Salt Lake City", "state": "CA", "country": "U.S.A", "zip": 92612, "fax": 4527389 }, "shipping_address": { "attention": "Benjamin George", "street": "Harrington Bay Street", "city": "Salt Lake City", "state": "CA", "zip": 92612, "country": "U.S.A", "fax": 4527389 }, "payment_terms": 0, "payment_terms_label": "Due On Receipt" }, "custom_fields": [ { "index": 1, "label": "string", "value": "string", "data_type": "text" } ], "contactpersons": [ { "contactperson_id": "903000000000099" } ], "notes": [ { "note_id": "903000076543", "description": "", "commented_by": "Benjamin", "commented_time": "2016-06-11T17:57:13-0700" } ], "payment_gateways": [ { "payment_gateway": null } ] } }

Remove Card

Delete a card associated with the subscription. The subscription will become an offline subscription.
OAuth Scope : ZohoSubscriptions.subscriptions.DELETE

Request Example

Click to copy
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/subscriptions/90300000079200/card" 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/subscriptions/90300000079200/card") .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/subscriptions/90300000079200/card', 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/subscriptions/90300000079200/card", 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/subscriptions/90300000079200/card", "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/subscriptions/90300000079200/card \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'X-com-zoho-subscriptions-organizationid: 10234695'

Response Example

{ "code": 0, "message": "Card has been successfully removed from the subscription." }

Add Charge

Charge a one-time amount for the subscription.
OAuth Scope : ZohoSubscriptions.subscriptions.CREATE

Arguments

amount
double
(Required)
The amount that needs to be charged for the subscription.
description
Make a note of why the customer was charged so that if can be used for any future reference.
tags
array
Show Sub-Attributes arrow
tag_id
long
ID of the Tag
tag_option_id
long
Id of the Tag Option
item_custom_fields
array
Custom fields for a item.
Show Sub-Attributes arrow
label
string
Label of the Custom Field
value
string
Value of the Custom Field
account_id
string
Account ID which the add charge is associated.
add_to_unbilled_charges
boolean
When the value is given as true, the charges will be put as unbilled. If the subscription already has unbilled-charges, this will be added as another line item to it. The unbilled charge can be converted to invoice at any later point of time.

Request Example

Click to copy
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/subscriptions/90300000079200/charge" 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/subscriptions/90300000079200/charge") .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/subscriptions/90300000079200/charge', 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/subscriptions/90300000079200/charge", 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/subscriptions/90300000079200/charge", "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/subscriptions/90300000079200/charge \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'X-com-zoho-subscriptions-organizationid: 10234695' \ --header 'content-type: application/json' \ --data '{"field1":"value1","field2":"value2"}'

Body Parameters

Click to copy
{ "amount": 50, "description": "Charges for Additional usage", "tags": [ { "tag_id": 0, "tag_option_id": 0 } ], "item_custom_fields": [ { "label": "string", "value": "string" } ], "account_id": "90300000791111", "add_to_unbilled_charges": true }

Response Example

{ "code": 0, "message": "One time charge has been added successfully.", "invoice": { "invoice_id": "9030000079426", "number": "INV-384", "status": "live", "invoice_items": [ { "item_id": "90300000079434", "name": "One-time charge", "description": "Charges for Additional usage", "code": "basic-monthly", "price": 50, "quantity": 1, "tags": [ { "tag_id": 0, "tag_option_id": 0 } ], "item_custom_fields": [ { "label": "string", "value": "string" } ], "item_total": 50, "account_id": "90300000791111", "account_name": "General Income" } ], "invoice_date": "2016-06-15", "due_date": "2016-06-15", "payment_expected_date": "10-05-2016", "ach_payment_initiated": true, "transaction_type": "invoice", "customer_id": "903000000000099", "customer_name": "Benjamin", "email": "benjamin.george@bowmanfurniture.com", "total": 50, "payment_made": 50, "balance": 0, "credits_applied": 0, "write_off_amount": 0, "payments": [ { "payment_id": "90300000079467", "payment_mode": "autotransaction", "invoice_payment_id": "9030000079469", "gateway_transaction_id": "9030000056453", "description": "", "date": "2016-06-15", "reference_number": "INV-384", "amount": 50, "exchange_rate": 2 } ], "currency_code": "USD", "currency_symbol": "$", "created_time": "2016-06-11T17:57:13-0700", "updated_time": "2016-06-04T16:44:15-0700", "billing_address": { "attention": "Benjamin George", "street": "Harrington Bay Street", "city": "Salt Lake City", "state": "CA", "country": "U.S.A", "zip": 92612, "fax": 4527389 }, "comments": [ { "comment_id": "90300000003133", "description": "Invoice created from subscription - GatorHost-Basic.", "commented_by_id": "90300000002099", "commented_by": null, "comment_type": "system", "date": null, "time": "2016-06-11T17:57:13-0700", "operation_type": "add", "transaction_id": "9030000079467", "transaction_type": "invoice" } ] } }

Add contact person

Associate a contact person with the subscription. Only an existing contact person can be associated.
OAuth Scope : ZohoSubscriptions.subscriptions.CREATE

Arguments

contactpersons
array
(Required)
List of contact person objects. Each object contains contactperson_id.
Show Sub-Attributes arrow
contactperson_id
string
(Required)
Contact person ID of the customer’s contact person.

Request Example

Click to copy
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/subscriptions/90300000079200/contactpersons" 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/subscriptions/90300000079200/contactpersons") .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/subscriptions/90300000079200/contactpersons', 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/subscriptions/90300000079200/contactpersons", 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/subscriptions/90300000079200/contactpersons", "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/subscriptions/90300000079200/contactpersons \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'X-com-zoho-subscriptions-organizationid: 10234695' \ --header 'content-type: application/json' \ --data '{"field1":"value1","field2":"value2"}'

Body Parameters

Click to copy
{ "contactpersons": [ { "contactperson_id": "903000000000099" } ] }

Response Example

{ "code": 0, "message": "The contact person's information has been added.", "subscription": { "subscription_id": "90300000079200", "name": "GatorHost-Basic", "status": "live", "amount": 50, "created_at": "2016-06-11", "activated_at": "2016-06-15", "current_term_starts_at": "2016-06-05", "current_term_ends_at": "2016-06-05", "last_billing_at": "2016-06-05", "next_billing_at": "2016-06-30", "expires_at": "2016-06-05", "interval": 1, "interval_unit": "months", "auto_collect": true, "created_time": "2016-06-11T17:57:13-0700", "updated_time": "2016-06-04T16:44:15-0700", "reference_id": "bowmanfurniture", "salesperson_id": "903000000058001", "salesperson_name": "Franklin", "child_invoice_id": "90300000079210", "currency_code": "USD", "currency_symbol": "$", "end_of_term": false, "product_id": "90300000079065", "product_name": "Bowman Furniture", "plan": { "plan_code": "basic-monthly", "name": "GatorHost-Basic", "quantity": 1, "price": 50, "discount": 20, "total": 50, "setup_fee": 20, "plan_description": "Monthly Basic plan", "tax_id": "903000002345", "trial_days": 0 }, "addons": [ { "addon_code": "Email-basic", "name": "Monthly Addon", "addon_description": "Monthly addon.", "quantity": 1, "price": 50, "discount": null, "total": null, "tax_id": null } ], "coupon": { "coupon_code": "Flat10", "discount_amount": 44 }, "card": { "card_id": "9030000079226", "last_four_digits": 2145, "payment_gateway": "payflow_pro", "expiry_month": 9, "expiry_year": 2030 }, "payment_terms": 0, "payment_terms_label": "Due On Receipt", "can_add_bank_account": true, "customer": { "customer_id": "9030000000099", "display_name": "Bowman Furniture", "first_name": "Benjamin", "last_name": "George", "email": "benjamin.george@bowmanfurniture.com", "company_name": "Bowman Furniture", "billing_address": { "attention": "Benjamin George", "street": "Harrington Bay Street", "city": "Salt Lake City", "state": "CA", "country": "U.S.A", "zip": 92612, "fax": 4527389 }, "shipping_address": { "attention": "Benjamin George", "street": "Harrington Bay Street", "city": "Salt Lake City", "state": "CA", "zip": 92612, "country": "U.S.A", "fax": 4527389 }, "payment_terms": 0, "payment_terms_label": "Due On Receipt" }, "custom_fields": [ { "index": 1, "label": "string", "value": "string", "data_type": "text" } ], "taxes": [ { "tax_id": "903000002345", "tax_name": "GST", "tax_amount": "2.50" } ], "contactpersons": [ { "contactperson_id": "903000000000099" } ], "notes": [ { "note_id": "903000076543", "description": "", "commented_by": "Benjamin", "commented_time": "2016-06-11T17:57:13-0700" } ], "payment_gateways": [ { "payment_gateway": null } ] } }

Postpone renewal

A subscription renewal date (billing date) can be postponed thereby extending the subscription term. Also, subscription renewal can only be postponed and not preponed.
OAuth Scope : ZohoSubscriptions.subscriptions.CREATE

Arguments

renewal_at
string
(Required)
Enter the future date to which the subscription renewal has to be postponed.

Request Example

Click to copy
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/subscriptions/90300000079200/postpone" 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/subscriptions/90300000079200/postpone") .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/subscriptions/90300000079200/postpone', 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/subscriptions/90300000079200/postpone", 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/subscriptions/90300000079200/postpone", "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/subscriptions/90300000079200/postpone \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'X-com-zoho-subscriptions-organizationid: 10234695' \ --header 'content-type: application/json' \ --data '{"field1":"value1","field2":"value2"}'

Body Parameters

Click to copy
{ "renewal_at": "2016-06-24" }

Response Example

{ "code": 0, "message": "Billing date of the subscription has been changed.", "subscription": { "subscription_id": "90300000079200", "name": "GatorHost-Basic", "status": "live", "amount": 50, "created_at": "2016-06-11", "activated_at": "2016-06-15", "current_term_starts_at": "2016-06-05", "current_term_ends_at": "2016-06-05", "last_billing_at": "2016-06-05", "next_billing_at": "2016-06-30", "expires_at": "2016-06-05", "interval": 1, "interval_unit": "months", "auto_collect": true, "created_time": "2016-06-11T17:57:13-0700", "updated_time": "2016-06-04T16:44:15-0700", "reference_id": "bowmanfurniture", "salesperson_id": "903000000058001", "salesperson_name": "Franklin", "child_invoice_id": "90300000079210", "currency_code": "USD", "currency_symbol": "$", "end_of_term": false, "product_id": "90300000079065", "product_name": "Bowman Furniture", "plan": { "plan_code": "basic-monthly", "name": "GatorHost-Basic", "quantity": 1, "price": 50, "discount": 20, "total": 50, "setup_fee": 20, "plan_description": "Monthly Basic plan", "tax_id": "903000002345", "trial_days": 0 }, "addons": [ { "addon_code": "Email-basic", "name": "Monthly Addon", "addon_description": "Monthly addon.", "quantity": 1, "price": 10, "discount": null, "total": null, "tax_id": null } ], "coupon": { "coupon_code": "Flat10", "discount_amount": 44 }, "card": { "card_id": "90300000079226", "last_four_digits": 2145, "payment_gateway": "payflow_pro", "expiry_month": 9, "expiry_year": 2030 }, "payment_terms": 0, "payment_terms_label": "Due On Receipt", "can_add_bank_account": true, "customer": { "customer_id": "903000000099", "display_name": "Bowman Furniture", "first_name": "Benjamin", "last_name": "George", "email": "benjamin.george@bowmanfurniture.com", "company_name": "Bowman Furniture", "billing_address": { "attention": "Benjamin George", "street": "Harrington Bay Street", "city": "Salt Lake City", "state": "CA", "country": "U.S.A", "zip": 92612, "fax": 4527389 }, "shipping_address": { "attention": "Benjamin George", "street": "Harrington Bay Street", "city": "Salt Lake City", "state": "CA", "zip": 92612, "country": "U.S.A", "fax": 4527389 }, "payment_terms": 0, "payment_terms_label": "Due On Receipt" }, "custom_fields": [ { "index": 1, "label": "string", "value": "string", "data_type": "text" } ], "taxes": [ { "tax_id": "903000002345", "tax_name": "GST", "tax_amount": "2.50" } ], "contactpersons": [ { "contactperson_id": "903000000000099" } ], "notes": [ { "note_id": "903000076543", "description": "", "commented_by": "Benjamin", "commented_time": "2016-06-11T17:57:13-0700" } ], "payment_gateways": [ { "payment_gateway": null } ] } }

Add/Edit description for a item in line items list

Add/Edit description to a particular plan or addon in the line items list.
OAuth Scope : ZohoSubscriptions.subscriptions.CREATE

Arguments

description
(Required)
Make a note of why the customer was charged so that if can be used for any future reference.

Request Example

Click to copy
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/subscriptions/90300000079200/lineitems/%7Bplan_or_addon_code%7D" 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/subscriptions/90300000079200/lineitems/%7Bplan_or_addon_code%7D") .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/subscriptions/90300000079200/lineitems/%7Bplan_or_addon_code%7D', 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/subscriptions/90300000079200/lineitems/%7Bplan_or_addon_code%7D", 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/subscriptions/90300000079200/lineitems/%7Bplan_or_addon_code%7D", "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/subscriptions/90300000079200/lineitems/%7Bplan_or_addon_code%7D \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'X-com-zoho-subscriptions-organizationid: 10234695' \ --header 'content-type: application/json' \ --data '{"field1":"value1","field2":"value2"}'

Body Parameters

Click to copy
{ "description": "" }

Response Example

{ "code": 0, "message": "Item description has been updated successfully." }

Change to Online/Offline mode

Change the status of a particular subscription to Online/Offline mode. If auto_collect is false, the subscription is in Offline mode. If auto_collect is true, the subscription is in Online mode.
OAuth Scope : ZohoSubscriptions.subscriptions.CREATE

Arguments

auto_collect
(Required)
auto_collect is set to true for creating an online subscription which will charge the customer’s card automatically on every renewal. To create an offline subscriptions, set auto_collect to false.

Request Example

Click to copy
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/subscriptions/90300000079200/autocollect" 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/subscriptions/90300000079200/autocollect") .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/subscriptions/90300000079200/autocollect', 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/subscriptions/90300000079200/autocollect", 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/subscriptions/90300000079200/autocollect", "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/subscriptions/90300000079200/autocollect \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'X-com-zoho-subscriptions-organizationid: 10234695' \ --header 'content-type: application/json' \ --data '{"field1":"value1","field2":"value2"}'

Body Parameters

Click to copy
{ "auto_collect": true }

Response Example

{ "code": 0, "message": "Auto charge Status has been changed successfully.", "subscription": { "subscription_id": "90300000079200", "name": "GatorHost-Basic", "status": "live", "amount": 50, "created_at": "2016-06-11", "activated_at": "2016-06-15", "current_term_starts_at": "2016-06-05", "current_term_ends_at": "2016-06-05", "last_billing_at": "2016-06-05", "next_billing_at": "2016-06-30", "expires_at": "2016-06-05", "interval": 1, "interval_unit": "months", "auto_collect": true, "created_time": "2016-06-11T17:57:13-0700", "updated_time": "2016-06-04T16:44:15-0700", "reference_id": "bowmanfurniture", "salesperson_id": "903000000058001", "salesperson_name": "Franklin", "child_invoice_id": "90300000079210", "currency_code": "USD", "currency_symbol": "$", "end_of_term": false, "product_id": "90300000079065", "product_name": "Bowman Furniture", "plan": { "plan_code": "basic-monthly", "name": "GatorHost-Basic", "quantity": 1, "price": 50, "discount": 20, "total": 50, "setup_fee": 20, "plan_description": "Monthly Basic plan", "tax_id": "903000002345", "trial_days": 0 }, "addons": [ { "addon_code": "Email-basic", "name": "Monthly Addon", "addon_description": "Monthly addon.", "quantity": 1, "price": 10, "discount": null, "total": null, "tax_id": null } ], "coupon": { "coupon_code": "Flat10", "discount_amount": 44 }, "card": { "card_id": "90300000079226", "last_four_digits": 2145, "payment_gateway": "payflow_pro", "expiry_month": 9, "expiry_year": 2030 }, "payment_terms": 0, "payment_terms_label": "Due On Receipt", "can_add_bank_account": true, "customer": { "customer_id": "903000000000099", "display_name": "Bowman Furniture", "first_name": "Benjamin", "last_name": "George", "email": "benjamin.george@bowmanfurniture.com", "company_name": "Bowman Furniture", "billing_address": { "attention": "Benjamin George", "street": "Harrington Bay Street", "city": "Salt Lake City", "state": "CA", "country": "U.S.A", "zip": 92612, "fax": 4527389 }, "shipping_address": { "attention": "Benjamin George", "street": "Harrington Bay Street", "city": "Salt Lake City", "state": "CA", "zip": 92612, "country": "U.S.A", "fax": 4527389 }, "payment_terms": 0, "payment_terms_label": "Due On Receipt" }, "custom_fields": [ { "index": 1, "label": "string", "value": "string", "data_type": "text" } ], "taxes": [ { "tax_id": "903000002345", "tax_name": "GST", "tax_amount": "2.50" } ], "contactpersons": [ { "contactperson_id": "903000000000099" } ], "notes": [ { "note_id": "903000076543", "description": "string", "commented_by": "Benjamin", "commented_time": "2016-06-11T17:57:13-0700" } ], "payment_gateways": [ { "payment_gateway": null } ] } }

Update Reference

Update reference id to easily identify and keep track of your subscription.
OAuth Scope : ZohoSubscriptions.subscriptions.CREATE

Arguments

reference_id
(Required)
A string of your choice is required to easily identify and keep track of your subscriptions.

Request Example

Click to copy
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/subscriptions/90300000079200/reference" 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/subscriptions/90300000079200/reference") .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/subscriptions/90300000079200/reference', 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/subscriptions/90300000079200/reference", 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/subscriptions/90300000079200/reference", "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/subscriptions/90300000079200/reference \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'X-com-zoho-subscriptions-organizationid: 10234695' \ --header 'content-type: application/json' \ --data '{"field1":"value1","field2":"value2"}'

Body Parameters

Click to copy
{ "reference_id": "bowmanfurniture" }

Response Example

{ "code": 0, "message": "Subscription has been updated successfully.", "subscription": { "subscription_id": "90300000079200", "name": "GatorHost-Basic", "status": "live", "amount": 50, "created_at": "2016-06-11", "activated_at": "2016-06-15", "current_term_starts_at": "2016-06-05", "current_term_ends_at": "2016-06-05", "last_billing_at": "2016-06-05", "next_billing_at": "2016-06-30", "expires_at": "2016-06-05", "interval": 1, "interval_unit": "months", "auto_collect": true, "created_time": "2016-06-11T17:57:13-0700", "updated_time": "2016-06-04T16:44:15-0700", "reference_id": "bowmanfurniture", "salesperson_id": "903000000058001", "salesperson_name": "Franklin", "child_invoice_id": "90300000079210", "currency_code": "USD", "currency_symbol": "$", "end_of_term": false, "product_id": "90300000079065", "product_name": "Bowman Furniture", "plan": { "plan_code": "basic-monthly", "name": "GatorHost-Basic", "quantity": 1, "price": 50, "discount": 20, "total": 50, "setup_fee": 20, "plan_description": "Monthly Basic plan", "tax_id": "903000002345", "trial_days": 0 }, "addons": [ { "addon_code": "Email-basic", "name": "Monthly Addon", "addon_description": "Monthly addon.", "quantity": 1, "price": 10, "discount": null, "total": null, "tax_id": null } ], "coupon": { "coupon_code": "Flat10", "discount_amount": 44 }, "card": { "card_id": "90300000079226", "last_four_digits": 2145, "payment_gateway": "payflow_pro", "expiry_month": 9, "expiry_year": 2030 }, "payment_terms": 0, "payment_terms_label": "Due On Receipt", "can_add_bank_account": true, "customer": { "customer_id": "903000000000099", "display_name": "Bowman Furniture", "first_name": "Benjamin", "last_name": "George", "email": "benjamin.george@bowmanfurniture.com", "company_name": "Bowman Furniture", "billing_address": { "attention": "Benjamin George", "street": "Harrington Bay Street", "city": "Salt Lake City", "state": "CA", "country": "U.S.A", "zip": 92612, "fax": 4527389 }, "shipping_address": { "attention": "Benjamin George", "street": "Harrington Bay Street", "city": "Salt Lake City", "state": "CA", "zip": 92612, "country": "U.S.A", "fax": 4527389 }, "payment_terms": 0, "payment_terms_label": "Due On Receipt" }, "custom_fields": [ { "index": 1, "label": "string", "value": "string", "data_type": "text" } ], "taxes": [ { "tax_id": "903000002345", "tax_name": "GST", "tax_amount": "2.50" } ], "contactpersons": [ { "contactperson_id": "903000000000099" } ], "notes": [ { "note_id": "903000076543", "description": "string", "commented_by": "Benjamin", "commented_time": "2016-06-11T17:57:13-0700" } ], "payment_gateways": [ { "payment_gateway": null } ] } }

Update Sales Person

Update a sales person associated with a particular subscription.
OAuth Scope : ZohoSubscriptions.subscriptions.CREATE

Arguments

salesperson_id
(Required)
Unique Id of the sales person assigned for the subscription.
salesperson_name
string
(Required)
Name of the sales person assigned for the subscription.

Request Example

Click to copy
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/subscriptions/90300000079200/salesperson" 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/subscriptions/90300000079200/salesperson") .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/subscriptions/90300000079200/salesperson', 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/subscriptions/90300000079200/salesperson", 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/subscriptions/90300000079200/salesperson", "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/subscriptions/90300000079200/salesperson \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'X-com-zoho-subscriptions-organizationid: 10234695' \ --header 'content-type: application/json' \ --data '{"field1":"value1","field2":"value2"}'

Body Parameters

Click to copy
{ "salesperson_id": "", "salesperson_name": "Franklin" }

Response Example

{ "code": 0, "message": "Sales Person has been updated successfully.", "subscription": { "subscription_id": "90300000079200", "name": "GatorHost-Basic", "status": "live", "amount": 50, "created_at": "2016-06-11", "activated_at": "2016-06-15", "current_term_starts_at": "2016-06-05", "current_term_ends_at": "2016-06-05", "last_billing_at": "2016-06-05", "next_billing_at": "2016-06-30", "expires_at": "2016-06-05", "interval": 1, "interval_unit": "months", "auto_collect": true, "created_time": "2016-06-11T17:57:13-0700", "updated_time": "2016-06-04T16:44:15-0700", "reference_id": "bowmanfurniture", "salesperson_id": "903000000058001", "salesperson_name": "Franklin", "child_invoice_id": "90300000079210", "currency_code": "USD", "currency_symbol": "$", "end_of_term": false, "product_id": "90300000079065", "product_name": "Bowman Furniture", "plan": { "plan_code": "basic-monthly", "name": "GatorHost-Basic", "quantity": 1, "price": 50, "discount": 20, "total": 50, "setup_fee": 20, "plan_description": "Monthly Basic plan", "tax_id": "903000002345", "trial_days": 0 }, "addons": [ { "addon_code": "Email-basic", "name": "Monthly Addon", "addon_description": "Monthly addon.", "quantity": 1, "price": 10, "discount": null, "total": null, "tax_id": null } ], "coupon": { "coupon_code": "Flat10", "discount_amount": 44 }, "card": { "card_id": "90300000079226", "last_four_digits": 2145, "payment_gateway": "payflow_pro", "expiry_month": 9, "expiry_year": 2030 }, "payment_terms": 0, "payment_terms_label": "Due On Receipt", "can_add_bank_account": true, "customer": { "customer_id": "903000000000099", "display_name": "Bowman Furniture", "first_name": "Benjamin", "last_name": "George", "email": "benjamin.george@bowmanfurniture.com", "company_name": "Bowman Furniture", "billing_address": { "attention": "Benjamin George", "street": "Harrington Bay Street", "city": "Salt Lake City", "state": "CA", "country": "U.S.A", "zip": 92612, "fax": 4527389 }, "shipping_address": { "attention": "Benjamin George", "street": "Harrington Bay Street", "city": "Salt Lake City", "state": "CA", "zip": 92612, "country": "U.S.A", "fax": 4527389 }, "payment_terms": 0, "payment_terms_label": "Due On Receipt" }, "custom_fields": [ { "index": 1, "label": "string", "value": "string", "data_type": "text" } ], "taxes": [ { "tax_id": "903000002345", "tax_name": "GST", "tax_amount": "2.50" } ], "contactpersons": [ { "contactperson_id": "903000000000099" } ], "notes": [ { "note_id": "903000076543", "description": "string", "commented_by": "Benjamin", "commented_time": "2016-06-11T17:57:13-0700" } ], "payment_gateways": [ { "payment_gateway": null } ] } }

Update Custom Fields

Update the custom fields associated with a particular subscription.
OAuth Scope : ZohoSubscriptions.subscriptions.CREATE

Arguments

custom_fields
array
(Required)
Additional fields for the invoices.
Show Sub-Attributes arrow
label
string
(Required)
Label of the Custom Field
value
string
(Required)
Value of the Custom Field

Request Example

Click to copy
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/subscriptions/90300000079200/customfields" 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/subscriptions/90300000079200/customfields") .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/subscriptions/90300000079200/customfields', 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/subscriptions/90300000079200/customfields", 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/subscriptions/90300000079200/customfields", "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/subscriptions/90300000079200/customfields \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'X-com-zoho-subscriptions-organizationid: 10234695' \ --header 'content-type: application/json' \ --data '{"field1":"value1","field2":"value2"}'

Body Parameters

Click to copy
{ "custom_fields": [ { "label": "string", "value": "string" } ] }

Response Example

{ "code": 0, "message": "Custom Fields Updated Successfully.", "data": { "index": 1, "value": "string", "label": "string", "data_type": "text", "customfield_id": "9030000089798" } }

Add a note

Notes related to the subscription can be added by the user at anytime.
OAuth Scope : ZohoSubscriptions.subscriptions.CREATE

Arguments

description
Small description about the note.

Request Example

Click to copy
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/subscriptions/90300000079200/notes" 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/subscriptions/90300000079200/notes") .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/subscriptions/90300000079200/notes', 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/subscriptions/90300000079200/notes", 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/subscriptions/90300000079200/notes", "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/subscriptions/90300000079200/notes \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'X-com-zoho-subscriptions-organizationid: 10234695' \ --header 'content-type: application/json' \ --data '{"field1":"value1","field2":"value2"}'

Body Parameters

Click to copy
{ "description": null }

Response Example

{ "code": 0, "message": "Notes added.", "note": { "notes": [ { "note_id": "903000076543", "description": "", "commented_by": "Benjamin", "commented_time": "2016-06-11T17:57:13-0700" } ] } }

Delete a note

Delete a specific note.
OAuth Scope : ZohoSubscriptions.subscriptions.DELETE

Request Example

Click to copy
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/subscriptions/90300000079200/notes/903000076543" 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/subscriptions/90300000079200/notes/903000076543") .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/subscriptions/90300000079200/notes/903000076543', 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/subscriptions/90300000079200/notes/903000076543", 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/subscriptions/90300000079200/notes/903000076543", "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/subscriptions/90300000079200/notes/903000076543 \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'X-com-zoho-subscriptions-organizationid: 10234695'

Response Example

{ "code": 0, "message": "The note has been deleted." }