Automating Vendor Contract Management between Zoho Contracts and Zoho Books using Zoho Flow

Automating Vendor Contract Management between Zoho Contracts and Zoho Books using Zoho Flow

Managing vendor agreements across procurement and finance systems often requires manually downloading executed contracts and attaching them to vendor records. This can become time-consuming and difficult to manage when dealing with a large number of contracts.

In this post, we’ll share a simple automation built using Zoho Flow, Zoho Contracts APIs, and Zoho Books that connects procurement, legal, and finance workflows.

This integration automatically:
  1. Creates counterparties and contracts in Zoho Contracts when a vendor is added in Zoho Books
  2. Detects when a contract is executed in Zoho Contracts
  3. Downloads the executed contract
  4. Attaches the signed contract to the vendor record in Zoho Books
This enables a seamless Procure-to-Pay vendor contract workflow and demonstrates how Zoho Contracts can be integrated with finance systems to streamline vendor agreement management.

Business Use Case – Procure to Pay

A typical vendor agreement lifecycle involves:
  1. Vendor onboarding in Zoho Books
  2. Contract creation, negotiation, and execution in Zoho Contracts
  3. Executed agreement available for the finance team’s reference
Without automation, finance teams must manually download the executed agreement and attach it to the vendor record.

Prerequisites

Before implementing this automation, ensure the following setup is completed:
  1. Zoho Books and Zoho Contracts are configured in your organization
  2. Zoho Flow is enabled and connected to both Zoho Books and Zoho Contracts
  3. API connections are configured for Zoho Books and Zoho Contracts in Zoho Flow
  4. Appropriate permissions are available to create counterparties and contracts in Zoho Contracts
  5. Additionally, create a custom field in Zoho Books (Vendor module) to store the Zoho Contracts Counterparty API Name.
Example:
  1. Field Name: Contracts Counterparty ID
  2. Field Type: Text
  3. Module: Vendors
This field helps map vendors in Zoho Books with their corresponding counterparties in Zoho Contracts.

Solution Overview

Zoho applications involved:
  1. Zoho Contracts
  2. Zoho Books
  3. Zoho Flow
The automation is implemented using two flows.

Flow 1 – Vendor Creation → Contract Creation

Trigger: A new vendor is created in Zoho Books.



Actions:
  1. Zoho Flow detects the new vendor.



  1. A custom function checks whether a corresponding counterparty exists in Zoho Contracts
  2. If the counterparty does not exist, a new counterparty is created in Zoho Contracts



  1. The counterparty API name is stored in Zoho Books
  2. A contract is automatically created in Zoho Contracts for that vendor



Custom Function Snippet (Create Counterparty and Contract):

Notes
Note: The custom functions shared below are working reference implementations. However, depending on your environment, you may need to update certain values before using them in your setup.

Please review and update the following as applicable:
  1. Connection names used in the invokeurl statements
  2. Organization ID used for Zoho Books API calls
  3. Custom field API names used to store the Counterparty reference in Zoho Books
  4. Contract type API names configured in Zoho Contracts
