Managing invoices manually every month is time-consuming and error-prone. Many businesses using Zoho Books download invoice PDFs and upload them manually into Zoho WorkDrive folders for accounting, audit, or compliance purposes.
But what if this entire process could be automated?
In this guide, you will learn how to automatically:
This solution is built using Zoho Deluge, Zoho Books API, and Zoho WorkDrive API.
Common Manual Process
This creates problems:
After invoice creation in Zoho Books:
Result: Clean, structured, automated invoice storage in WorkDrive.
Let’s break down the core logic of your Deluge function.
invoiceID = invoice.get("invoice_id");
getInvoiceNumber = invoice.get("invoice_number");
This retrieves:
getInvoicePDF = invokeurl
[
url :"https://www.zohoapis.com/books/v3/invoices/print?organization_id=XXXX&invoice_ids=" + invoiceID
type :GET
connection:"<Connection_Name>"
];
This uses the Zoho Books Print API to:
Then:
getInvoicePDF.setFileName(getInvoiceNumber + ".pdf");
getFileName = getInvoicePDF.getPrefix(".pdf");
The file is renamed as:
INV-00045.pdf
monthList = {"1":"January","2":"February","3":"March","4":"April","5":"May","6":"June","7":"July","8":"August","9":"September","10":"October","11":"November","12":"December"};
currentMonthNumber = zoho.currentdate.getMonth().toString();
currentYear = zoho.currentdate.getYear();
generateFolderName = monthList.get(currentMonthNumber) + "-" + currentYear;
Example output:
February-2026
This ensures structured, chronological storage.
getAllFolders = invokeurl
[
url :"https://www.zohoapis.com/workdrive/api/v1/teams/{team_id}/records?search%5Bname%5D=" + generateFolderName + "&filter%5BparentId%5D={parent_id}"
type :GET
connection:"<Connection_Name>"
];
This checks:
fileUpload = List();
fileUpload.add({"paramName":"filename","content":getFileName + ".pdf","stringPart":"true"});
fileUpload.add({"paramName":"override-name-exist","content":"true","stringPart":"true"});
fileUpload.add({"paramName":"content","content":getInvoicePDF,"stringPart":"false"});
fileUpload.add({"paramName":"parent_id","content":"{folder_id}","stringPart":"true"});
uploadFile = invokeurl
[
url :"https://www.zohoapis.com/workdrive/api/v1/upload"
type :POST
files:fileUpload
connection:"<Connection_Name>"
];
Invoice is uploaded directly into existing folder.
data = Map();
dataParam1 = Map();
attParam1 = Map();
attParam1.put("name",generateFolderName );
attParam1.put("parent_id","{parent_id}");
dataParam1.put("attributes",attParam1);
dataParam1.put("type","files");
data.put("data",dataParam1);
createFolder = invokeurl
[
url :"https://www.zohoapis.com/workdrive/api/v1/files"
type :POST
parameters:data.toString()
connection:"<Connection_Name>"
];
Then upload PDF into the newly created folder.
Before automation:
After automation:
| Feature | Benefit |
|---|---|
| Automatic folder creation | No missing folders |
| Auto PDF generation | No manual downloads |
| Structured naming | Clean document management |
| Cross-app integration | Seamless Zoho ecosystem |
| Audit-ready storage | Faster compliance process |
You should implement this if:
You can extend this solution by:
Can this run automatically when an invoice is created?
Does this work for EU, US, and IN data centers?
Can I store files in customer-specific folders?
Is this secure?
Can this be extended to Bills or Credit Notes?
This automation transforms invoice management inside Zoho One. By connecting Zoho Books and Zoho WorkDrive using Deluge and APIs, businesses can eliminate manual document handling completely.
If you are scaling your operations and want structured, automated document storage inside Zoho ecosystem, this solution is highly recommended.
👉 Read More: