DEV Community

Cover image for How to Build Zoho Integration Services Using Node.js REST APIs
Sanya Mittal
Sanya Mittal

Posted on

How to Build Zoho Integration Services Using Node.js REST APIs

Modern businesses rely on multiple applications to manage sales, finance, customer support, and operations. However, these systems often operate independently, forcing teams to manually transfer data between platforms. Building Zoho Integration Services using REST APIs allows developers to automate these workflows while maintaining data consistency across applications. If you're planning enterprise-grade integrations, explore how Zoho Integration Services for enterprise applications can support your implementation.

In this article, we'll build a simple Node.js service that authenticates with Zoho CRM, retrieves customer records, and demonstrates how to create a scalable integration layer. We'll also cover architecture decisions, authentication, error handling, and implementation practices we've found effective in enterprise projects.

Context and Setup

A typical Zoho integration sits between Zoho applications and external systems such as ERP, eCommerce platforms, accounting software, or warehouse management systems.

                +---------------------+
                |     Zoho CRM        |
                +----------+----------+
                           |
                    REST API / OAuth
                           |
                +----------v----------+
                |  Node.js API Layer  |
                | (Express + Axios)   |
                +----------+----------+
                           |
        +------------------+------------------+
        |                  |                  |
   PostgreSQL         ERP System        Payment Gateway
Enter fullscreen mode Exit fullscreen mode

This architecture separates business logic from third-party applications, making future enhancements easier and reducing maintenance effort.

Prerequisites

Before writing code, you'll need:

  • Node.js 18+
  • Express.js
  • Axios
  • Zoho CRM API credentials
  • OAuth Client ID and Secret
  • Access Token
  • Basic understanding of REST APIs

According to the 2024 Stack Overflow Developer Survey, JavaScript continues to be the most commonly used programming language among professional developers, making Node.js a practical choice for integration services.

Building Zoho Integration Services with Node.js

Step 1: Create the Project

Begin by creating a new Express application.

mkdir zoho-crm-integration
cd zoho-crm-integration

npm init -y

npm install express axios dotenv
Enter fullscreen mode Exit fullscreen mode

Project structure:

project/
│
├── server.js
├── routes/
│   └── crm.js
├── services/
│   └── zohoService.js
├── .env
└── package.json
Enter fullscreen mode Exit fullscreen mode

Using a service layer keeps API communication separate from routing logic, making the application easier to maintain.

Step 2: Configure Environment Variables

Create a .env file.

PORT=3000

ZOHO_BASE_URL=https://www.zohoapis.com

ZOHO_ACCESS_TOKEN=YOUR_ACCESS_TOKEN
Enter fullscreen mode Exit fullscreen mode

Keeping secrets outside source code improves security and simplifies deployment across environments.

Step 3: Configure Express

server.js

require("dotenv").config();

const express = require("express");

const crmRoutes = require("./routes/crm");

const app = express();

app.use(express.json());

// CRM routes
app.use("/crm", crmRoutes);

const PORT = process.env.PORT || 3000;

app.listen(PORT, () => {
    console.log(`Server running on port ${PORT}`);
});
Enter fullscreen mode Exit fullscreen mode

This creates a lightweight API layer that can later be expanded with additional integrations such as Zoho Books, Zoho Desk, or third-party ERP systems.

*Step 4: Create the Zoho Service
*

services/zohoService.js

const axios = require("axios");

const BASE_URL = process.env.ZOHO_BASE_URL;

const TOKEN = process.env.ZOHO_ACCESS_TOKEN;

async function getLeads() {

    try {

        const response = await axios.get(

            `${BASE_URL}/crm/v2/Leads`,

            {

                headers: {

                    Authorization: `Zoho-oauthtoken ${TOKEN}`

                }

            }

        );

        return response.data;

    }

    catch (error) {

        console.error("Zoho API Error:", error.response?.data);

        throw error;

    }

}

module.exports = {

    getLeads

};
Enter fullscreen mode Exit fullscreen mode

Why use a service layer?

  • Keeps API logic isolated
  • Makes testing easier
  • Allows reuse across multiple routes
  • Simplifies future integrations with other Zoho products

Step 5: Create an API Endpoint

routes/crm.js

const express = require("express");

const router = express.Router();

const {

    getLeads

} = require("../services/zohoService");

router.get("/leads", async (req, res) => {

    try {

        const data = await getLeads();

        res.json(data);

    }

    catch (err) {

        res.status(500).json({

            message: "Unable to fetch leads"

        });

    }

});

module.exports = router;
Enter fullscreen mode Exit fullscreen mode

Testing the endpoint:

GET

http://localhost:3000/crm/leads
Enter fullscreen mode Exit fullscreen mode

If authentication is successful, the API returns lead records directly from Zoho CRM.

Why This Approach Works

Building Zoho Integration Services through a dedicated Node.js API layer offers several advantages over embedding API calls directly into business applications:

  • Centralized authentication management
  • Reusable integration logic
  • Easier debugging and monitoring
  • Simplified scaling as new systems are added
  • Cleaner separation between business workflows and external APIs

For organizations integrating CRM, ERP, finance, and customer support platforms, this architecture provides a maintainable foundation that can evolve as business requirements grow.

Handling Authentication and API Reliability

Authentication is one of the most common challenges when building Zoho Integration Services. Zoho OAuth access tokens expire periodically, so your integration should refresh them automatically instead of requiring manual intervention.

Step 6: Refresh OAuth Tokens Automatically

Store the refresh token securely and request a new access token whenever the existing one expires.

const axios = require("axios");

async function refreshAccessToken() {
const response = await axios.post(
"https://accounts.zoho.com/oauth/v2/token",
null,
{
params: {
refresh_token: process.env.ZOHO_REFRESH_TOKEN,
client_id: process.env.ZOHO_CLIENT_ID,
client_secret: process.env.ZOHO_CLIENT_SECRET,
grant_type: "refresh_token"
}
}
);

// Returns a new access token
return response.data.access_token;
Enter fullscreen mode Exit fullscreen mode

}

Why this matters

Prevents authentication failures
Supports unattended integrations
Reduces manual maintenance
Improves production stability

Step 7: Add Retry Logic

Enterprise integrations should recover from temporary failures such as network interruptions or API rate limits.

async function fetchWithRetry(apiCall, retries = 3) {

for (let attempt = 1; attempt <= retries; attempt++) {

    try {
        return await apiCall();
    } catch (error) {

        // Retry only if attempts remain
        if (attempt === retries) throw error;

        await new Promise(resolve =>
            setTimeout(resolve, 1000 * attempt)
        );

    }

}
Enter fullscreen mode Exit fullscreen mode

}

Retry logic reduces failed synchronization jobs caused by transient API errors.

Step 8: Process Webhooks

Polling APIs every few minutes creates unnecessary requests.

Instead, configure Zoho Webhooks to notify your application whenever important events occur.

Example workflow:

Lead Created


Zoho Webhook


Node.js Endpoint


Validate Payload


Update ERP Database

Benefits include:

Lower API consumption
Faster synchronization
Near real-time updates
Reduced infrastructure load
Performance Considerations

As integration volume increases, application design becomes increasingly important.

Recommended practices include:

Cache frequently used reference data.
Queue long-running synchronization jobs using BullMQ or RabbitMQ.
Log every failed request with correlation IDs.
Monitor API latency and error rates.
Validate incoming payloads before processing.
Avoid unnecessary API calls by synchronizing only changed records.

According to the State of API Report by Postman (2024), more than 70% of organizations consider APIs critical to digital transformation, reinforcing the need for reliable integration architectures rather than isolated point-to-point connections.

Real-World Application

In one of our Zoho Integration Services projects at oodles, a client wanted to synchronize Zoho CRM with an external ERP used by its finance and operations teams.

The challenge was duplicate customer records, delayed invoice generation, and inconsistent reporting because information was manually copied between applications.

Our engineering team implemented:

A dedicated Node.js integration service
OAuth 2.0 authentication
REST-based synchronization
Event-driven webhook processing
Retry mechanisms for failed API requests
Structured logging for easier debugging

Project outcomes:

Reduced manual data entry by approximately 75%
Improved order processing time by over 40%
Reduced synchronization failures through automated retries
Enabled future integrations without redesigning the architecture

The biggest lesson from the project was that successful integrations begin with business workflow analysis before writing API code.

Key Takeaways
Build a dedicated API layer instead of embedding integration logic throughout your application.
Automate OAuth token refresh to avoid production authentication failures.
Use webhook-driven synchronization whenever possible instead of continuous polling.
Implement retry mechanisms and structured logging to improve operational reliability.
Design integrations around business workflows so additional systems can be connected without significant redevelopment.
Join the Discussion

Have you built integrations between Zoho CRM and ERP, accounting, or eCommerce platforms? Share your approach or challenges in the comments.

If you're planning enterprise-grade Zoho Integration Services, we'd be happy to discuss architecture, API strategy, and implementation best practices.

1. What are Zoho Integration Services?

Zoho Integration Services connect Zoho applications with ERP systems, accounting software, eCommerce platforms, payment gateways, and custom applications through APIs, middleware, or webhooks to automate business processes and improve data consistency.

2. Why should I use Node.js for Zoho integrations?

Node.js provides asynchronous processing, excellent API support, and a mature ecosystem, making it suitable for handling concurrent API requests and real-time integrations.

3. Should I use polling or webhooks?

Webhooks are generally preferred because they provide event-driven updates, reduce unnecessary API requests, and improve synchronization speed. Polling is useful when webhook support is unavailable.

4. How should OAuth tokens be managed?

Store refresh tokens securely, automate access-token renewal, and avoid hardcoding credentials. This reduces authentication failures and supports long-running production integrations.

5. How can I improve the reliability of Zoho integrations?

Use retry logic, request validation, structured logging, centralized error handling, monitoring, and queue-based processing for long-running jobs. These practices improve stability and simplify troubleshooting.

Top comments (0)