Ensure these values are updated according to your configuration before deploying the automation
.
  1. map createContract1(string vendorName, string vendorID, string counterpartyID)
  2. {
  3. result = Map();
  4. createdCounterPartyAPIName = "";
  5. if(counterpartyID != null && counterpartyID != "")
  6. {
  7.  existingCounterpartyResponse = invokeurl
  8.  [
  9.   url :"https://contracts.zoho.in/api/v1/counterparties/" + counterpartyID
  10.   type :GET
  11.   connection:"zcontractsconn"
  12.  ];
  13.  if(existingCounterpartyResponse.get("counterparty") != null)
  14.  {
  15.   createdCounterPartyAPIName = existingCounterpartyResponse.get("counterparty").get("apiName");
  16.  }
  17. }
  18. if(createdCounterPartyAPIName == "")
  19. {
  20.  counterpartyMap = Map();
  21.  counterpartyMap.put("name",vendorName);
  22.  counterpartyMap.put("counterPartyType","vendor");
  23.  createResponse = invokeurl
  24.  [
  25.   url :"https://contracts.zoho.in/api/v1/counterparties"
  26.   type :POST
  27.   parameters:counterpartyMap.toString()
  28.   connection:"zcontractsconn"
  29.  ];
  30.  counterpartyDetail = createResponse.getJSON("counterparties").get(0);
  31.  createdCounterPartyAPIName = counterpartyDetail.get("organizationApiName");
  32.  customFields = List();
  33.  cf = Map();
  34.  cf.put("api_name","cf_contracts_counterparty_id");
  35.  cf.put("value",createdCounterPartyAPIName);
  36.  customFields.add(cf);
  37.  updateMap = Map();
  38.  updateMap.put("custom_fields",customFields);
  39.  updateVendor = invokeurl
  40.  [
  41.   url :"https://books.zoho.in/api/v3/vendors/" + vendorID + "?organization_id=60047651581"
  42.   type :PUT
  43.   parameters:updateMap
  44.   connection:"zbooks"
  45.  ];
  46. }
  47. info "STEP 4 STARTED - Preparing Contract Variables";
  48. newContractType = "master-subscription-agreement-pro-plus";
  49. newContractName = "Agreement with " + vendorName;
  50. isNewContractTermIsDefinite = false;
  51. isNewContractRenewable = false;
  52. contractEffectiveDate = 1;
  53. info "Contract Type: " + newContractType;
  54. info "Contract Name: " + newContractName;
  55. info "Counterparty API Name: " + createdCounterPartyAPIName;
  56. newContractDetail = {"externalSource":true,"inputfields":{{"metaApiName":"contract-type","inputs":{{"inputApiName":"contract-type","inputValue":newContractType}}},{"metaApiName":"contract-term","inputs":{{"inputApiName":"contract-term","inputValue":isNewContractTermIsDefinite}}},{"metaApiName":"is-renewable","inputs":{{"inputApiName":"is-renewable","inputValue":isNewContractRenewable}}},{"metaApiName":"title","inputs":{{"inputApiName":"title","inputValue":newContractName}}},{"metaApiName":"party-b-name","inputs":{{"inputApiName":"party-b-name","inputValue":createdCounterPartyAPIName}}},{"metaApiName":"contract-effective-date","inputs":{{"inputApiName":"contract-effective-date","inputValue":contractEffectiveDate}}}}};
  57. createContractResponse = invokeurl
  58. [
  59.  url :"https://contracts.zoho.in/api/v1/createcontract"
  60.  type :POST
  61.  body:newContractDetail.toString()
  62.  headers:{"Content-Type":"application/json"}
  63.  connection:"zcontractsconn"
  64. ];
  65. info createContractResponse;
  66. result.put("counterpartyApiName",createdCounterPartyAPIName);
  67. result.put("contractResponse",createContractResponse);
  68. return result;
  69. }

Flow 2 – Contract Execution → Attach Signed Agreement

Trigger: Contract signing is completed in Zoho Contracts

Actions: 
  1. Zoho Flow detects the contract execution event



  1. A custom function calls the Zoho Contracts API to download the executed contract document.
  2. The function identifies the corresponding vendor in Zoho Books.
  3. The executed agreement is automatically attached to the vendor record in Zoho Books.



Custom Function Snippet (Retrieve and Attach Signed Contract):
  1. map attachSignedContractToVendor(string contractApiName, string contractTitle)
  2. {
  3. result = Map();
  4. orgID = "60047651581";

  5. info "FLOW 2 STARTED";
  6. info contractApiName;
  7. info contractTitle;

  8. if(contractApiName.startsWith("contract/"))
  9. {
  10.     contractApiName = contractApiName.replaceAll("contract/","");
  11. }

  12. info "Clean Contract API Name: " + contractApiName;

  13. if(contractTitle.startsWith("Agreement with "))
  14. {
  15.     vendorName = contractTitle.subString(15);
  16. }
  17. else
  18. {
  19.     vendorName = contractTitle;
  20. }

  21. info "Vendor Extracted: " + vendorName;

  22. vendorSearch = invokeurl
  23. [
  24.     url :"https://books.zoho.in/api/v3/contacts?contact_name=" + vendorName + "&organization_id=" + orgID
  25.     type :GET
  26.     connection:"zbooks"
  27. ];

  28. info vendorSearch;

  29. contactsList = vendorSearch.get("contacts");

  30. if(contactsList == null || contactsList.size() == 0)
  31. {
  32.     info "Vendor not found";
  33.     result.put("status","vendor_not_found");
  34.     return result;
  35. }

  36. vendorID = contactsList.get(0).get("contact_id");

  37. info "Vendor ID: " + vendorID;

  38. info "Downloading signed contract";

  39. signedFile = invokeurl
  40. [
  41.     url :"https://contracts.zoho.in/api/v1/download/contracts/" + contractApiName + "/signed/document"
  42.     type :GET
  43.     connection:"zcontractsconn"
  44. ];

  45. info signedFile;

  46. fileMap = Map();
  47. fileMap.put("attachment",signedFile);
  48. fileMap.put("organization_id",orgID);

  49. info "Uploading attachment to Zoho Books";

  50. uploadResponse = invokeurl
  51. [
  52.     url :"https://books.zoho.in/api/v3/contacts/" + vendorID + "/attachment?organization_id=" + orgID
  53.     type :POST
  54.     parameters:fileMap
  55.     connection:"zbooks"
  56.     content-type:"multipart/form-data"
  57. ];

  58. info uploadResponse;

  59. result.put("uploadResponse",uploadResponse);

  60. info "FLOW 2 COMPLETED";

  61. return result;
  62. }
