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

    • 【開催報告】大阪 Zoho ユーザー交流会 2026 NEXUS|少人数でマーケティング・営業を回すZoho×AI活用

      Zoho ユーザーの皆さん、こんにちは。 ゾーホージャパンの中野です。 11月12日(木)、AP大阪にて「大阪 Zoho ユーザー交流会 2026 NEXUS」を開催しました。 今回は、ZohoとAIを活用して、少人数でもマーケティング・営業・顧客対応を回していくための実践例を中心にご紹介しました。 ご登壇いただいた小園さん、アダルシさん、そしてご参加いただいた皆さん、ありがとうございました! ユーザー活用事例 聞き直さない、追いかけない、思い出さない 〜ZohoとAIで一人営業を回す方法〜 登壇者:株式会社ジーニアスウェブ
    • Hiding old CRM Contacts in Desk

      I have an issue with contacts in Desk.   We sync contacts from CRM with DESK and we have old contacts, eg staff members that have left businesses.  The issue is when adding a ticket (most of our tickets are raised over the phone), staff sometimes pick
    • Action Request - Zia Agents - Get Agent API

      It would be great if there was a "Fetch Agent" action for Zia Agents. The main use case here is getting the latest version of the Agent to populate the "Trigger Agent Execution" action. That action requires one to specify which version of the Agent is
    • WhatsApp Business Calling API

      Dear Zoho SalesIQ Team, I would like to request a feature that allows users to call WhatsApp numbers directly via Zoho SalesIQ. This integration would enable sending and receiving calls to and from WhatsApp numbers over the internet, without the need
    • Calendar Reminders unavailable

      For some received meeting invitations, Zoho Calendar’s web interface provides no option to add or edit a reminder. However, I can add a reminder to the same event through the phone app. That reminder then appears in the browser, but still cannot be edited
    • Zoho Desk MCP doesn't expose all functions

      Hello, I'd like to be able to draft (rather than send) ticket replies using Claude Cowork. However, the Zoho Desk MCP doesn't currently offer that, despite it being available in the API (https://desk.zoho.com/DeskAPIDocument#Threads#Threads_DraftEmailReply).
    • Email-Data Synchronization with Zoho Analytics

      Hello, Enterprise Support Community! We're excited to announce the availability of Email Data Synchronization with Zoho Analytics! This highly requested enhancement allows you to sync email data from Zoho CRM into Zoho Analytics, making it easier to analyze
    • Keeping phone number text format exporting from Books to Sheet

      We have a custom function that copies data from our customers in Books to Sheets. In the process the customers' phone numbers (unless they contain a space) get treated as numeric values, so leading zeros get stripped off, and in some cases scientific
    • #22 I Sent It to the Wrong Person

      Meera was sending an invoice to a client when she mistyped the email address. She noticed the mistake a week later, when the payment had not come in. She corrected the email address on the customer record and waited for the payment to arrive. But nothing
    • New Search Function

      Hey Team, The search function updated in our CRM about a week ago, so I assume it was an automated update across Zoho. It no longer displays leads/deals etc in Chronological order so that the most recently created or updated is the first to display which
    • Build a historical inventory snapshot in Google BigQuery using Zoho DataPrep

      Businesses using Zoho Inventory may want to transfer their inventory data to Google BigQuery to maintain an up-to-date data warehouse. While scheduled pipelines help keep BigQuery updated with the latest inventory data, businesses that also need to track
    • Zoho writer tabs

      I'm trying to post a list of actions for my team to share online. For this I need to set tabs -- can't find a way of setting tabs anywhere. Would prefer not to go to the formality of a table. Can anyone tell me how to set tabs? greigg
    • Ability to Set Text Direction for Individual Cells in Zoho Sheet

      Dear Zoho Sheet Team, We hope you are doing well. We would like to request an enhancement in Zoho Sheet that allows users to set the text direction (right-to-left or left-to-right) for individual cells, similar to what is available in Google Sheets. Use
    • Keep Zoho Books data in sync with Google BigQuery

      Businesses using Zoho Books may need to transfer their financial data to a data warehouse like Google BigQuery for reporting and analysis. Zoho DataPrep helps automate this process by preparing Zoho Books data and syncing it with BigQuery at scheduled
    • What's New - October 2026 | Zoho Backstage

      Hello everyone, The last few months of the year are usually the busiest for events, with more people to reach and more details to manage. This month, we’ve made a few changes that should save you some time and back-and-forth along the way. Here’s what’s
    • Introducing user-based authentication across Zoho CRM

      We have introduced two enhancements to simplify authentication and enable user-specific access when working with Connections and executing CRM operations across different developer tools. 1. Enable user-based authentication for Connections Connections
    • Set connection link name from variable in invokeurl

      Hi, guys. How to set in parameter "connection" a variable, instead of a string. connectionLinkName = manager.get('connectionLinkName').toString(); response = invokeurl [ url :"https://www.googleapis.com/calendar/v3/freeBusy" type :POST parameters:requestParams.toString()
    • Allow Multiple usage units to items while adding them to sales/purchase transactions

      The usage unit of items added in zoho books are static right now and can not be changed. But certain items are received or sold in multiple usage units. One example is fabric. It can be bought in Meters, inches, kgs or other units. Another example would
    • Zoho Inventory – Stock Allocation and Warehouse ManagementAs we implement Zoho One in our organization, we are currently facing a challenge with stock allocation and warehouse management. While the wa

      As we implement Zoho One in our organization, we are currently facing a challenge with stock allocation and warehouse management. While the warehouse management part can be handled in Zoho Inventory, our main requirement is the customer-wise stock allocation
    • How to restore deleted campaigns?

      I accidentally deleted my first campaign that went out today (08/21/18). How do I restore it?
    • Using IMAP configuration for shared email inboxes

      Our customer service team utilizes shared email boxes to allow multiple people to view and handle incoming customer requests. For example, the customer sends an email to info@xxxx.com and multiple people can view it and handle the request. How can I configure
    • New in Cadences: Option to Resume or Restart follow-ups when re-enrolling records into a Cadence, and specify custom un-enrollment criteria

      Managing follow-ups effectively involves understanding the appropriate timing for reaching out, as well as knowing when to take a break and resume later, or deciding if it's necessary to start the follow-up process anew. With two significant enhancements
    • Automatic Invoice Number generation for createRecord

      Hello, while testing some custom Buttons in my Zoho Books application, I noticed that I get an error that previously did not occur. After some further digging I found that the automatic transaction numbering of invoices no longer work in my organization.
    • Stop completed task lists from disappearing?

      Is there any way to stop projects from making tasks lists disappear when all the tasks in the list are completed? That's one of those little things where we're constantly fighting the product. For instance we have some projects which are ongoing - no start and end date. We use Kanban view to show the various task lists. We don't want the kanban list to disappear every time the items on it happen to be closed out. Thanks
    • Approval Processes, Now in Standard and Professional

      We encourage existing Approval Process users to switch to the new UI to access enhanced capabilities, including naming each rule and stage, setting stage-specific field updates and tasks, sending email notifications upon rejection, and tracking progress
    • Zoho Inventory - Backorder Report

      I am requesting a backorder report in Zoho Inventory to show all backorders by Sales Order and/or Customer, including the quantity of each line item ordered and quantity fulfilled. This is important for businesses who operate a lean business model and
    • Can we do Image swatches for color variants?

      We want to do something like the attached screenshot on our new zoho store. We need image swatches instead of normal text selection. We want to user to select an image as color option. Is this doable? I don't see any option on zoho backend. Please h
    • Email-Data Synchronization with Zoho Analytics

      Hello everyone, Thanks to Chad and everyone who shared their feedback. We're excited to announce support for email data synchronization with Zoho Analytics. We have been working hard to bring this highly requested feature to life, and we'd like to walk
    • Update on Using Extensions in Custom Modules

      Extensions in Zoho Projects now support custom modules. You can add extensions to custom module records and configure where each extension appears and who can access it during installation. Supported Extensions: Checklist, Google Drive, SharePoint Configure
    • 【初開催】Zoho Mail / Workplace 活用勉強会 |11/27オンライン・無料

      ユーザーの皆さま、こんにちは。 ゾーホージャパンの中野です。 11月27日(金)、Zohoコミュニティでは初めてとなる「Zoho Mail / Workplace 活用勉強会」をオンラインで開催します! すでにZoho Mail / Workplaceをご利用中の方はもちろん、Zoho Oneをご利用中で、Zoho Mailの利用を検討している方も歓迎です。 Zoho社員が製品の概要に触れながら、具体的な利用場面に沿って活用方法をご紹介します。 ■ メール対応のミスや手間を減らす 添付忘れや誤送信の対策など、日々のメール業務に役立つ便利機能を取り上げます。
    • Trigger a Workflow Function if an Attachment (Related List) has been added

      Hello, I have a Case Module with a related list which is Attachment. I want to trigger a workflow if I added an attachment. I've seen some topics about this in zoho community that was posted few months ago and based on the answers, there is no trigger
    • Breaking Change Announcement: Users API Response Restricted for Client Portal Users

      Hi all, We are introducing a breaking change to the Users API when it is accessed by Client Portal users. Status: Live This change is now live in production. Please review your integrations and make the necessary updates. Affected endpoints: GET /users
    • automatic email reminder

      in need of an email reminder to participants having trained for a course but have not paid
    • Sharedmail box access via an api

      Hi, I am trying to access a sharedmailbox via an API. I am the moderator and creator of this shared mailbox. I have created a self client but when when i try to get list of all emails, it does not list the sharedmailbox. Help me to resolve this or provide
    • Duplicate Record Creation

      Hello Team, I would like to check whether there are any options available in Zoho FSM to prevent duplicate record creation in the following modules: Assets Companies Contacts Ideally, we would like the system to check for existing records before allowing
    • CC'd User Receiving Both Regular Email Chain Response & Reply Notification

      Hi, I am trying to set up the notifications for users and I'm a bit confused. I'm testing with personal accounts and my Desk agent, and I'm noticing that CC'd users are receiving both the regular email chain that the requester (contact) receives, but
    • Default View for Email Sent

      Hi, can the default view for email sent to candidates be "ALL" instead of the current user? I have to click the dropdown menu every time so that I can see if other recruiters have already sent an email to a candidate.  Thanks!
    • KB Articles - Can't See Content or Trigger Immediate Sync

      Once a file has been submitted to the KB, there's no way to check what it actually contains. There's also no way to force an immediate sync with the source document. These are issues when one is developing and testing an agent. It makes troubleshooting
    • Enable Screen Recording in Zoho WorkDrive Mobile Apps (Android & iOS)

      Hi Zoho WorkDrive Team, How are you? We are enthusiastic Zoho One users and rely heavily on Zoho WorkDrive for internal collaboration and content sharing. The screen-recording feature in the WorkDrive web app (similar to Loom) is extremely useful- however,
    • Add Comprehensive Accessibility Features to Zoho Writer

      Hello Zoho Writer Team, We hope you are doing well. We would like to submit a feature request to enhance Zoho Writer with a full set of accessibility tools, similar to the accessibility options already available in the Zoho Desk agent interface. 🚧 Current
    • Next Page