Hello everyone,
As discussed previously in this
thread, we are going to come up with a custom function every week to address specific business scenarios. To start off, this week we will be looking into one of the most famous requirements -
30 Days Money Back Guarantee.
Business Scenario:
Most business organizations have cancellation policies and the most common one is the money back guarantee. It is a simple guarantee that if a customer is not satisfied with a product and cancels the subscription within the specified period, he/she will be provided with a refund.
Let's assume that we have to handle the above scenario in Zoho Subscriptions manually. We have to go to that particular subscription, and then check the activation date and the cancellation date to make sure the cancellation is done within 30 days. Then, we can initiate a refund.
This might seem pretty easy if you have to handle refunds for a couple of customers every now and then. However, as the business grows exponentially and quite a handful of customers starts requesting for refunds more frequently, the manual approach will cause a bottleneck. Also, refunding all these payments manually may cause a significant amount of time which can be put into developing your business.
Now, wouldn't it be easier if this entire process could be automated and you could stop worrying about it? This is where the custom functions save your day. With a one-time effort of setting up a custom function, you can completely automate the above scenario.
Logic Explanation:
You can refer the code through this
GitHub link. The code is written in Deluge script, which is easily understandable to non-programmers.
In this code, whenever a subscription is cancelled, we initially check if the cancellation date is within 30days from the activation date. If the subscription is cancelled within 30 days, we then retrieve the details of the last sent Invoice and check for the status of the invoice.
1) If the invoice is already fully paid, we check for the mode of payment. If the invoice is paid online, a credit note is raised for the paid amount and it is refunded. If the invoice is paid offline, we simply raise a credit note for the paid amount.
2) If the invoice is not yet paid and is still overdue, we simply mark that invoice as void.
If an error occurs in any of the API requests, an email will be sent to the admin email address with the request URL and the reason for the error.
Getting started with the Custom Functions:
1. Go to Settings -> Automation -> Custom Functions.
2. Create a new Custom function. Provide a name for the function. For example: "Auto refund cancellation".
3. Choose the module as 'Subscriptions' and the Predefined event as 'Cancel Subscription'.
4. Copy the code which was given above.
5. Please paste your authtoken in the authtoken variable. (Refer this
documentation to know how to generate your authtoken)
6. Also, in the dayToConsider variable, replace your own value for the days (within which the amount can be refunded).
7. Save the Custom function and you are good to go.
Found this useful? Try it out and let us know how it works! If you have questions, do not hesitate to ask!
Cheers,
Sasidaran K,
Zoho Subscriptions.
Recent Topics
Free webinar: Why a password manager is a “must-have” for everyone in 2024
In the past decade, we've witnessed numerous cybersecurity breaches globally, with a significant portion resulting from the "it won't happen to me" mindset. Shockingly, in 2023, 86% of breaches involved weak and stolen passwords. Password hygiene is crucial
Zoho Vault - Webinars 2023 - Video Recordings and Slide Decks
Hello, We wanted to offer a consolidated list of Zoho Vault webinar resources from 2023. Therefore, we're putting together a list that includes links to our webinar recordings and slide decks for easy access. Webinar Video recording Slide deck Getting
Free webinar: Focal point: Building a financial ecosystem with Zoho Vault and Zoho Workplace
Hi everyone! Cyber threats against the financial sector are escalating. In the last two decades, nearly one-fifth of reported incidents targeted financial institutions, causing $12 billion in direct losses. Cybercriminals are becoming more sophisticated,
New features in Zoho Vault
We’re thrilled to introduce a wave of powerful updates in Zoho Vault, designed to enhance security, streamline workflows, and improve your overall experience. Let’s dive into what’s new! Folder creation restrictions Limit who can create folders in your
Join our World Password and Passkey Day expert Q&A 2025
Hey everyone! World Password and Passkey Day is almost here, and there's no better time to talk about something we all rely on daily—secure authentication. Did you know that a staggering 60% of hacking-related breaches are tied to weak or stolen passwords?
Dashlane discontinued its free plan: Here's why Zoho Vault's free plan is worth the switch
Hey everyone, Dashlane password manager has officially announced that its free plan will be discontinued starting September 16, 2025. This change means that current free users will need to either upgrade to a paid subscription or export their data and
Introducing SecureForms in Zoho Vault
Hey everyone, Let’s face it—asking someone to send over a password or other sensitive data is rarely straightforward. You wait. You nudge. You follow up once, twice—maybe more. And when the information finally arrives, it shows up in the worst possible
Clickjacking: Zoho Vault's Response
Issue: Password manager browser extensions are found to be vulnerable to clickjacking security vulnerabilities that could allow attackers to steal account credentials, TFA codes, and card details under certain conditions. Reported by: Marek Toth, Independent
Free webinar: Security that works: Building resilience for the AI-powered workforce
Hello there, Did you know that more than 51% of organizations worldwide have experienced one or more security breaches, each costing over $1 million in losses or incident response? In today’s threat landscape, simply playing defense is no longer enough.
Free webinar—Redefining workforce security with Zoho Vault: Passwords, passkeys, and multi-factor authentication
Hi everyone! Did you know that in Q2 alone, 94 million data records were leaked globally? Behind every breach is a combination of poor password habits, phishing attacks, privilege misuse, and simple human error. The fallout—including reputational damage,
Audio/video quality issues with Zoho Meeting – Any roadmap for improvement?
Hi Zoho Team, We’ve been using Zoho Meeting for both internal and external meetings, and unfortunately, the experience has been consistently poor. The video and audio quality are so unreliable that it often renders meetings ineffective—especially with
In arattai received message can't be deleted
The issue has been noticed in following: arattai app (Android) arattai app (Window) arattai web While the message posted by me may be deleted, the ones received from others can't be. The item <Delete> change to <Report> when the message is a received
Fill Colors
Hello, Just curious, is it possible to manage the Used and standard colors in the fill drop down menu ? I would like to change/edit them is possible to colors I frequently use. Thanks for you reply, Bruce
Is there a way to generate a virtual meeting for a group service in Zoho Bookings?
Are virtual meetings not supported for group services/meetings? I have integrated Zoom with one-on-one services, but I need a way to create an online group meeting. Thanks
Attachment reminder?
My team and I often need to attach files to our messages, e.g. an explanatory screenshot or a shipping label. More often that I want to admit I mention the attachment but forget to actually attach it. Some email clients have a check-for-missing-attachments
Items Below Reorder Point Report?
Is there a way to run a report of Items that are below the Reorder Point? I don't see this as a specific report, nor can I figure out how to customize any of the other stock reports to give me this information. Please tell me I'm missing something s
Markdown for Desk?
Hi, my company wants to use markdown for formatting text in Desk (in all modules there, especially Tickets and Helpcenter). Zoho already offers use of markdown in several products (see https://help.zoho.com/portal/en/kb/backstage/microsite-guide/formatting-with-markdown/articles/formatting-with-markdo)
Multiple upload field CRM
I desperately need the functionality to add more than one upload field to web to contacts form. How can I do this?
Client scripts for Zoho Books ?
Good day everyone, I am looking for a way to be able to interact with the Quotes and Invoices as they are being created. Think of it like Zoho client script in Zoho CRM. But for the life of me I dont see a way to do this. The issue with having function
Fillable template with dynamic tables?
Is there a way to build a fillable template so that users can add rows to a table? To describe what I'm trying to accomplish the table has 3 sections; a header row, some number of rows with custom information, and a summary row with totals. I can't figure
Invoicing multiple expense items as a single line item
My client would like me to invoice them for multiple expense items on a single line item on an invoice. Can this be done? I know I can import billable expenses to an invoice, but I don't know how to show them as a single line item or have them
Zoho Books | Product updates | November 2025
Hello users, We’ve rolled out new features and enhancements in Zoho Books. From translating email notification templates to the new transaction locking restrictions, explore the updates designed to enhance your bookkeeping experience. Making Tax Digital
Tables improvement ideas / features
Heya, I've been using Zoho Tables for a few months now and wanted to post some features that I think will be greatly beneficial for the tool: 1. Ability to delete a record in automation or move a record in automation. - Usecase: I move a record from one
Announcing offline payment modes for event tickets
Hello everyone, Collecting ticket payments from prospective attendees can be a tricky part of event planning. While Zoho Backstage has always allowed you to collect payments online as people buy tickets from your event microsite, we have now enabled
What is going on with GMail extension.
Suddenly, it is popping up and saying "Please wait while we work our magic... 10%" and it sits there. Yesterday I waited for an entire hour call and it never got further. Today, it's not resolved. Is there a fix I can do? I've tried all the typical
Gmail is ramping up its email sender policy from November 2025
Hello marketers, As you may be aware, Gmail introduced a guideline for bulk senders starting February 2024. If not, here's a quick refresher straight from Google: After this policy was announced first in 2023 and soft-implemented in February 2024, we
Collapsible Sections & Section Navigation Needed
The flexibility of Zoho CRM has expanded greatly in the last few years, to the point that a leads module is now permissible to contain up to 350 fields. We don't use that many, but we are using 168 fields which are broken apart into 18 different sections.
Gmail is ramping up its email sender policy as of November 2025
Hello marketers, As you may be aware, Gmail introduced a guideline for bulk senders starting February 2024. If not, here's a quick refresher straight from Google: After this policy was announced first in 2023 and soft-implemented in February 2024, we
Good news! Calendar in Zoho CRM gets a face lift
Dear Customers, We are delighted to unveil the revamped calendar UI in Zoho CRM. With a complete visual overhaul aligned with CRM for Everyone, the calendar now offers a more intuitive and flexible scheduling experience. What’s new? Distinguish activities
Deluge Error Code 1002 - "Resource does not exist."
I am using the following script in a Custom Button on a Sales Return. Basically, the function takes the information in the sales return (plus the arguments that are entered by the user when the button is pushed) and creates a return shipping label via
Zoho Analytics Export API
Hi Team, I’m working on some integration tasks and wanted to confirm if it’s possible to retrieve a Zoho Analytics table as JSON data using a Deluge script. I’ve already stored my custom data from multiple sources and combined it into a single source.
Item images
Can we get an "On hover" expanded image for items please ?
Ability to Create and Manage YouTube Video Chapters in Zoho Social
Hi Zoho Social Team, How are you? We would like to request an enhancement to Zoho Social that would allow users to create and manage YouTube video chapters directly within the platform. Currently, Zoho Social does not support manually adding chapters
What happens to my current site SEO if i opt for zoho creator?
I have an existing website and I need to use Zoho creators for the rapid creation of my webpage creation. Currently, my IT team is creating the web pages, but I am concerned about the SEO of my current website if I shift to zoho will i loose it all?
Automatic Portal invite
We have numerous customers we move through a blueprint in deals, when they get to a certain point we need to give them portal access, how can this be done through deluge or a workflow?
Preview Emails with Merge Fields before sending
Hello, Are there plans to preview an email with merge fields before sending out? Currently, all you see in the preview are the merge field values, but before I send out the email I want to make sure the merge is working. Also, the saved emails only show
User Filter not selecting All Items
We are encountering 2 issues when using the user filter. When users are trying to search using the filter option, the OK button is grayed out. Users have to unselect or make a change before it filters properly. 2. When filtering and the OK button works,
Support Nested JavaScript Variables in PageSense Pop-up Targeting
Hello Zoho PageSense Team, I hope you're doing well. I’d like to request a feature enhancement for the PageSense pop-up targeting functionality. Current Limitation: Currently, PageSense pop-ups can be triggered using simple JavaScript variables. However,
Cannot Invert Axis for Rankings
Hi there I want to be able to create a ranking graph in Analytics/BI, with 1 at the top of the Y axis, but I am unable to invert the axis. Super simple example in Excel below. Higher rankings need to be higher up on the graph to give the correct visual
How to copy value from a single line field into a picklist field within a module's subform?
Hello there, I have a single line field in a module's subform. I would like the value in the field to automatically update a picklist field within the same subform (both have items with the same names). Is this possible via function? Unfortunately, workflows
Next Page