Skip to content

sudiptochoudhury/php-zoho-subscriptions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

php-zoho-subscriptions

Latest Stable Version Latest Unstable Version License Total Downloads composer.lock available

Zoho Subscriptions API Client for PHP

use SudiptoChoudhury\Zoho\Subscriptions\Api;

...

$subscriptions = new Api([
                'oauthtoken' => '<<Zoho Subscriptions OAuth Token>>', // https://www.zoho.com/subscriptions/api/v1/#oauth
                'zohoOrgId' => '<<Zoho Organization ID>>',
            ]);


$resultJson = $subscriptions->addCustomer($data); // create a customer

$resultJson = $subscriptions->addSubscription($data); // create a subscription
 
 

Auth Token (Will be deprecated soon), but you can still use it.

use SudiptoChoudhury\Zoho\Subscriptions\Api;

...

$subscriptions = new Api([
                'authtoken' => '<<Zoho Subscriptions Auth Token>>', // https://accounts.zoho.com/apiauthtoken/nb/create
                'zohoOrgId' => '<<Zoho Organization ID>>',
            ]);


$resultJson = $subscriptions->addCustomer($data); // create a customer

$resultJson = $subscriptions->addSubscription($data); // create a subscription
 
 

Installation

Requirements

  • Any flavour of PHP 7.0+ should do

Install With Composer

You can install the library via Composer by adding the following line to the require block of your composer.json file (replace dev-master with latest stable version):

"sudiptochoudhury/php-zoho-subscriptions": "dev-master"

or run the following command:

composer require sudiptochoudhury/php-zoho-subscriptions

Setting up Authentication

Get Organization ID Before you start, read https://www.zoho.com/subscriptions/api/v1/#organization-id to know your Organization ID.

Setup OAuth and use oauth token

Follow instructions from https://www.zoho.com/subscriptions/api/v1/#oauth and get the oathtoken.

Pass the oauth token via the constructor.

use SudiptoChoudhury\Zoho\Subscriptions\Api;


new Api([
    'oauthtoken' => '<<Zoho Subscriptions OAuth Token>>', // https://www.zoho.com/subscriptions/api/v1/#oauth
    'zohoOrgId' => '<<Zoho Organization ID>>',
]);

Or Use AuthToken

will be deprecated soon

Crete and retrieve AuthToken from https://accounts.zoho.com/apiauthtoken/nb/create and set the AuthToken and Organization ID in the constructor.

use SudiptoChoudhury\Zoho\Subscriptions\Api;


new Api([
    'authtoken' => '<<Zoho Subscriptions Auth Token>>', // https://accounts.zoho.com/apiauthtoken/nb/create
    'zohoOrgId' => '<<Zoho Organization ID>>',
]);

How to use

Next, call the desired method from the table given below. In some methods you may need to pass parameters. The parameters are to be passed as an associative array. The required list of parameters can be found in the parameters column of the table or you may get more details going to the original Zoho Subscription API documentation.

Examples:

$resultJson = $subscriptions->getOrganizations(); 

$resultJson = $subscriptions->addCustomer(['display_name'=> 'Sudipto Choudhury', 'email'=> 'mail@sudipto.net']); // create a customer

Available API Methods

Method & Endpoint Parameters Description
getHostedpage(array)
[GET] /hostedpages/{hostedpage_id}
hostedpage_id Getting the details of a particular hosted page
PlaceHolder to replace : hostedpage_id
API DOC
HELP DOC
getHostedpages()
[GET] /hostedpages
[none] Listing all the hostedpages
API DOC
HELP DOC
addNewSubscriptionHostedpages(array)
[POST] /hostedpages/newsubscription
customer_id
contactpersons
plan
addons
starts_at
custom_fields
coupon_code
reference_id
additional_param
redirect_url
Creating a hosted page for a new subscription for an existing customer
API DOC
HELP DOC
addNewCustomerNewSubscriptionHostedpages(array)
[POST] /hostedpages/newsubscription
plan
addons
starts_at
custom_fields
coupon_code
reference_id
additional_param
redirect_url
Creating a hosted page for a new subscription for a new customer
API DOC
HELP DOC
addUpdateCardHostedpages(array)
[POST] /hostedpages/updatecard
subscription_id
additional_param
redirect_url
Creating a hosted page for updating a card linked to a specific subscription
API DOC
HELP DOC
addOnetimeAddonHostedpages(array)
[POST] /hostedpages/buyonetimeaddon
subscription_id
addons
additional_param
redirect_url
Creating a hosted page for onetime addon purchase
API DOC
HELP DOC
addUpdateSubscriptionHostedpages(array)
[POST] /hostedpages/updatesubscription
subscription_id
contactpersons
plan
addons
reference_id
starts_at
additional_param
redirect_url
Creating a hosted page for updating an existing subscription
API DOC
HELP DOC
getTransactions(array)
[GET] /transactions?customer_id={customer_id}&filter_by={filter_by}
customer_id
filter_by [default: TransactionType.ALL]
List all transactions of a particular customer
Allowed parameters and its allowed values :
1)filter_by : TransactionType.(All | INVOICE | PAYMENT | CREDIT | REFUND)
2)customer_id : Customer ID of the customer
PlaceHolder to replace :
customer_id
API DOC
HELP DOC
deleteCustomerComment(array)
[DELETE] /customers/{customer_id}/comments/{comment_id}
customer_id
comment_id
Delete a particular customer comment.
PlaceHolder to replace :
customer_id
comment_id
activateCustomers(array)
[POST] /customers/markasactive?customer_ids={customer_ids}
customer_ids Bulk marking multiple customers as active
Placeholders to replace :
customer_ids
customer_ids should be replaced by customer id's seperated by comma
disableCustomerPaymentReminder(array)
[POST] /customers/{customer_id}/paymentreminder/disable
customer_id Disabling payment reminder for a particular customer
Placeholders to replace :

