The Complete Guide: Step-by-Step Implementation
If you are looking to build this exact architecture yourself, here is the comprehensive implementation process for a full bidirectional sync.
Phase 1: Ecosystem Provisioning (Zoho Setup)
Before configuring the Salesforce framework, we must establish a secure endpoint and application definition within the Zoho ecosystem.
Log in to the Zoho API Console (api-console.zoho.com).
Navigate to your Dashboard and provision a new Self Client (ideal for POCs) or Server-based Application.
Under the Client Secret tab, secure your environment's Client ID and Client Secret.
Generate an initial Grant Token by defining your required scopes (e.g., ZohoCRM.modules.accounts.ALL or ZohoBooks.contacts.CREATE).
Phase 2: Outbound OAuth 2.0 Authentication (Salesforce to Zoho)
Zoho employs strict, rotating OAuth 2.0 security. For this POC, we generate a temporary execution token to authorize Salesforce's outbound calls.
Execute an initial POST request via Postman or your terminal using your Grant Token to retrieve an Access Token and a Refresh Token.
Extract and copy the generated Access Token string. (Note: Zoho access tokens expire after 60 minutes. For a production environment, you would automate the refresh token exchange via an Apex batch or Named Credentials).
Phase 3: Secure Credential Management (Salesforce)
Hardcoding authorization tokens creates massive security vulnerabilities. We utilize Custom Labels to inject the token dynamically at runtime.
Log in to your Salesforce Developer Org and navigate to Setup > Custom Labels.
Instantiate a New Custom Label named Zoho_Access_Token.
Paste the active Zoho Access Token into the Value parameter.
Click Save. (When the token expires during future development, simply update this single variable to restore system-wide access).
Phase 4: Apex Callout Architecture (SF Outbound)
We engineer a defensive Apex controller to format the Salesforce Account state, serialize it into a JSON payload, and execute the outbound HTTP REST transmission to Zoho.
Create a new Apex Class named ZohoIntegrationPOC.
Define an @AuraEnabled method (syncAccountToZoho) that accepts an accountId parameter.
Query the core Account parameters (e.g., Name, Phone, Website).
Construct the HttpRequest targeting the standard Zoho Insert/Update endpoint.
Apply the authorization header by referencing the dynamic label: req.setHeader('Authorization', 'Zoho-oauthtoken ' + Label.Zoho_Access_Token);
Execute the callout and parse the JSON response to extract either the newly created Zoho Record ID or the specific system fault.
Phase 5: LWC UI Instrumentation (SF Frontend)
We deploy a modern Lightning Web Component to act as the user interface, bridging client-side clicks to server-side logic.
Provision a new LWC named zohoSync.
HTML: Construct a <lightning-card> container with a <lightning-button> element bound to an onclick handler.
JavaScript: Import the Apex method and ShowToastEvent. Engineer the Promise chain to evaluate the backend response and dispatch a dynamic success (green) or error (red) toast notification.
XML: Define <isExposed>true</isExposed> and restrict the target strictly to lightning__RecordPage. Deploy this component to your Account Lightning Record Page.
Phase 6: Inbound Provisioning (Salesforce Connected App)
To achieve bidirectional sync, Salesforce must be prepared to receive data from Zoho when a record is updated on their end.
In Salesforce Setup, navigate to App Manager and create a New Connected App.
Enable OAuth Settings, define a callback URL, and assign the Full or Manage user data via APIs scopes.
Save the application and securely store the generated Consumer Key and Consumer Secret.
Generate an integration user Access Token or set up a secure Server-to-Server OAuth flow that Zoho can utilize.
Phase 7: Zoho Deluge Webhook Architecture (Zoho to SF)
We configure a workflow in Zoho to intercept record updates and push the new payload back to Salesforce natively.
In Zoho Setup, navigate to Automation > Workflow Rules and create a rule triggering on a record edit (e.g., when a Contact/Account is updated).
Select Custom Functions (Deluge) as the action.
Write a Deluge script that maps the Zoho fields to Salesforce fields.
Construct an invokeurl task targeting your Salesforce instance's standard REST API endpoint ([https://yourdomain.my.salesforce.com/services/data/vXX.0/sobjects/Account/](https://yourdomain.my.salesforce.com/services/data/vXX.0/sobjects/Account/){Salesforce_ID}).
Pass the Salesforce Bearer Token in the headers and the updated JSON payload in the body using a PATCH request to complete the loop.
Phase 8: End-to-End Validation & Fault Handling
Test Direction 1 (SF → Zoho): Open a test Account record in Salesforce. Trigger the sync process via the LWC button. Validate the successful UI Toast confirmation, then navigate to Zoho to confirm the record creation.
Test Direction 2 (Zoho → SF): In Zoho, modify the phone number or billing address of the synced record and save. Return to Salesforce and refresh the Account page to verify the Deluge webhook successfully updated the field.
Fault Testing: Attempt to sync a record missing a mandatory field and ensure the LWC gracefully surfaces the validation error.