Benefits
  1. This automation provides several advantages:
  2. Eliminates manual document handling
  3. Ensures finance teams always have access to executed agreements
  4. Connects legal and finance workflows
  5. Improves compliance and audit readiness
  6. Reduces operational friction
Closing

If you're implementing Procure-to-Pay contract workflows, this approach can help streamline the connection between Zoho Contracts and finance systems like Zoho Books.

We’d be happy to discuss variations of this implementation or answer any questions.

If you're planning to implement a similar workflow and need guidance, feel free to reach out to the Zoho Contracts support team at support@zohocontracts.com.
.
Stay tuned for more tips, tricks, and automation ideas around Zoho Contracts.



Cheers,
Sathyakeerthi
Zoho Contracts Team

    • Sticky Posts

    • Adding signature fields in your contract template

      When you send a contract document for the signing process, you have to insert the signature fields into your contract document by dragging and dropping them for each signer. It won't be effort-intensive for contracts that have fewer pages or signers.
    • Mapping Billing Country Field to Your Contract Template Field

      In Zoho CRM, while configuring Counterparty Fields Mapping to map counterparty information in your contract type, the field 'Billing Country' doesn't have the support to be mapped due to field type mismatch. Because the Billing Country field in Zoho CRM
    • Bulk Import Counterparty Data

      Currently, as the feature to bulk import counterparty data is not available, here is a solution using our APIs that would be useful for our customers. For example, Zoho CRM customers can import their Accounts as counterparties in Zoho Contracts. Using
    • Recent Topics

    • Trying to access records in a custom module in Zoho Desk and not having luck

      I've built a custom module in Zoho Desk and am using a custom function to query the records in the module and I'm not having any luck. The only way I have found to retreive a record is by getting it by its recordID (the long zoho assigned one). The function
    • Composite items inside of composite items; bill of materials needed

      Hi Zoho and Everyone, I am evaluating whether Zoho Inventory will work for my small business. I grow and harvest herbs and spices but also get from wholesalers. I use all these items to make herbal teas, but also sell them as individual items on my Shopify store and Etsy. I discovered the composite item bundling and am wondering if I could get some assistance since there is no bill of materials: Our herbal company's best selling tea is a sleepytime tea. Sleepytime Tea can be purchased in three weights
    • ZOHO Books Smart Accounting Software for Travel Agency

      Dear Travel partner, Contact for Travel Agency Accounting Setup & Training Vansh Travel (ZOHO Books Authorised partner) Email: info@vanshtravel.com Mo: +91 98984 95155 Please find PDF   
    • 452 Mailbox delivery restricted by policy error

      We have been testing Zoho desk for about a week now and have been forwarding emails in via an Exchange Online Mail flow rule without issue until yesterday. Suddenly yesterday morning we started getting the vast majority of the emails stuck in Pending
    • Send Email reply on behalf of Agent

      Hi, When using the send email reply via the API I can set the reply on behalf of the customer by using impersonatedUserId in the header of the API call. Is there a way to do this for Agents too? I need to be able to send an email reply on behalf of an
    • Sharing Tickets to a team within a department

      Hi there, We have a need for one department to be able to share tickets to a specific team within a department, I'm wondering if this is possible? All the shared tickets are going into the 'Shared Tickets' view for the whole department but is there a
    • Removing To or CC Addresses from Desk Ticket

      I was hoping i could find a way to remove unnecessary email addresses from tickets submitted via email. For example, a customer may email the support address AND others who are in the helpdesk notification group, in either the TO or CC address. This results
    • Do not use isnull()

      Does not always return booleans. Can also return null. Never use this function. Just use var==null instead.
    • Organization wide Account and Contacts Visibility/Sharing Capabilities?

      Has anyone figured out a way to make visibility or sharing of Accounts and Contacts to be available across the entire organization without having to have every individual user edit their Sharing permissions? For our sales folks they need to be able to
    • Is there a way to configure dark mode for Campaigns emails that go out to customers?

      I've found a lot of information on how to configure dark mode for my (The user) personal Zoho workspace and email, but is there any way to edit dark mode settings on emails that we send out to customers via campaigns?  We sent out a test email the other
    • When Does WorkDrive integrate with Books?

      When Does WorkDrive integrate with Books?
    • How do I import Connected Records for a Deal?

      Can you point me to an example of the CSV file that would add related records to an existing CRM Deal? I imported a Deal, then tried importing a connected record using a unique ID that references the Deal ID, but it doesn't attach it to the Deal rec
    • FSM integration with Books

      Hi, I have spent a few months working with FSM and have come across a critical gap in the functionality, which I find almost shocking....either that, or I am an idiot. The lack of bi-directional sync between Books and FSM on Sales Orders/ Work Orders
    • How to close an estimate ?

      Hello, I have created estimates, and converted them to invoices to get 50% payment. Now I have 2 cases where the estimate stills shows status partially invoiced, however: 1. for one of them, project stopped half way, so the remaining part will never be
    • Power up your Kiosk Studio with Real-Time Data Capture, Client Scripts & More!

      Hello Everyone, We’re thrilled to announce a powerful set of enhancements to Kiosk Studio in Zoho CRM. These new updates give you more flexibility, faster record handling, and real-time data capture, making your Kiosk flows smarter and more efficient
    • How do you print out the invoices comments

      I have some invoices where i need to print out the comments that show when reminders and etc were sent how do we print those out in Zoho Books.
    • Unable to load a specific image

      Hi I am trying to upload an svg file, which reports that there is "a problem with the file", but does not say what sort of problem. I can't find anything which says which files are supported, so it may be it does not support svg. (which would be a real shame) The file itself will open in either Firefox or Chrome without problem. For the moment I am using a png file, which does not zoom well of course. David
    • Why does the Address field show the wrong map location even with a correct Pincode?

      I am noticing an issue with the Address field map in Zoho Creator. When I enter a city name that exists in multiple locations within the same state, the map sometimes points to the wrong area even if I have entered the correct Pincode. Currently, it seems
    • Uploaded files are not included when using "Include user submitted data" in Email Notification

      In Send Email notification workflow in Zoho Creator, there is an option called "Include user submitted data" which allows the email to contain all the form submission details. However, when this option is enabled, files or images uploaded through File
    • Books <-> CRM synchronisation with custom Fields

      Hello, We are synchronising Books Customers with CRM Accounts. In CRM Accounts I set up last year a "segments" multiselect field shown below In Books, I set up a custom multi-select field with the same value as in the CRM And set up the synchronisation inside Books. Want to synchronise the Books Segments with the CRM Segments, but the later doesn't exist, and another non-existing is there ?! First, I don't understand where the field Segmentation is coming from. Second, I set CRM Segmentation to sync
    • CRM x WorkDrive: We're rolling out the WorkDrive-powered file storage experience for existing users

      Release plan: Gradual rollout to customers without file storage add-ons, in this order: 1. Standalone CRM 2. CRM Plus and Zoho One DCs: All | Editions: All Available now for: - Standalone CRM accounts in Free and Standard editions without file storage
    • Archive Option in Conversation View

      Hello, I have a suggestion\request to add an "Archive Thread" button in conversation view of Zoho Mail. The best suggestion I have is to put an "Archive Thread" button next to the "Label Entire Thread" button in conversation view. Most users don't just
    • Outlook/Hotmail Blocking Zoho SMTP IPs (S3150)

      We are currently facing a serious deliverability issue with Zoho SMTP while sending transactional OTP emails for our production application. Emails sent to Outlook / Hotmail addresses are being rejected with the following error: 550 - 5.7.1 Unfortunately,
    • Outlook is blocking incoming mail

      Outlook is blocking all emails sent from the Zoho server. ERROR CODE :550 - 5.7.1 Unfortunately, messages from [136.143.169.51] weren't sent. Please contact your Internet service provider since part of their network is on our block list (S3150). It looks
    • Track Marketing Automation Campaigns in Zoho CRM

      Hello, I've been searching but haven't found the exact answer to this question. I am looking to track Marketing Automation email campaigns and activities inside of Zoho CRM. Use Case: Action: Prospect Submits A Lead Form Outcomes: Prospect created in
    • Zoho Social API for generating draft posts from a third-party app ?

      Hello everyone, I hope you are all well. I have a question regarding Zoho Social. I am developing an application that generates social media posts, and I would like to be able to incorporate a feature that allows saving these posts as drafts in Zoho Social.
    • Temporarily rate limited due to IP reputation.

      We have suddenly started receiving the following Mail Delivery Status Notification: Diagnostic-Code: 4.7.650 The mail server [136.143.184.12] has been temporarily rate limited due to IP reputation. For e-mail delivery information, see https://aka.ms/postmaster
    • Incorrect Functioning of Time Logs API (Version 3)

      We need to fetch the list of time logs for each task for our company internal usage. We are trying to achieve it by using the next endpoint: https://projects.zoho.com/api-docs#bulk-time-logs#get-all-project-time-logs Firstly, in the documentation the
    • IMPORTANT: It doesn´t search for letters with portuguese characters.

      Some of my articles have for example the word "vídeo". But if I search for "vídeo" it doesn´t find them. If I search for "video" it does find them. Idealy, it should find the articles either way. But if I have to choose, it would be better to find the
    • IMPORTANT: It doens´t show full article name on search - Should add line break

      When we search for articles, it doesn´t show the full name. There should be a line break so the user can see the full article name, otherwise the user can´t know if that´s the article he/she is looking for. This is very important, otherwise the user has
    • Zoho Books - Payment Gateway - Revolut

      Hi Books Team, My feature request if to include the popular platform Revolut as a payment collection option on invoices in Zoho Books. Please upvote if you are also looking for this option.
    • Zoho Books | Product updates | January 2026

      Hello users, We’ve rolled out new features and enhancements in Zoho Books. From e-filing Form 1099 directly with the IRS to corporation tax support, explore the updates designed to enhance your bookkeeping experience. E-File Form 1099 Directly With the
    • Kaizen #233 - Generating AI-powered Follow-up Emails Using CRM Functions and Widgets

      Hey everyone! Welcome back to another interesting post in the Kaizen series! Sales teams regularly capture interaction notes in CRM after speaking with prospects. However, drafting a follow-up email that reflects the conversation context can be repetitive
    • Connect Bank in Zoho Books

      Can I connect UOB or Ariwallex in Zoho Books?
    • Using MPN across multiple SKUs and inventory tracking

      I have several different SKU's that share a common MPN and would like to track inventory by MPN. SKU1 has MPN1 assigned SKU2 has MPN1 assigned Here is an example If I start with 5 of MPN 1 in stock I want each SKU1 and SKU2 to show as 5 in stock, If I
    • Extend Zoho Canvas Customization to Zoho Creator Forms and Reports

      Currently, Zoho Canvas allows users to design and customize the UI of Zoho CRM modules with a much better visual experience. This helps organizations create cleaner layouts, improve usability, and design interfaces that match their workflows. However,
    • Marketing Tip #1: Optimize item titles for SEO

      Your item title is the first thing both Google and shoppers notice. Instead of a generic “Leather Bag,” go for something detailed like “Handcrafted Leather Laptop Bag – Durable & Stylish.” This helps your items rank better in search results and instantly
    • Feature Enhancement Request – Text Formatting Options in Item Description (Zoho Books/Quotes Module)

      Dear Zoho Development Team, Greetings from Radiant360 Integrated Technical Services LLC. We would like to bring to your attention a functional limitation we've encountered within the Item Table / Quote Description section of Zoho Books (and Zoho CRM Quotes).
    • ZOHO Books Query

      Good day, Can someone please advise. I recently migrated from ZOHO Invoice to ZOHO Books. No that I want to use the inventory on Books I cant as all my items have transaction history. The person I spoke to at ZOHO said I need to create a new Company profile
    • Best way to schedule bill payments to vendors

      I've integrated Forte so that I can convert POs to bills and make payments to my vendors all through Books. Is there a way to schedule the bill payments as some of my vendors are net 30, net 60 and even net 90 days. If I can't get this to work, I'll have
    • Next Page