customer_id
activateCustomer(array)
[POST] /customers/{customer_id}/markasactive
customer_id Marking a particular customer as active
Placeholders to replace :
customer_id
API DOC
HELP DOC
getCustomers(array)
[GET] /customers?filter_by={filter_by}
filter_by [default: Status.All] Retrieving details of all the customers
Allowed parameters and its allowed values :
1)filter_by : Status.(All | Active | Inactive | Gapps | Crm | NonSubscribers | PortalEnabled | PortalDisabled)
API DOC
HELP DOC
getCustomer(array)
[GET] /customers/{customer_id}
customer_id Retrieving details of a particular customer
PlaceHolder to replace :
customer_id
API DOC
HELP DOC
getCustomerComments(array)
[GET] /customers/{customer_id}/comments
customer_id Retrieving comments of a particular customer
PlaceHolder to replace :
customer_id
HELP DOC
updateCustomer(array)
[PUT] /customers/{customer_id}
customer_id
display_name
salutation
first_name
last_name
email
company_name
phone
mobile
website
twitter
facebook
billing_address
shipping_address
currency_code
notes
payment_terms
payment_terms_label
ach_supported
custom_fields
default_templates
Updating the details of a particular customer
PlaceHolder to replace :
customer_id
API DOC
HELP DOC
deleteCustomer(array)
[DELETE] /customers/{customer_id}
customer_id Delete a particular customer.
PlaceHolder to replace :
customer_id
API DOC
HELP DOC
getCustomerUnusedCredits(array)
[GET] /customers/{customer_id}/unusedcredits
customer_id Unused credit of a particular customer
PlaceHolder to replace :
customer_id
HELP DOC
deactivateCustomers(array)
[POST] /customers/markasinactive?customer_ids={customer_ids}
customer_ids Bulk marking multiple customers as inactive
Placeholders to replace :
customer_ids
customer_ids should be replaced by customer id's seperated by comma
addCustomer(array)
[POST] /customers
display_name
salutation
first_name
last_name
email
company_name
phone
mobile
website
twitter
facebook
billing_address
shipping_address
currency_code
notes
payment_terms
payment_terms_label
ach_supported
custom_fields
default_templates
Creating a new customer
API DOC
HELP DOC
deleteCustomers(array)
[DELETE] /customers?customer_ids={customer_ids}
customer_ids Bulk deleting customers
PlaceHolders to replace :
customer_ids
customer_ids should be passed as a param. Make sure that the customer_ids are seperated by ,(comma)
Eg: customer_ids=112072000001700227,11207200001700228
HELP DOC
deactivateCustomer(array)
[POST] /customers/{customer_id}/markasinactive
customer_id Marking a particular customer as inactive
Placeholders to replace :
customer_id
API DOC
HELP DOC
enableCustomerPaymentReminder(array)
[POST] /customers/{customer_id}/paymentreminder/enable
customer_id Enabling payment reminder for a particular customer
Placeholders to replace :
customer_id
deleteCustomerAddress(array)
[DELETE] /customers/{customer_id}/address/{address_id}
customer_id
address_id
Delete an existing customer's address.
PlaceHolder to replace :
customer_id
address_id
deleteCustomerPaypalAccount(array)
[DELETE] /customers/{customer_id}/paypalaccounts/{paypal_id}
customer_id
paypal_id
To delete a particular PayPal account of a particular customer
PlaceHolders to replace :
customer_id
paypal_id
deleteProduct(array)
[DELETE] /products/{product_id}
product_id Delete an existing product.
PlaceHolder to replace :
product_id
API DOC
HELP DOC
updateProduct(array)
[PUT] /products/{product_id}
product_id
name
description
email_ids
redirect_url
Updating the details of a particular product
PlaceHolder to replace :
product_id
API DOC
HELP DOC
addProduct(array)
[POST] /products
name
description
email_ids
redirect_url
Creating a new product
API DOC
HELP DOC
getProduct(array)
[GET] /products/{product_id}?showchild={showchild}
product_id
showchild [default: true]
Retreiving details of a product
Placeholders to be replaced :
product_id
Allowed parameters and its allowed values :
1)show_child : true | false
If show_child paramter is provided, all the plans, add-ons, couopons created under the product will be retreived.
API DOC
HELP DOC
activateProduct(array)
[POST] /products/{product_id}/markasactive
product_id Marking a particular product as active
Placeholders to replace :
product_id
API DOC
HELP DOC
getProducts(array)
[GET] /products?filter_by={filter_by}
filter_by [default: ProductStatus.All] List of all Products
Allowed parameters and its allowed values :
1)filter_by : ProductStatus.(All | ACTIVE | INACTIVE | search)
API DOC
HELP DOC
deactivateProduct(array)
[POST] /products/{product_id}/markasinactive
product_id Marking a particular product as inactive
Placeholders to replace :
product_id
API DOC
HELP DOC
deleteSalesPerson(array)
[DELETE] /salespersons/{salesperson_id}
salesperson_id Delete an existing salesperson
PlaceHolders to be replaced :
salesperson_id
deleteSalesPersons(array)
[DELETE] /salespersons?salesperson_ids={salesperson_ids}
salesperson_ids Bulk delete multiple sales persons
**PlaceHolders to be replaced : **
salesperson_ids
salesperson_ids should be replaced by sales person ids seperated by commas(,)
getSalesPersons()
[GET] /salespersons
[none] List details of all sales person
deleteCreditnoteRefund(array)
[DELETE] /creditnotes/{creditnote_id}/refunds/{refund_id}
creditnote_id
refund_id
Delete an existing credit note refund
PlaceHolder to replace :
creditnote_id
refund_id
deleteCreditnote(array)
[DELETE] /creditnotes/{creditnote_id}
creditnote_id Delete an existing credit note
PlaceHolder to replace :
creditnote_id
API DOC
deleteCreditnoteComment(array)
[DELETE] /creditnotes/{creditnote_id}/comments/{comment_id}
creditnote_id
comment_id
Delete a comment for a credit note
PlaceHolder to replace :
creditnote_id
comment_id
getRefundCreditnote(array)
[GET] /creditnotes/refunds/{refund_id}
refund_id Details of an existing refund
Placeholders to replace :
refund_id
API DOC
addCreditnoteRefunds(array)
[POST] /creditnotes/{creditnote_id}/refunds
creditnote_id
amount
description
Refund an existing credit note
PlaceHolder to replace :
creditnote_id
HELP DOC
deleteCreditnoteInvoice(array)
[DELETE] /creditnotes/{creditnote_id}/invoices/{creditnote_invoice_id}
creditnote_id
creditnote_invoice_id
Delete the credits applied to invoices
PlaceHolder to replace :
creditnote_id
creditnote_invoice_id
addCreditnoteInvoices(array)
[POST] /creditnotes/{creditnote_id}/invoices
creditnote_id
invoices
Apply credits from credit note to invoices
PlaceHolders to be replaced :
creditnote_id
addInvoiceEmail(array)
[POST] /invoices/{creditnote_id}/email
creditnote_id
to_mail_ids
cc_mail_ids
subject
body
Email a particular credit note
Placeholders to replace :
creditnote_id
openVoidCreditnote(array)
[POST] /creditnotes/{creditnote_id}/converttoopen
creditnote_id Convert a voided credit note to open
PlaceHolder to replace :
creditnote_id
API DOC
voidCreditnote(array)
[POST] /creditnotes/{creditnote_id}/void
creditnote_id Void an existing credit note for a particular customer
PlaceHolder to replace :
creditnote_id
API DOC
getCreditnote(array)
[GET] /creditnotes/{creditnotes_id}
creditnotes_id Retrieve an existing credit note
PlaceHolder to replace :
creditnote_id
API DOC
addCreditnoteCustomFields(array)
[POST] /creditnotes/{creditnote_id}/customfields
creditnote_id
custom_fields
Updating custom fields for a credit note
You can update custom fields only if they are configured
Placeholders to replace :
creditnote_id
addCreditnote(array)
[POST] /creditnotes
customer_id
contact_persons
creditnote_number
ignore_auto_number_generation
reference_number
date
exchange_rate
creditnote_items
custom_fields
notes
terms
template_id
Creating a Credit note for particular customer
API DOC
HELP DOC
deleteCreditnotes(array)
[DELETE] /creditnotes?creditnote_ids={creditnote_ids}
creditnote_ids Delete an existing credit note refund
PlaceHolder to replace :
creditnote_ids
creditnote_ids should be replaced by credit note ids seperated by commas(,)
getProductPlans(array)
[GET] /plans?product_id={product_id}&filter_by={filter_by}
product_id
filter_by [default: PlanStatus.All]
Listing all the plans for a specific product
Allowed parameters and its allowed values :
1)filter_by : PlanStatus.(All | ACTIVE | INACTIVE | search)
2)product_id : Product ID of a product. Allows to list all plans under the product.
3)search_text : Any text value. Allows to search plans matching the text provided.
PlaceHolders to replace :
product_id
API DOC
HELP DOC
updatePlan(array)
[PUT] /plans/{plan_code}
plan_code
name
recurring_price
interval
interval_unit
billing_cycles
trial_period
setup_fee
addons
product_id
account_id
tax_id
description
Updating the details of a particular plan
PlaceHolder to replace :
plan_code
API DOC
HELP DOC
addPlan(array)
[POST] /plans
name
plan_code
product_id
description
interval
interval_unit
billing_cycles
setup_price
trial_period
recurring_price
account_id
tax_id
Creating a new plan
API DOC
HELP DOC
deactivatePlan(array)
[POST] /plans/{plan_code}/markasinactive
plan_code Marking a plan as inactive
Place Holders to replace :
plan_code
API DOC
HELP DOC
activatePlan(array)
[POST] /plans/{plan_code}/markasactive
plan_code Marking a plan as active
Place Holders to replace :
plan_code
API DOC
HELP DOC
getPlan(array)
[GET] /plans/{plan_code}
plan_code Retreiving details of a particular plan
PlaceHolder to replace :
plan_code
API DOC
HELP DOC
deletePlan(array)
[DELETE] /plans/{plan_code}
plan_code Delete an existing plan. A plan can only be deleted if it has no transactions associated with it.
PlaceHolder to replace :
plan_code
API DOC
HELP DOC
getPlans(array)
[GET] /plans?filter_by={filter_by}
filter_by [default: PlanStatus.All] Listing all the plans

