Tip #2 - Cancellation of Offline Subscriptions based on the Expected Payment Date

Tip #2 - Cancellation of Offline Subscriptions based on the Expected Payment Date

Hello everyone,

As you all know, we are coming up with a custom function workflow every week to address specific business scenarios. In continuation of this previous blog, this week we will be seeing about Cancellation of Offline Subscriptions based on the Expected Payment Date.

Business Scenario:


In general, for any business, the customers make payments via online as well as offline. In case of subscription where the automatic collection of charge is enabled (aka online subscription), the customer's card on file will be automatically charged on the renewal date on a regular basis. If for some reason the collection of charge fails on renewal, the Retry Settings (Dunning Settings) will handle the payment collection and sending notification reminders on specified intervals. Upon failure of all the retry attempts, the system will automatically cancel that subscription.

Whereas in the subscription for which the payment is made via cash (or) check, the business (sales) person collects the payment and record it manually into the billing system. There can be situations where even after multiple reminders and personal follow-ups by the salesperson, the customer might not have still paid for the invoice. In such cases, to avoid churn and to keep the cash flow coming, there can be a negotiation between the salesperson and the customer to collect the payment before a final date. This final date can be marked as the Expected Payment Date in that particular invoice.

In most of these scenarios, the customers will usually pay within the expected payment date which was previously agreed upon. However, if the customer fails to do so, the salesperson might have to cancel their subscription manually as there is no business value associated with it. 

Now, let's see how we can automate this process without any manual work. By doing this, you could save a significant amount of time which can be put into developing your business.

Logic Explanation:

As you would have guessed by now, we would be using our Custom Function Workflow to achieve this. Since this scenario involves date based actions, we will be using Date based Workflow. The Date based workflow is something that can be configured to run after a particular date and at a particular time depending on our requirement.

Now, if you were wondering how to configure the custom function to automate our process, please find the answers to your questions below.

What type of Workflow is to be followed?
Date Based Workflow

When is the date of execution?
1 day(s) after the Expected Payment Date.


Are there any additional filters required?

Yes. Execute this workflow only for unpaid invoices.

So to summarize, this custom function should be set to run exactly one day after the expected payment date for the unpaid invoices. After configuring this custom function, you would have to code (the functionality) in such a way that the subscription associated with the invoice is cancelled immediately.

Please be informed that this custom function workflow will work only on the invoices which are created after configuring this custom function.


Code Explanation:

You can refer the code through this GitHub link. The code is written in Deluge script, which is easily understandable to non-programmers. 

1) This snippet of code will be executed only for invoices which are unpaid even after the expected payment date. Kindly replace the "authtoken variable" with your generated authtoken.

2) Initially, we will retrieve the Subscription that is associated with that particular invoice.

3) After retrieving the associated subscription, we will be cancelling it by using the Cancel Subscription API.


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. 


3. Choose the module as 'Invoice' and click on 'Create Custom Events'. 


4. Choose Date Based workflow type and Date of Execution as 1 day(s) after Expected Payment DateYou can also set a different Execution Time based on your requirement.

5. In order to run the function for unpaid invoices, Apply Advanced Filter as When Status isn't Paid

6. Copy the code which was given above.

7. Save the Custom function and you are good to go.


Further Enhancements:

1)  While using this custom function, there might be a scenario where you would like to exclude a few of your prime customers' subscription from being cancelled automatically without your consent. In order to do this, you can add a Custom Field of type CheckBox to the Subscription. 

While creating a subscription, you can leave this CheckBox marked (or) unmarked in order to differentiate your prime customers from others. Later, you can add this custom field in the Addition Criteria of your workflow, such that the workflow is executed only for your non-prime customers.

Please refer the below image for your reference, where the CheckBox custom field is named as "Cancel subscription automatically?".

