This guide will help you with the following:
- Create Pricing Plans in the Developer Console
- Setup in Zoho Subscriptions
- Add Plans in Zoho Subscriptions
- Create Add-ons
- Create Webhooks
- Add a Custom Field
- Create a Broker Application
- Subscription APIs
The pricing for your Vertical Solution plays a decisive role in attracting customers. You may need to support different customer-friendly pricing plans. You can use subscription management software such as Zoho Subscriptions to build specialized pricing plans which are tailored to your needs. For example, you can create profile-based pricing which allow customers to buy licenses for specific profiles in an organization. You can take control of your product's pricing and subscriptions and centralize pricing to consolidate payments for multiple applications. Imagine that you have a real estate solution in which you have integrated a telephony application. In this case, you will need to manage payments for your solution and for the third-party vendor of the telephony app. You can combine these two processes into one which handles both payments.
To achieve this, you will need to construct a middleware or
broker application to handle the communication between the Developer Console and your subscription management software. The broker application must have GUI for the user to create, modify, cancel, and view subscriptions.
The three main steps for setting up pricing and subscription management are:
- Create pricing plans in the Developer Console
- Generate plan codes, add-on codes, subscription APIs, and ZAPIKEY.
- Setup in the subscription management software
- Create plans and associated add-ons using the Plan and Add-on Codes.
- Create webhooks to notify the broker application when subscriptions are created, modified, or canceled by customers.
- Create a custom field for ZUID.
- Creating a Broker Application
- Create a broker application for sending subscription details from your Subscription Management Software to Developer Console.
- Use the subscription APIs to send Developer Console details for processing a subscription request (add, modify, or cancel).
- Host the application and enter the URL of the landing page of the application in the Manage Subscription URL field.
Create Pricing Plans in Developer Console
- Log in to Zoho Developer Console and click Vertical Solutions.
- Create a new app.
- Click Pricing in the left pane.
-
Click Create Plan for Subscription Management Platform.
- In the New Plan page, do the following:
- Enter a name in Specify Plan Name.
- For Select Module, choose the modules you want to give the customers access to. Select the modules from the List of Modules list box and move it to the Selected Modules list box using the arrow button.
- For Select Extension, select the checkbox of the Zoho App you want to include in this pricing plan.
- Click Save.
You can check the details of the setup process for pricing and subscription management by clicking the progress indicator [
] at top right hand corner of the page at any time.
The following details will be generated for the newly created plan:
Authtoken: The authentication token to be used by the Broker application for communicating with Zoho Subscriptions. Click the View Authtoken button in the top right hand corner to view this value.
Add Subscription*: The broker application needs to invoke this API when a new subscription plan is created. When the user creates a new subscription using the broker application, this API should be used to send details of the newly created subscription to Developer Console.
Modify Subscription: The broker application needs to invoke this API when a subscription plan is upgraded or downgraded. When the user upgrades or downgrades a subscription using the broker application, this API should be used to send details of the modified subscription to Developer Console.
Cancel Subscription: The broker application needs to invoke this API when a subscription plan is canceled. When the user cancels a subscription using the broker application, this API should be used to send details of the subscription cancellation to Developer Console.
Plan Code (Yearly): The identifier to use when creating a yearly plan for your product in your subscription management software. The format of the plan code is appdomain_planid_Y.
Plan Code (Monthly): The identifier to use when creating a monthly plan for your product in your subscription management software. The format of the plan code is appdomain_planid.
The documentation for the above subscription APIs is given
here.
The below values will be common for all plans:
ZAPIKEY: The key used to authenticate the response flow from the subscription management software to the broker application and the Developer Console.
Manage Subscription URL: The landing page URL of the broker application. This URL is for the GUI of your broker application where customers create, modify, cancel, and view subscriptions. Click the edit icon [
], enter this URL, and click the save icon [
]. All the strips in the progress indicator will be highlighted after this value is entered.
Storage Add-on Monthly code: The identifier to use when creating a storage add-on for a monthly plan.
Storage Add-on Monthly cost: The price of a storage add-on for a monthly plan.
Storage Add-on Yearly code: The identifier to use when creating a storage add-on for a yearly plan.
Storage Add-on Yearly cost: The price of a storage add-on for a yearly plan.
Add new plans by clicking the
Add Plan button. Modify details of a plan by clicking the edit [
] icon next to the plan name. Delete a plan by clicking the [
] icon next to the plan name.
Setup in Zoho Subscriptions
In Zoho Subscriptions, create the following:
- Plans corresponding to the ones created in your vertical application
- Add-ons for the plans
- Webhooks
- Custom field
Add plans in Zoho Subscriptions
- Log in to your Zoho Subscriptions account.
- Create a product.
The product name must be the same as the app domain name.
- Select the product and click Add Plan.
- In the Add Plan form, add the following details and click Save:
- A name in the Plan Name field.
- Enter the code in the Plan Code field.
This is the code generated after creating a plan for your Vertical solution. For a monthly plan, use the Plan Code (Monthly) code and for a yearly plan use Plan Code (Yearly).
- Enter the Price.
- In the Bill Every field, enter values for the billing interval and the interval frequency
- In the Billing Cycles field, enter the number of times the customer needs to be charged.
If you choose Auto renews until canceled, the customer will be charged until the subscription is canceled by the customer or you.
If you choose Expires after a specified no. of billing cycles, you can specify the number of billing cycles after which the plan will expire.
Create add-ons
- Log in to your Zoho Subscriptions account.
- Click Products in the left pane.
- Select the plan you want to include the add-on for and click Add Addon in the top right corner.
- In the Add Addon page, enter the following details and click Save:
- A name in Addon Name field.
- The code in Addon Code field.
This is the Storage Add-on code generated after creating a plan for your Vertical solution. For a monthly plan, use the Storage Add-on Monthly code and for a yearly plan use the Storage Add-on Yearly code.
- A Unit Name to specify how to refer to one unit of the addon.
- Select a value for Addon Type to indicate whether the customer is to be charged only once or on a recurring basis.
If you select Recurring, the Pricing Interval field will be displayed.
- For Pricing Interval, choose the frequency to charge the customer at for the add-on.
- Select a Pricing Scheme.
- The Price of the Add-on.
- Select the Associated Plans to link the add-on to.
By default, the All Plans checkbox will be selected. You can uncheck this and select only the plans you want to link the add-on to.
Create webhooks
Create webhooks in Zoho Subscriptions to notify the broker application when subscriptions are added, modified, or canceled by the customer.
- Log in to your Zoho Subscriptions account.
- Click the Settings icon [] in the top right corner and select Automation.
- In the Webhooks page, click New Webhook.
- In the New Webhook page do the following and then click Save:
- Enter an identifier for the webhook in the Name field.
- Select Subscriptions for the Module field.
- In the Predefined Events section, select the checkbox for New Subscription. While creating or modifying a subscription, select Upgrade Subscription and Downgrade Subscription.
- In the URL & Parameters field, enter the webhook URL.
- In the Headers section, enter the key as zapikey and its value (obtained here) in the corresponding value field.
Add a custom field
You need to create a custom variable for the zuid or Zoho User ID, an ID that is used to uniquely identify a user.
- Log in to your Zoho Subscriptions account.
- Click the Settings icon [] in the top right corner and select Preferences.
- Select Customer in the left pane for Preferences.
- Go to the Custom Fields tab and click New Custom Field.
- In the New Custom Field overlay, provide the following details and click Save:
- Set the Label Name as zuid.
- Select Data Type as Text.
- Select Yes for Show in Customer Portal/HostedPage field.
Keep the remaining values as they are.
Create a Broker Application
You need to create a broker application to perform the following functions:
Provide a GUI for managing subscriptions
- Provide a GUI for creating, modifying, canceling, and viewing subscriptions for your vertical solution. When the customer creates, modifies, or cancels subscriptions, the necessary API calls must be made to your subscription management software. For Zoho Subscriptions, the authtoken (created here) is used for making the API calls.
- The landing page of the Broker application needs to be linked to the Subscription link (present in the user profile menu) in your Vertical Solution. Each time the broker application is accessed during a subscription purchase or updation, certain parameter values (shown below) will be sent to it from the Vertical Solution. These parameters need to be stored within the broker application for later use in the Subscription APIs.
- {
- "display_name":"display_name",
- "first_name":"first_name",
- "last_name":"last_name",
- "email":"email",
- "company_name":"company_name",
- "custom_fields":{
- "zgid":"zgid",
- "zuid":"zuid"
- },
- "subscription_id":"subscription_id",
- "hostedPageId":"hostedPageId"
- }
Fetch the subscription details from the Subscription Management Software
Operations are carried out in the subscription management software based on the user's action (create, modify, or cancel) in the broker application. The output of these operations will be sent back to the Broker Application through the
webHook URLs configured.
Send the subscription details to Developer Console
The broker application has to filter out the necessary information for processing the subscription request from the subscription details received from the subscription management software and send it to the Developer Console. The
Subscription APIs are used for this purpose.
Subscription APIs
Add Subscription
Request URL
Request Method : POST
Request JSON
Key
|
Description
|
|
Zoho User ID, the unique ID that is used to identify a user.
|
NO_OF_USERS
string, mandatory
|
The number of subscription licenses bought by an user.
|
FREQUENCY
string, mandatory
|
The billing frequency for the subscription. The possible values are: 1 (Monthly) or 4 (Yearly).
|
SUBSCRIPTION_ID
string, optional
|
The ID associated with a subscription purchase, reference for partner. A reference id defined by partner. This is will be sent as data to iFrame, on loading partner's subscription management app page.
|
STORAGE_UNIT
string, mandatory
|
Number of storage units. Each storage unit comprises 5GB/month for $4.
|
ADDON_ZOHO_BOOKS
string, optional
|
Number of users subscription licenses required for Zoho Books. Default value is 1, if Zoho Books integration is enabled in the plan and this key is skipped.
|
ADDON_ZOHO_EXPENSE
string, optional
|
Number of users subscription licenses required for Zoho Expense. Default value is 1, if Zoho Expense integration is enabled in the plan and this key is skipped.
|
ADDON_ZOHO_INVENTORY
string, optional
|
Number of users subscription licenses required for Zoho Inventory. Default value is 1, if Zoho Inventory integration is enabled in the plan and this key is skipped.
|
ADDON_ZOHO_SUBSCRIPTIONS
string, optional
|
Number of users subscription licenses required for Zoho Subscriptions. Default value is 1, if Zoho Subscriptions integration is enabled in the plan and this key is skipped.
|
ADDON_ZOHO_SURVEY
string, optional
|
Number of users subscription licenses required for Zoho Survey. Default value is 1, if Zoho Survey integration is enabled in the plan and this key is skipped.
|
ADDON_ZOHO_FORMS
string, optional
|
Number of users subscription licenses required for Zoho Forms. Default value is 1, if Zoho Forms integration is enabled in the plan and this key is skipped.
|
ADDON_ZOHO_REPORTS
string, optional
|
Number of users subscription licenses required for Zoho Reports. Default value is 1, if Zoho Reports integration is enabled in the plan and this key is skipped.
|
ADDON_ZOHO_DESK
string, optional
|
Number of users subscription licenses required for Zoho Desk. Default value is 1, if Zoho Desk integration is enabled in the plan and this key is skipped.
|
ADDON_ZOHO_SIGN
string, optional
|
Number of users subscription licenses required for Zoho Sign. Default value is 1, if Zoho Sign integration is enabled in the plan and this key is skipped.
|
Sample Request:
Sample Input:
- {
- "ZUID":"1010658824",
- "NO_OF_USERS":"4",
- "FREQUENCY":"1",
- "SUBSCRIPTION_ID":"811416000000161021",
- "STORAGE_UNITS":"1",
- "ADDON_ZOHO_PROJECTS":"1",
- "ADDON_ZOHO_BOOKS":"2",
- "ADDON_ZOHO_EXPENSE":"1",
- "ADDON_ZOHO_INVENTORY":"1"
- }
Modify Subscription
Request URL
Request Method : PUT
Request JSON Keys:
​Key |
​Description |
|
Zoho User ID, the unique ID that is used to identify a user.
|
NO_OF_USERS
string, mandatory
|
The number of subscription licenses bought by an user.
|
FREQUENCY
string, mandatory
|
The billing frequency for the subscription. The possible values are: 1 (Monthly) or 4 (Yearly).
|
SUBSCRIPTION_ID
string, mandatory
|
The ID associated with a subscription purchase.
|
STORAGE_UNIT
string, mandatory
|
Number of storage units. Each storage unit comprises 5GB/month for $4.
|
Sample Request:
Sample Input:
- {
- "ZUID":"1083827331",
- "NO_OF_USERS":"30",
- "FREQUENCY":"4",
- "SUBSCRIPTION_ID":"1028XXXX83832",
- "CUSTOM_PRICING_JSON":"{"SuperAdminLicense":"10","StandardLicense":"20"}",
- "STORAGE_UNITS":"4"
- }
Cancel Subscription
Request URL
Request Method : DELETE
Sample Request:
Here is a sample code to fetch data:
- window.addEventListener('message', function(event) {
- var json = event['data'];
- if(json != undefined) {
- /*** ***/
- }
- });