Hello everyone,
We have been sharing a tip every week to address specific business scenarios which can be implemented for your subscription business. Last week, we shared a tip about
accessing external URLs from Zoho Subscriptions. This week, we will be looking at
how you can integrate online forms with Zoho Subscriptions.
Business Scenario:
In many subscription box businesses, their primary need is to personalize the subscription box according to their customer's preferences. In such cases, businesses will collect their customers' preferences before they check out.
Usually, businesses use online form building applications to collect customers' preferences. These applications offer customization options which helps businesses to design the form so that it's easier for customers to select their preferences. The forms usually contain a series of questions with multiple choices.
Typically, when customers want to subscribe to a box, they select the box, choose their preferences and the business will redirect them to the payment page. Here, they pay and a subscription will be initiated for them.
In Zoho Subscriptions, we provide the
Hosted Payment Page to collect the customer's payment information securely which can be used as the checkout page. However, in this scenario we're looking at today, the business would ideally want to integrate the form building application with Zoho Subscriptions to save customers' preferences along with the subscription details.
Let's consider the following scenario to understand this better. Zylker Beauty runs a subscription box business that ships personalized makeup and beauty products every month. They use a third-party online form builder to collect the customers' preferences like the color of their eyes, hair etc. This helps the business to find the right products for their customers.
After the customers select their preferences, Zylker Beauty uses Zoho Subscriptions' Hosted Page to check them out and start their subscription. However, they need their customers' preferences to be saved along with the corresponding subscription details in Zoho Subscriptions.
To implement this process, we use the API Hosted Page which saves customers' preferences and generates a customized payment URL. The customized payment URL will reflect the customer's preferences. This way, the business can use the form builder application to customize the form and integrate it with Zoho Subscriptions at the same time.
How can you do it?
For our explanation today, we will be using JotForm as the form builder. You can view the form that we've built to address the above scenario. JotForm lets you send the submitted date (customer's preferences) via a HTTP POST method. All you have to do is:
- process the submitted data;
- send it to Zoho Subscriptions server; and
- redirect the customer to the customized Hosted Payment Page.
In Zoho Subscriptions, we will create
Custom Fields for the Subscriptions module to save the customer's preferences and map those preferences to the custom fields. You have to write a script to send an API call to Zoho Subscriptions server with all the data obtained from the form and retrieve the customized hosted payment page URL. Later, you can load this URL for your customers to check out.
There are two ways in which you can do this;
1. Create a custom PHP page:
You can create your PHP script and deploy it in your server to process the submitted date. Access the code in
GitHub.
2. Use Google Cloud Function:
If you cannot host a PHP script in your website, don't worry.
Google Cloud Functions can act as your script that processes the submitted data.
You can invoke the cloud functions with HTTP requests and configure them to meet our need.
Learn more about cloud functions and get started. Once you complete the initial setup and enable the Cloud Functions API, follow the steps below:
- Visit Google Cloud Functions and click the Create Function button at the top.
- Provide a suitable name for the function and select the Trigger as HTTP.
- The source code would be written in the Inline Editor with Node.js 6 runtime environment. So, configure them accordingly.
- Next, copy the code from GitHub and modify it to suit your needs.
- Create the function and configure the HTTP trigger URL in the JotForm's Thank You page.
Once the Thank You page of JotForm is successfully configured to redirect to one of the above URLs, the script will be executed successfully and your customers will be redirected to the hosted payment page to check out.
For further clarification, you can checkout this
video to understand this integration.
Found this useful? Try it our for your subscriptions business and let us know. If you have any queries, feel free to comment below. We are here to answer them.
Cheers,
Sasidaran K,
Zoho Subscriptions.