2) When the subscription is cancelled, the last renewed invoice will still be in open status. If you would like to void that invoice before cancelling the subscription, you can modify the workflow to address that need. 

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.

    Access your files securely from anywhere







                        Zoho Developer Community





                                              Use cases

                                              Make the most of Zoho Desk with the use cases.

                                               
                                                

                                              eBooks

                                              Download free eBooks and access a range of topics to get deeper insight on successfully using Zoho Desk.

                                               
                                                

                                              Videos

                                              Watch comprehensive videos on features and other important topics that will help you master Zoho Desk.

                                               
                                                

                                              Webinar

                                              Sign up for our webinars and learn the Zoho Desk basics, from customization to automation and more

                                               
                                                
                                              • Desk Community Learning Series


                                              • Meetups


                                              • Ask the Experts


                                              • Kbase


                                              • Resources


                                              • Glossary


                                              • Desk Marketplace


                                              • MVP Corner


                                                        • Sticky Posts

                                                        • Tip #4 : Refer and Earn Workflow system for your Subscription Business

                                                          Hello everyone, We've been coming up with a tip every week to address specific business scenarios which can be implemented for your business. In continuation to the previous post, this week we will be seeing about how you can implement the Refer and Earn Workflow system to acquire more customers. Why are Referrals important? Customer Acquisition is crucial for any business to sustain itself in a constantly evolving market. It involves persuading new consumers to purchase your products. Customers
                                                        • Tip #2 - Cancellation of Offline Subscriptions based on the Expected Payment Date

                                                          Hello everyone, As you all know, we are coming up with a custom function workflow every week to address specific business scenarios. In continuation of this previous blog, this week we will be seeing about Cancellation of Offline Subscriptions based on the Expected Payment Date. Business Scenario: In general, for any business, the customers make payments via online as well as offline. In case of subscription where the automatic collection of charge is enabled (aka online subscription), the customer's
                                                        • Tip #3 : Send SMS Reminders for your Subscription Business

                                                          Hello everyone, As you all know, we are coming up with a tip every week to address specific business scenarios. In continuation to the previous blog, this week we will be seeing how you can use SMS reminders for your Subscription Business. Using SMS messages for your Subscription Business: While managing your subscription business, more often than not, you need to keep your customers informed about upcoming renewals, payment reminders and cancellations. By keeping them informed in advance, you can
                                                        • Tips And Tricks - Announcement

                                                          Hello everyone, Every business is unique and each of them follows a specific workflow. While managing your customers' subscriptions with Zoho, you might have some needs unique to your business. Custom Functions helps you address such needs. This is a start to a series of posts, where we will be coming up with a custom function workflow every week that addresses specific business scenarios. Watch this space for further updates! Also, if you have any specific business scenario which needs to be addressed,
                                                        • Tip #6 : Accessing external URLs from Zoho Subscriptions

                                                          Hello everyone, We have been sharing a tip every week to address specific business scenarios which you can implement for your subscription business. Last week, we shared a tip about implementing the Approval Workflow system. This week, let's look at how you can access external URLs with the help of Custom Link. Business Scenario: Every business functions differently and has its unique requirements. At times, businesses might want to access other websites or applications by appending specific information


                                                        Manage your brands on social media



                                                              Zoho TeamInbox Resources



                                                                  Zoho CRM Plus Resources

                                                                    Zoho Books Resources


                                                                      Zoho Subscriptions Resources

                                                                        Zoho Projects Resources


                                                                          Zoho Sprints Resources


                                                                            Qntrl Resources


                                                                              Zoho Creator Resources



                                                                                  Zoho CRM Resources

                                                                                  • CRM Community Learning Series

                                                                                    CRM Community Learning Series


                                                                                  • Kaizen

                                                                                    Kaizen

                                                                                  • Functions

                                                                                    Functions

                                                                                  • Meetups

                                                                                    Meetups

                                                                                  • Kbase

                                                                                    Kbase

                                                                                  • Resources

                                                                                    Resources

                                                                                  • Digest

                                                                                    Digest

                                                                                  • CRM Marketplace

                                                                                    CRM Marketplace

                                                                                  • MVP Corner

                                                                                    MVP Corner







                                                                                      Design. Discuss. Deliver.

                                                                                      Create visually engaging stories with Zoho Show.

                                                                                      Get Started Now


                                                                                        Zoho Show Resources


                                                                                          Zoho Writer Writer

                                                                                          Get Started. Write Away!

                                                                                          Writer is a powerful online word processor, designed for collaborative work.

                                                                                            Zoho CRM コンテンツ






                                                                                              Nederlandse Hulpbronnen


                                                                                                  ご検討中の方




                                                                                                        • Recent Topics

                                                                                                        • Related Lists filter

                                                                                                          I have Contacts showing in our Accounts module. I customized the Contacts module with an Employment Status field, with the following picklist options: "Primary Contact", "Secondary Contact", "Active Staff(not a main contact)", and "No longer employed".
                                                                                                        • Rich Text For Notes in Zoho CRM

                                                                                                          Hello everyone, As you know, notes are essential for recording information and ensuring smooth communication across your records. With our latest update, you can now use Rich Text formatting to organize and structure your notes more efficiently. By using
                                                                                                        • Try CRM for everyone button in the way of workflow

                                                                                                          Please consider using the bottom bar for offers. Using the top bar for offers like "Try CRM for everyone" really gets in the way of my day to day workflow.
                                                                                                        • How can I create a button in a widget that pops up a form created in ZOHO Creator when clicked?

                                                                                                          I know that using HTML snippets, clicking the button can pop up the form. However, the same code does not work in the widget. <button><a href="#Form:form2?zc_LoadIn=dialog">Add</a></button>
                                                                                                        • Introduce an option to hide the form title

                                                                                                          My feature request is to include an option to hide the form title. At the moment it is possible to hide the header. In some cases I do want to show a logo image in the header but not the form title. As a workaround I have tried disabling the header and
                                                                                                        • Answer Bot and Personalized Questions

                                                                                                          Hi there, I have the same problem using the SalesIQ Answer Bot and the Zoho Desk Answer Bot (which really need different names, to be honest, in order to avoid confusion...) Customers that visit our website ask questions in the form of "What do you do?"
                                                                                                        • Show all items making up the composite item in transactions

                                                                                                          Dear Zoho, Currently, when we select a composite item in Zoho Inventory for a transaction, we do not receive a breakdown of the individual items that make up the composite. This makes it challenging for our team to accurately pick, pack, and ship the
                                                                                                        • Is it possible to do custom domains on test accounts that use saml setups?

                                                                                                          In Zoho Billing, Is it possible to do custom domains on test accounts that use saml setups for the customer portal?
                                                                                                        • "Recently Changed Payload Format" for webhooks in Zoho Billing

                                                                                                          We are seeing a message about recently changed payload format for webhooks in zoho billing. I cannot find any notification about this change can you give me more information on this?
                                                                                                        • Questions regarding WorkDrive

                                                                                                          Here are my questions regarding WorkDrive: Does WorkDrive have a limit on the number of downloads? What will happen if a file is downloaded excessively? Does WorkDrive have any restrictions on download speeds? Are there any limitations on downloading
                                                                                                        • Making money out of Zoho Sheets - How?

                                                                                                          Hello, Suppose I come up with a brilliant Zoho Sheet that I want to sell to other people, can I do this? How? Thanks.
                                                                                                        • 関連トピックから配信リストをつくる

                                                                                                          ZOHOキャンペーンの既存の連絡先リストを関連トピックで絞り込んで、配信リストを作成する方法があれば、教えてください。
                                                                                                        • zoho smtp limit for free users

                                                                                                          What is Zoho SMTP limit for free users?
                                                                                                        • Zoho Mail not working

                                                                                                          Anyone else had the issue where emails wont send from either the desktop CRM or the mail app? It just says "syncing" then "failed". I deleted it and tried to access emails through the CRM on my phone (fold) but they dont show. It seems it is impossible
                                                                                                        • Create static subforms in Zoho CRM: streamline data entry with pre-defined values

                                                                                                          Last modified on (9 July, 2025): This feature was available in early access and is currently being rolled out to customers in phases. Currently available for users in the the AU, CA, and SA DCs. It will be enabled for the remaining DCs in the next couple
                                                                                                        • Shorten one URL but not all

                                                                                                          I have read that I should be able to click on the shorten link button at the bottom of the post window and shorten just one URL. But it does all of the URLs in my post. I want only one shortened. Not sure what I'm missing. Any help appreciated.
                                                                                                        • [Free Webinar] Zoho RPA - OCR, PDF Automation, & More

                                                                                                          Hello Everyone! Greetings from the Zoho RPA Training Team! We’re excited to invite you to our upcoming webinar on the latest release updates for Zoho RPA, where we’ll unveil powerful new capabilities designed to make your automation journey smarter, faster,
                                                                                                        • What is Zoho Marketing Plus?

                                                                                                          As if there wasn't enough confusion with SalesIQ, CRM, Campaigns and Marketing Automation, now we have Marketing Plus too. Can somebody from Zoho please give us a comparative list of features that are in Marketing Plus compared to what's in Marketing
                                                                                                        • matches() returns different response in CRM vs public Deluge page

                                                                                                          I was using this public Deluge page to test using regular expressions with matches() to evaluate strings: https://deluge.zoho.com/tryout I was trying to use this regular expression to check a string for title case, making sure to escape the backslashes.
                                                                                                        • I didn't receive my domain verification mail

                                                                                                          I didn't receive my domain verification mail 
                                                                                                        • Creating a new deal with specific layout and pipeline

                                                                                                          I am trying to create a button which creates a new deal for a particular account. It needs to be assigned a specific layout and pipeline. It seems like it should be really simple but I've been struggling to get this to work all day, can anyone help?!
                                                                                                        • Announcing New Features in Trident for macOS (v.1.21.0)

                                                                                                          Hello everyone! Trident for macOS is here with interesting features to elevate your workplace communication and productivity. Let's take a quick look at them. Get better visibility for concurrent events. Quickly compare and manage simultaneous events
                                                                                                        • Zoho Inventory search when adding items to SO/PO, etc.

                                                                                                          I do not see that Zoho Inventory searches within the item name for an item lookup. We have many products with variants. So when I search for a product, say a lighting system, and it comes in different sizes and colors, I can only get those products where
                                                                                                        • Introducing Zoho Commerce 2.0 — It's more than just selling!

                                                                                                          Hello! We are proud to launch Zoho Commerce 2.0, a reimagination of how online businesses look, feel, and function. This launch is both timely and symbolic, as we reaffirm our commitment to empowering small and medium enterprises with powerful, yet simple-to-use
                                                                                                        • Modifying Product Details

                                                                                                          I am in the process of setting up new products in Zoho Commerce and have encountered a few problems: 1) Tabs It seems that Product Details pages do not have the ability to create Tabs. eg:  https://www.thedebugstore.com/tp240141-aardvark-usb-i2c-spi-host-adapter-total-phase.html
                                                                                                        • Zoho Commerce B2B

                                                                                                          Hello, I have signed up for a Zoho Commerce B2B product demo but it's not clear to me how the B2B experience would look for my customers, in a couple of ways. 1) Some of my customers are on terms and some pay upfront with credit card. How do I hide/show
                                                                                                        • Creating a custom CSV file using deluge script/

                                                                                                          I have an application I have developed and the client wants us to place an export file in csv onto an ftp server daily. Now I don't see au options in creator to change the separator to anything else. The client wants the separator to be the pipe symbol "|"  I think i would be able to create schedule with some code to create the appropriate data in a string using deluge script but I haven't seen any functionality that would allow me to deposit that data as a file anywhere or attach it to an email
                                                                                                        • How to create knowledge base article from api?

                                                                                                          How to create knowledge base article from api?
                                                                                                        • Delay function execute

                                                                                                          I've got a workflow which uses a webhook to send information to Flow, which in return updates a record in Creator. Problem is, by the time this has executed, the rest of my script has run and can't find the (yet to be) updated info in the record. Is there
                                                                                                        • Zoho Books | Product updates | July 2025

                                                                                                          Hello users, We’ve rolled out new features and enhancements in Zoho Books. From plan-based trials to the option to mark PDF templates as inactive, explore the updates designed to enhance your bookkeeping experience. Introducing Plan Based Trials in Zoho
                                                                                                        • customize payment page

                                                                                                          Is there a way to customize, other than the theme colour, the payment page that customers are taken to from invoices? I can't seem to find a way. I just don't like the formatting of the current page and would like to make it look better. I've looked at
                                                                                                        • Anyone else experiencing very slow loading of pages in Zoho Projects?

                                                                                                          I reported this yesterday only to be told there are no issues but is anyone else experiencing stupidly slow loading of pages. On our loading screen, it is taking often as long as 60 seconds to load a page and just stays on this screen for ages! Other
                                                                                                        • How can I get a nested value attributes inside a key par?

                                                                                                          Hello! Im getting the following output when reviewing a record I am after. I am trying to put some conditions based on a data value that is inside another data. For example, lets grab the below output. Info {"Account_Name":{"name":"Liberty Construction
                                                                                                        • Unable to attach the file via the API.

                                                                                                          We are trying to attach files to a Candidate in Zoho Recruit using the API. We reviewed the following API documentation: 🔗 Upload Attachment While this API does allow file attachment via a URL, that’s not what we want — we do not want to attach public-facing
                                                                                                        • Item Batch Creation/Updation

                                                                                                          I have a requirement to integrate a local system with Zoho Books. I need to create items in Zoho Books with batch tracking enabled, but I couldn't find a specific API for that in the Zoho Books API documentation. Is there a dedicated API endpoint to create
                                                                                                        • Invoices not arriving and mail server settings

                                                                                                          I am having an issue where some clients are not receiving invoices. I have configured Zoho Books to send on my behalf and configured the appropriate SPF, DKIM and DMARC settings on my mail server and tested these as working. I get the CC'd copies so I
                                                                                                        • Issues With Image Formatting when Importing Word Documents as Articles

                                                                                                          Hello, I am having formatting issues when importing .docx files into articles. The documents look fine on Word, but once they are imported into an article, the images will overlap text and other images. Occasionally there will be added space between images
                                                                                                        • Multi Line Text Character Limit

                                                                                                          I want to export my Help Center articles but I realized that the text in the Answer column is being cut off. I'm guessing there is a character limit for multi line text fields. How can I get around this?
                                                                                                        • How do I associate pricebooks to a customer?

                                                                                                          I setup a few pricebooks, that worked fine. But now the only thing I can do with it, when I enter a quote or sales order, I can select which pricebook to use, but I have to do this product by product every time I add one. Is there a way to connect a pricebook
                                                                                                        • Emails bouncing to Hotmail / Outlook.com

                                                                                                          Today I have seen multiple emails bouncing all to Hotmail and outlook.com mailboxes, all other emails are being delivered. Is it just me or is this a widespread issue with Zoho Books ? Bounce Reason : uncategorized-bounce
                                                                                                        • Next Page