Allowed parameters and its allowed values :
1)filter_by : PlanStatus.(All | ACTIVE | INACTIVE | search)
2)product_id : Product ID of a product. Allows to list all plans under the product.
3)search_text : Any text value. Allows to search plans matching the text provided.
API DOC
HELP DOC
addSubscriptionNotes(array)
[POST] /subscriptions/{subscription_id}/notes
subscription_id
description
Notes related to a particular subscription can be added by any user at any time
PlaceHolder to replace :
subscription_id
API DOC
HELP DOC
reactivateSubscription(array)
[POST] /subscriptions/{subscription_id}/reactivate
subscription_id Reactivating a subscription
Only a subscription which is in "non-renewing" status can be reactivated
PlaceHolder to replace :
subscription_id
API DOC
HELP DOC
deleteSubscriptionNote(array)
[DELETE] /subscriptions/{subscription_id}/notes/{note_id}
subscription_id
note_id
Delete a specific note associated to a particular subscription
PlaceHolder to replace :
subscription_id
note_id
API DOC
addSubscription(array)
[POST] /subscriptions
customer_id
plan
addons
coupon_code
payment_terms
payment_terms_label
starts_at
exchange_rate
salesperson_name
reference_id
custom_fields
auto_collect
card
payment_gateways
Creating an online subscription for an already existing customer
API DOC
HELP DOC
cancelSubscriptions(array)
[POST] /subscriptions/bulkcancel?subscription_ids={subscription_ids}
subscription_ids Bulk cancelling multiple subscriptions
You can only cancel 25 subscriptions at a time
PlaceHolder to replace :
subscription_ids
HELP DOC
addSubscriptionLineItem(array)
[POST] /subscriptions/{subscription_id}/lineitems/{plan_code}
subscription_id
plan_code
description
Add/Edit description to a particular plan in the line items list
PlaceHolder to replace :
subscription_id
plan_code
API DOC
HELP DOC
deleteSubscriptionCard(array)
[DELETE] /subscriptions/{subscription_id}/card
subscription_id Delete a card associated with the subscription. Once removed, the subscription will become an offline subscription.
PlaceHolder to replace :
subscription_id
API DOC
updateSubscription(array)
[PUT] /subscriptions/{subscription_id}
subscription_id Updating the details of a particular subscription
PlaceHolder to replace :
subscription_id
API DOC
HELP DOC
addSubscriptionBankAccount(array)
[POST] /subscriptions/{subscription_id}/bankaccount
subscription_id
auto_collect
account_id
Associate an existing bank account/Update to an existing bank account with a subscription
PlaceHolder to replace :
subscription_id
HELP DOC
getSubscriptions(array)
[GET] /subscriptions?filter_by={filter_by}&customer_id={customer_id}
filter_by [default: SubscriptionStatus.All]
customer_id
Listing all the subscriptions
Allowed parameters and its allowed values :
1)filter_by : SubscriptionStatus.(All | IN_PROGRESS | TRIAL | FUTURE | LIVE | UNPAID | PAST_DUE | NON_RENEWING | CANCELLED | CANCELLED_FROM_DUNNING | EXPIRED | CREATION_FAILED | TRIAL_EXPIRED | CANCELLED_THIS_MONTH | CANCELLED_LAST_MONTH | ACTIVE)
SubscriptionMode.(ONLINE | OFFLINE)
2)customer_id : Customer ID of a customer. Lists all invoices of a customer.
API DOC
HELP DOC
setSubscriptionOnline(array)
[POST] /subscriptions/{subscription_id}/autocollect
subscription_id
auto_collect [default: true]
Change a particular subscription to online mode
PlaceHolder to replace :
subscription_id
API DOC
HELP DOC
getSubscription(array)
[GET] /subscriptions/{subscription_id}
subscription_id Getting the details about a particular subscription
PlaceHolder to replace :
subscription_id
API DOC
HELP DOC
addSubscriptionOnetimeAddon(array)
[POST] /subscriptions/{subscription_id}/buyonetimeaddon
subscription_id
addons
exchange_rate
coupon_code
Include a one-time addon to a particular subscription
PlaceHolder to replace :
subscription_id
API DOC
HELP DOC
addOfflineSubscription(array)
[POST] /subscriptions
customer_id
plan
addons
coupon_code
starts_at
exchange_rate
payment_terms
payment_terms_label
salesperson_name
reference_id
custom_fields
auto_collect [default: false]
payment_gateways
Creating an offline subscription for an already existing customer
API DOC
HELP DOC
addSubscriptionCoupon(array)
[POST] /subscriptions/{subscription_id}/coupons/{coupon_code}
subscription_id
coupon_code
Associating a coupon to a paricular subscription
PlaceHolder to replace :
subscription_id
coupon_code
API DOC
HELP DOC
deleteSubscription(array)
[DELETE] /subscriptions/{subscription_id}
subscription_id Deleting an existing subscription
PlaceHolder to replace :
subscription_id
API DOC
HELP DOC
getSubscriptionScheduledChanges(array)
[GET] /subscriptions/{subscription_id}/scheduledchanges
subscription_id Retrieving the scheduled changes of a particular subscription
PlaceHolder to replace :
subscription_id
API DOC
HELP DOC
addSubscriptionCard(array)
[POST] /subscriptions/{subscription_id}/card
subscription_id
card_id
auto_collect
Associate/Update card with an existing card for a particular subscription
PlaceHolder to replace :
subscription_id
API DOC
HELP DOC
getSubscriptionRecentActivities(array)
[GET] /subscriptions/{subscription_id}/recentactivities
subscription_id Retrieving all activities of a particular subscription
PlaceHolder to replace : subscription_id
API DOC
HELP DOC
getSubscriptionNotes(array)
[GET] /subscriptions/{subscription_id}/notes
subscription_id Retrieving notes of a particular subscription
PlaceHolder to replace :
subscription_id
HELP DOC
deleteSubscriptionScheduledChanges(array)
[DELETE] /subscriptions/{subscription_id}/scheduledchanges
subscription_id Dropping the scheduled changes of a particular subscription
PlaceHolder to replace :
subscription_id
addSubscriptionCustomFields(array)
[POST] /subscriptions/{subscription_id}/customfields
subscription_id
custom_fields
Update custome fields for a particular subscription
PlaceHolder to replace : subscription_id
API DOC
HELP DOC
addSubscriptionNewBankAccount(array)
[POST] /subscriptions/{subscription_id}/bankaccount
subscription_id
bank_account
auto_collect
Associate/Update bank account with a new bank account for a particular subscription
PlaceHolder to replace :
subscription_id
HELP DOC
addSubscriptionsCompute(array)
[POST] /subscriptions/compute
subscription_id
plan
addons
coupon_code
starts_at
exchange_rate
payment_terms
payment_terms_label
salesperson_name
reference_id
custom_fields
auto_collect
payment_gateways
Preview amount of the subscription and invoice. This can be called while both at time of creating a subscription/updating a subscription.
For compute during update, you will have to pass the subscription_id node in the JSON body
HELP DOC
setSubscriptionOffline(array)
[POST] /subscriptions/{subscription_id}/autocollect
subscription_id
auto_collect [default: false]
Change a particular subscription to offline mode
PlaceHolder to replace :
subscription_id
API DOC
HELP DOC
updateSubscriptionCard(array)
[POST] /subscriptions/{subscription_id}/card
subscription_id
card
auto_collect
Associate/Update card with a new card for a particular subscription
PlaceHolder to replace :
subscription_id
API DOC
HELP DOC
addSubscriptionOnetimeCharge(array)
[POST] /subscriptions/{subscription_id}/charge
subscription_id
amount
description
Charge a one-time amount for a subscription
PlaceHolder to replace :
subscription_id
API DOC
HELP DOC
addNewCustomerSubscription(array)
[POST] /subscriptions
customer
card
starts_at
exchange_rate
plan
addons
custom_fields
payment_terms
payment_terms_label
coupon_code
auto_collect
salesperson_name
reference_id
payment_gateways
Creating a subscription for a new customer
This works as a quick-create
Customer while creating the subscription
API DOC
HELP DOC
cancelSubscriptionNow(array)
[POST] /subscriptions/{subscription_id}/cancel?cancel_at_end={cancel_at_end}
subscription_id
cancel_at_end [default: false]
Cancelling the subscription immediately
PlaceHolder to replace :
subscription_id
API DOC
HELP DOC
addSubscriptionPaypalAccount(array)
[POST] /subscriptions/{subscription_id}/paypalaccount
subscription_id
paypal_id
Associate/Update PayPal account with an existing PayPal account for a particular subscription
PlaceHolder to replace :
subscription_id
HELP DOC
postponeSubscription(array)
[POST] /subscriptions/{subscription_id}/postpone
subscription_id
renewal_at
Renewal date refers to the billing date of the subsequent term.
You can postpone date of renewal of the subscription by specifying an appropriate date on which the customer should be billed. No prorated charges will be applied. Billing date for the subscription will be replaced by the date which you provide
PlaceHolder to replace :
subscription_id
API DOC
HELP DOC
deleteSubscriptionBankAccount(array)
[DELETE] /subscriptions/{subscription_id}/bankaccount
subscription_id Delete a bank account associated with the subscription. Once removed, the subscription will become an offline subscription.
PlaceHolder to replace :
subscription_id
addSubscriptionContactPersons(array)
[POST] /subscriptions/{subscription_id}/contactpersons
subscription_id
contactpersons
Associate an existing contact person with a particular subscription
PlaceHolder to replace :
subscription_id
API DOC
HELP DOC
addSubscriptionReference(array)
[POST] /subscriptions/{subscription_id}/reference
subscription_id
reference_id
Update reference id to easily identify and keep track of your subscription
PlaceHolder to replace :
subscription_id
API DOC
HELP DOC
getCustomersSubscriptions(array)
[GET] /subscriptions?filter_by={filter_by}&customer_id={customer_id}
filter_by [default: SubscriptionStatus.All]
customer_id
Listing all the subscriptions
Allowed parameters and its allowed values :
1)filter_by : SubscriptionStatus.(All | IN_PROGRESS | TRIAL | FUTURE | LIVE | UNPAID | PAST_DUE | NON_RENEWING | CANCELLED | CANCELLED_FROM_DUNNING | EXPIRED | CREATION_FAILED | TRIAL_EXPIRED | CANCELLED_THIS_MONTH | CANCELLED_LAST_MONTH | ACTIVE)
SubscriptionMode.(ONLINE | OFFLINE)
2)customer_id : Customer ID of a customer. Lists all invoices of a customer.

PlaceHolder to be placed :

customer_id
API DOC
HELP DOC
addSubscriptionAddonLineItem(array)
[POST] /subscriptions/{subscription_id}/lineitems/{addon_code}
subscription_id
addon_code
description
Add/Edit description to a particular add-on in the line items list
PlaceHolder to replace :
subscription_id
addon_code
API DOC
HELP DOC
deleteSubscriptionCoupons(array)
[DELETE] /subscriptions/{subscription_id}/coupons
subscription_id To remove coupon associated with a subscription
PlaceHolder to replace :
subscription_id
API DOC
cancelSubscription(array)
[POST] /subscriptions/{subscription_id}/cancel?cancel_at_end={cancel_at_end}
subscription_id
cancel_at_end [default: true]
Cancelling the subscription at the end of term of subscription
PlaceHolder to replace :
subscription_id
API DOC
HELP DOC
addSubscriptionSalesPerson(array)
[POST] /subscriptions/{subscription_id}/salesperson
subscription_id
salesperson_name
Update sales person associated with a particular subscription
PlaceHolder to replace :
subscription_id
API DOC
HELP DOC
getCustomerCard(array)
[GET] /customers/{customer_id}/cards/{card_id}
customer_id
card_id
Retrieving details of a particular card for a particular customer
Placeholders to replace :
customer_id
card_id
API DOC
HELP DOC
deleteCustomerCard(array)
[DELETE] /customers/{customer_id}/cards/{card_id}
customer_id
card_id
To delete a particular credit card for a customer
PlaceHolders to replace :
customer_id
card_id
API DOC
addCustomerCards(array)
[POST] /customers/{customer_id}/cards
customer_id
card_number
expiry_month
expiry_year
cvv_number
first_name
last_name
street
city
state
country
zip
payment_gateway
Creating a new card for an existing customer
PlaceHolder to replace : customer_id
API DOC
getCustomerCards(array)
[GET] /customers/{customer_id}/cards
customer_id Retrieving details of all cards for a particular customer
Placeholders to replace :
customer_id
API DOC
HELP DOC
updateCustomerCard(array)
[PUT] /customers/{customer_id}/cards/{card_id}
customer_id
card_id
card_number
expiry_month
expiry_year
cvv_number
first_name
last_name
street
city
state
country
zip
payment_gateway
Editing the existing Credit card information for a customer
PlaceHolders to be replaced :
customer_id
card_id

API DOC
activateCoupon(array)
[POST] /coupons/{coupon_code}/markasactive
coupon_code Marking a coupon as active
Place Holders to replace :
coupon_code
API DOC
HELP DOC
deleteCoupon(array)
[DELETE] /coupons/{coupon_code}
coupon_code Delete an existing coupon.
PlaceHolders to replace :
coupon_code
API DOC
HELP DOC
updateCoupon(array)
[PUT] /coupons/{coupon_code}
coupon_code
name
description
max_redemption
expiry_at
Updating the details of a particular coupon
PlaceHolder to replace :
coupon_code
API DOC
HELP DOC
deactivateCoupon(array)
[POST] /coupons/{coupon_code}/markasinactive
coupon_code Marking a coupon as inactive
Place Holders to replace :
coupon_code
API DOC
HELP DOC
addCoupon(array)
[POST] /coupons
coupon_code
name
description
type
discount_by
discount_value
product_id
max_redemption
expiry_at
apply_to_plans
plans
apply_to_addons
addons
Creating a new coupon
API DOC
HELP DOC
getCoupons(array)
[GET] /coupons?filter_by={filter_by}&product_id={product_id}
filter_by [default: CouponStatus.All]
product_id
Retrieving details of all coupons
Allowed parameters and its allowed values :
1)filter_by : CouponStatus.(All | ACTIVE | INACTIVE | EXPIRED),search
2)product_id : Product ID of a product. Allows to list all coupons under the product.
3)search_text : Any text value. Allows to search coupons matching the text provided
API DOC
HELP DOC
getCoupon(array)
[GET] /coupons/{coupon_code}
coupon_code Retrieving details of a particular coupon
PlaceHolder to replace : coupon_code
API DOC
HELP DOC
get()
[GET] /
[none] Lists all resources API endpoint of Zoho Subscriptions
getEvent(array)
[GET] /events/{event_id}
event_id Retrieving details of an existing event
Placeholders to replace :
event_id
API DOC
getEvents(array)
[GET] /events?filter_by={filter_by}
filter_by [default: EventTime.All] Retrieving list of all events
Allowed parameters and its allowed values :
1)filter_by : EventTime.(All | LastMonth | LastWeek | Today | ThisWeek | ThisMonth | CustomDate)
EventType.(All | subscription_created | subscription_upgraded | subscription_downgraded | subscription_renewed | subscription_cancelled | subscription_expiring | subscription_expired | onetimeaddon_purchased | subscription_activation | subscription_reactivated | invoice_notification | payment_thankyou | payment_declined | payment_refunded | trial_expiring | subscription_cancelling | card_expired | card_expiring | subscription_ahead | subscription_deleted | creditnote_added | creditnote_updated | creditnote_deleted | card_deleted | billing_date_changed)
InvoiceDate.(ThisMonth | PreviousMonth)
2)event_start_date : Custom start date in YYYY-MM-DD format.
3)event_end_date : Custom end date in YYYY-MM-DD format.
4)sort_column : event_time | event_id | notified_time
API DOC
addPayment(array)
[POST] /payments
customer_id
amount
date
payment_mode
description
reference_number
invoices
exchange_rate
bank_charges
tax_account_id
account_id
custom_fields
Recording a new offline payment for a customer
API DOC
HELP DOC
getPayment(array)
[GET] /payments/{payment_id}
payment_id Retrieve details of a particular payment
Placeholders to replace :
payment_id
API DOC
addPaymentRefunds(array)
[POST] /payments/{payment_id}/refunds
payment_id
amount
description
A new credit note is created for the amount to be refund. Refund is then made for the credit note.
Placeholders to replace :
payment_id
HELP DOC
deletePayment(array)
[DELETE] /payments/{payment_id}
payment_id Delete an existing payment.
Placeholders to replace :
payment_id
API DOC
HELP DOC
addProductCustomFields(array)
[POST] /products/{product_id}/customfields
product_id
custom_fields
Updating custom fields for a payment
You can update custom fields only if they are configured
Placeholders to replace :
payment_id
updatePayment(array)
[PUT] /payments/{payment_id}
payment_id
customer_id
amount
date
payment_mode
description
reference_number
invoices
exchange_rate
bank_charges
tax_account_id
account_id
custom_fields
Update an existing new payment
Placeholders to replace :
payment_id
API DOC
getWebhook(array)
[GET] /webhooks/{webhook_id}
webhook_id Retrieving details of a particular webhooks that has been triggered
PlaceHolders to replace :
webhook_id
getWebhooks()
[GET] /webhooks
[none] Retrieving details of all webhooks triggered
Allowed parameters and its allowed values :
1)filter_by : WebhookInitiatedTime.(All | LastMonth | LastWeek | Today | ThisWeek | ThisMonth | CustomDate)
2)status_filter : all | success | failure
3)sort_column : last_updated_time | webhook_id
4)webhook_initiated_start_date : Webhook Custom initiated start date. Needed if CustomDate option is chosen for filter_by param.
5)webhook_initiated_end_date : Webhook Custom initiated end date. Needed if CustomDate option is chosen for filter_by param.
updateCustomerContactPerson(array)
[PUT] /customers/{customer_id}/contactpersons/{contactperson_id}
customer_id
contactperson_id
salutation
first_name
last_name
email
phone
mobile
fax
twitter
designation
department
Updating a particular contact person for a particular customer
Placeholders to replace :
customer_id
contactperson_id
API DOC
HELP DOC
addCustomerContactPersons(array)
[POST] /customers/{customer_id}/contactpersons
customer_id
salutation
first_name
last_name
email
phone
mobile
fax
twitter
designation
department
Creating a contact person for an existing customer
Placeholders to replace :
customer_id
API DOC
HELP DOC
getCustomerContactPersons(array)
[GET] /customers/{customer_id}/contactpersons
customer_id List of all contact persons for a particular customer
Placeholders to replace :
customer_id
API DOC
HELP DOC
addCustomerPrimaryContactPerson(array)
[POST] /customers/{customer_id}/contactpersons/{contactperson_id}/primary
customer_id
contactperson_id
salutation
first_name
last_name
email
phone
mobile
fax
twitter
facebook
Mark a contact person as primary contact for a customer
Placeholders to replace :
customer_id
contactperson_id
deleteCustomerContactPerson(array)
[DELETE] /customers/{customer_id}/contactpersons/{contactperson_id}
customer_id
contactperson_id
Delete an existing contact person.
Placeholders to replace :
customer_id
contactperson_id
API DOC
HELP DOC
getCustomerContactPerson(array)
[GET] /customers/{customer_id}/contactpersons/{contactperson_id}
customer_id
contactperson_id
Retrieving details of a particular contact person for a particular customer
Placeholders to replace :
customer_id
contactperson_id
API DOC
HELP DOC
deleteCustomerBankAccount(array)
[DELETE] /customers/{customer_id}/bankaccounts/{account_id}
customer_id
account_id
To delete a particular Bank account of a particular customer
PlaceHolders to replace :
customer_id
account_id
updateCustomerBankAccount(array)
[PUT] /customers/{customer_id}/bankaccounts/{account_id}
customer_id
account_id
account_number
routing_number
account_type
bank_name
first_name
last_name
accept_license
authorization_type
payment_gateway
Editing the existing Bank Account information for a particular customer
PlaceHolders to replace :
customer_id
account_id
addCustomerBankAccounts(array)
[POST] /customers/{customer_id}/bankaccounts
customer_id
account_number
account_type
routing_number
bank_name
first_name
last_name
accept_license
authorization_type
payment_gateway
Creating a new bank account for a particular customer
PlaceHolder to replace :
customer_id
getCustomerBankAccount(array)
[GET] /customers/{customer_id}/bankaccounts/{account_id}
customer_id
account_id
Retrieving details of a particular bank account for a particular customer
Placeholders to replace :
customer_id
account_id
API DOC
HELP DOC
activateAddon(array)
[POST] /addons/{addon_code}/markasactive
addon_code Marking an addon as active
Place Holders to replace :
addon_code
API DOC
HELP DOC
addAddon(array)
[POST] /addons
name
addon_code
description
applicable_to_all_plans
plans
type
unit_name
pricing_scheme [default: package]
price_brackets
interval_unit
product_id
account_id
tax_id
Creating a new addon of package pricing scheme.
API DOC
HELP DOC
To know more about Pricing Scheme
getAddon(array)
[GET] /addons/{addon_code}
addon_code Getting the Details of a particular add-on
PlaceHolder to replace :
addon_code
API DOC
HELP DOC
getAddons(array)
[GET] /addons?filter_by={filter_by}&product_id={product_id}&plan_code={plan_code}
filter_by [default: AddonStatus.All]
product_id
plan_code
Listing all the add-ons
Allowed parameters and its allowed values :
1)filter_by : AddonStatus.(All | ACTIVE | INACTIVE | ONETIME | RECURRING), search
2)product_id : Product ID of a product. Allows to list all plans under the product.
3)plan_code : Plan code. Filters add-ons associated to the provided plan code.
4)search_text : Any text value. Allows to search add-ons matching the text provided
API DOC
HELP DOC
getProductAddons(array)
[GET] /addons?product_id={product_id}&filter_by={filter_by}&plan_code={plan_code}
product_id
filter_by [default: AddonStatus.All]
plan_code
Listing all the add-ons of a particular product
PlaceHolders to replace: product_id
Allowed filter_by values
1)filter_by : AddonStatus.(All | ACTIVE | INACTIVE | ONETIME | RECURRING), search
2)product_id : Product ID of a product. Allows to list all plans under the product.
3)plan_code : Plan code. Filters add-ons associated to the provided plan code.
4)search_text : Any text value. Allows to search add-ons matching the text provided
HELP DOC
addTireAddon(array)
[POST] /addons
name
addon_code
description
applicable_to_all_plans
plans
type
pricing_scheme [default: tire]
unit_name
price_brackets
interval_unit
product_id
account_id
tax_id
Creating a new addon of tier pricing scheme.
API DOC
HELP DOC
To know more about Pricing Scheme
addUnitAddon(array)
[POST] /addons
name
addon_code
description
applicable_to_all_plans
plans
type
pricing_scheme [default: unit]
unit_name
price_brackets
interval_unit
product_id
account_id
tax_id
Creating a new addon of unit pricing scheme.
API DOC
HELP DOC
To know more about Pricing Scheme
updateAddon(array)
[PUT] /addons/{addon_code}
addon_code
name
unit_name
pricing_scheme
price_brackets
type
interval_unit
applicable_to_all_plans
plans
product_id
account_id
description
tax_id
Updating the details of a particular addon
PlaceHolder to replace :
addon_code
API DOC
HELP DOC
getPlanAddons(array)
[GET] /addons?plan_code={plan_code}&filter_by={filter_by}
plan_code
filter_by [default: AddonStatus.All]
Listing all the add-ons associated to a particular plan
PlaceHolders to replace:
plan_code
Allowed filter_by values
1)filter_by : AddonStatus.(All | ACTIVE | INACTIVE | ONETIME | RECURRING), search
2)product_id : Product ID of a product. Allows to list all plans under the product.
3)plan_code : Plan code. Filters add-ons associated to the provided plan code.
4)search_text : Any text value. Allows to search add-ons matching the text provided
HELP DOC
addVolumeAddon(array)
[POST] /addons
name
addon_code
description
applicable_to_all_plans
plans
type
pricing_scheme [default: volume]
unit_name
price_brackets
interval_unit
product_id
account_id
tax_id
Creating a new addon of volume pricing scheme.
API DOC
HELP DOC
To know more about Pricing Scheme
deleteAddon(array)
[DELETE] /addons/{addon_code}
addon_code Deleting a particular addon
PlaceHolder to replace :

