ZOHO Integration

Zoho Books API: How to Fetch Invoice Details and PDF From a Custom Application


If you're building a custom application and you want it to pull invoice details, and the invoice PDF, out of Zoho Books, this walks through how that works. It's aimed at anyone deciding whether to build this or trying to understand what it involves. It stays practical rather than dropping into full code, but it's specific enough to know what you're getting into.

The basic idea

Zoho Books stores your invoices. Its API lets another application ask for them. So your custom app can request the details of an invoice, its number, amount, status, line items, and it can request the actual PDF of that invoice to show or let someone download. The app never becomes a copy of your accounting system; it just fetches what it needs from Zoho when it needs it.

The whole thing runs through your own backend, which does the talking to Zoho. This isn't optional, it's the correct and safe way, and I'll explain why as we go.

Step one: getting authorised

Before your app can fetch anything, it has to be allowed to. Zoho uses a standard, secure authorisation method (OAuth 2.0), where the business grants your application permission to access its Zoho Books data. You authorise once, and your backend then holds the credentials needed to keep making requests.

An important detail: only ask for the access you actually need. If your app only reads invoices, request read access to invoices, not full control of the whole account. Smaller access means less risk. And those credentials live on your server, never in the browser or the app's front end, because they're sensitive.

Step two: making sure you fetch the right invoice for the right person

This is the part people underestimate, and it's the most important. If your app shows invoices to customers, your backend has to be certain which invoices belong to the logged-in person, and only ever return those. That usually means keeping a link between your app's users and their matching customer in Zoho, so when someone logs in, you fetch that customer's invoices and nobody else's.

Get this wrong and one customer could see another's financial data, which on invoices is about the worst mistake you can make. So every request has to be tied to who's asking, and checked.

Step three: fetching the invoice details

Once authorised and certain of who's asking, your backend asks Zoho Books for the invoices, either a list for a customer, or the details of one specific invoice. Zoho returns the data, your backend applies whatever rules you have, and passes back a clean version to show. The customer sees a simple list or a single invoice; all the complexity stays hidden behind your backend.

Step four: fetching the PDF

The invoice PDF works the same way. Your app offers a "Download" button, and when it's clicked, your backend fetches the correct invoice's PDF from Zoho and returns it to the person, so they download it straight from your app without ever logging into Zoho.

The one rule you never break: the download must verify that the invoice belongs to the person requesting it. Never let a link like "download invoice number 12345" work just because someone changed the number in the address bar. The check happens on the server, every time, or you've built a way for people to fetch each other's invoices.

A detail that matters for international use

If you're building for a business outside your own country, remember Zoho runs across several regional data centers with different addresses, one for India, one for Saudi Arabia, and so on. Your app has to point at the region where the business's account actually lives, or the requests simply fail. This trips people up constantly, and I mentioned it in Zoho Books API integration.

Is it worth building?

Fetching invoices and PDFs into a custom app is worth it when you want customers or staff to work with invoice data inside your own application instead of sending them into Zoho, for a branded experience, or to combine invoices with other data your app holds. If all you need is basic invoice viewing, Zoho's own portal might already do it, worth checking first, as I discussed in Zoho vs custom software.

If you want this built

If you're building an application and need it to pull invoice details and PDFs from Zoho Books safely, that's a build I've done. Tell me what your app needs to show and to whom, and I'll tell you what it takes. You can see the kind of systems I've connected on my work page.

Book a free call

Rakesh Bhetariya

Share𝕏in