addon_code
API DOC
HELP DOC
deactivateAddon(array)
[POST] /addons/{addon_code}/markasinactive
addon_code Marking an addon as inactive
Place Holders to replace :
addon_code
API DOC
HELP DOC
addInvoiceCollect(array)
[POST] /invoices/{invoice_id}/collect
invoice_id
card_id
Charge a customer for an invoice with an existing card
Placeholders to replace :
invoice_id
API DOC
updateInvoiceAddress(array)
[PUT] /invoices/{invoice_id}/address
invoice_id
billing_address
shipping_address
Update shipping and billing address of an invoice
Placeholders to replace :
invoice_id
API DOC
getInvoice(array)
[GET] /invoices/{invoice_id}
invoice_id Retrieve details of an existing invoice
Placeholders to replace : invoice_id
API DOC
downloadInvoiceAsPdf(array)
[GET] /invoices/{invoice_id}?accept={accept}
invoice_id
accept [default: pdf]
Download a particular invoice as a pdf file
Placeholders to replace :
invoice_id
setInvoicesAsSent(array)
[POST] /invoices/sent?invoice_ids={invoice_ids}
invoice_ids Bulk making invoices as Sent
Placeholders to replace :
invoice_ids
getInvoices(array)
[GET] /invoices?filter_by={filter_by}
filter_by [default: Status.All] List of all invoices
Allowed parameters and its allowed values :
1)filter_by : Status.(All | Sent | Draft | OverDue | Paid | Void | Unpaid | PartiallyPaid | Viewed)
ACHPaymentInitiated
InvoiceDate.(ThisMonth | PreviousMonth)
2)customer_id : Customer ID of a customer. Lists all invoices of a customer.
3)subscription_id : Subscription ID of a subscription. Lists all invoices of a subscription.

API DOC
addInvoiceSalesPerson(array)
[POST] /invoices/{invoice_id}/salesperson
invoice_id
salesperson_name
Update sales person for a particular invoice
Placeholders to replace :
invoice_id
API DOC
addInvoiceComments(array)
[POST] /invoices/{invoice_id}/comments
invoice_id
description
Add comments to an invoice
Placeholders to replace :
invoice_id
enableInvoicePaymentReminder(array)
[POST] /invoices/{invoice_id}/paymentreminder/enable
invoice_id Enabling payment reminder for a particular invoice
Placeholders to replace :
invoice_id
setInvoiceAsSent(array)
[POST] /invoices/{invoice_id}/sent
invoice_id Making a draft invoice as Sent
Placeholders to replace :
invoice_id
openInvoice(array)
[POST] /invoices/{invoice_id}/converttoopen
invoice_id Change the status of an invoice to open
Placeholders to replace :
invoice_id
API DOC
getInvoiceRecentActivities(array)
[GET] /invoices/{invoice_id}/recentactivities
invoice_id Retrieving recent activities of a particular invoice
Placeholders to replace :
invoice_id
emailInvoice(array)
[POST] /invoices/{invoice_id}/email
invoice_id
to_mail_ids
cc_mail_ids
subject
body
Email a particular invoice
Placeholders to replace :
invoice_id
deleteInvoiceComment(array)
[DELETE] /invoices/{invoice_id}/comments/{comment_id}
invoice_id
comment_id
Deleting a particular comment of an invoice
Placeholders to replace :
invoice_id
comment_id
addInvoiceCustomFields(array)
[POST] /invoices/{invoice_id}/customfields
invoice_id
custom_fields
Updating custom fields for an invoice
You can update custom fields only if they are configured
Placeholders to replace :
invoice_id
API DOC
disableInvoicePaymentReminder(array)
[POST] /invoices/{invoice_id}/paymentreminder/disable
invoice_id Stop all payment reminder for a particular invoice
Placeholders to replace :
invoice_id
getBankAccountPendingInvoices(array)
[GET] /bankaccounts/{account_id}/pendinginvoices
account_id Retrieving ACH pending invoices of a particular bank account
Placeholders to replace :
account_id
getInvoiceComments(array)
[GET] /invoices/{invoice_id}/comments
invoice_id Retrieving comments of a particular invoice
Placeholders to replace :
invoice_id
writeoffInvoice(array)
[POST] /invoices/{invoice_id}/writeoff
invoice_id Write off a particularinvoice
Placeholders to replace :
invoice_id
API DOC
cancelInvoiceWriteoff(array)
[POST] /invoices/{invoice_id}/cancelwriteoff
invoice_id Cancel write off for a particular invoice
Placeholders to replace :
invoice_id
API DOC
deleteInvoiceCreditsApplied(array)
[DELETE] /invoices/{invoice_id}/creditsapplied/{creditnotes_invoice_id}
invoice_id
creditnotes_invoice_id
Deleting an existing credit applied to the invoice.
Placeholders to replace :
invoice_id
creditnotes_invoice_id
deleteInvoice(array)
[DELETE] /invoices/{invoice_id}
invoice_id Deleting an existing invoice.
Placeholders to replace :
invoice_id
HELP DOC
addBankAccountCharge(array)
[POST] /invoices/{invoice_id}/collect
invoice_id
account_id
Charge a customer for an invoice with an existing bank account
Placeholders to replace :
invoice_id
API DOC
setInvoicePaymentDate(array)
[POST] /invoices/{invoice_id}/paymentdate
invoice_id
payment_expected_date
stop_reminder_until_payment_expected_date
Update expected payment date fop the invoice. Reminders won't be sent till the date specified
Placeholders to replace :
invoice_id
voidInvoice(array)
[POST] /invoices/{invoice_id}/void
invoice_id Making an invoice as void
Placeholders to replace :
invoice_id
API DOC
addInvoiceCredits(array)
[POST] /invoices/{invoice_id}/credits
invoice_id
apply_creditnotes
Use the customer's open credits to the invoice
PlaceHolders to be replaced :
invoice_id
addInvoiceLineItems(array)
[POST] /invoices/{invoice_id}/lineitems
invoice_id
invoice_items
Add items to a pending invoice
Placeholders to replace :
invoice_id
API DOC
getPricebooks()
[GET] /pricebooks
[none] Retreiving list of all pricebooks
deleteOrganization(array)
[DELETE] /organizations/{organization_id}
organization_id Deleting a particular Organization
PlaceHolders to be replaced :
organization_id
getOrganizations()
[GET] /organizations
[none] Retrieving Details of all Organizations